[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES |
Date: |
Thu, 20 Sep 2018 14:18:37 -0300 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Thu, Sep 20, 2018 at 05:55:48PM +0800, Robert Hoo wrote:
> On Thu, 2018-09-20 at 00:13 -0300, Eduardo Habkost wrote:
> > On Sun, Sep 02, 2018 at 07:46:07PM +0800, Robert Hoo wrote:
> > > Note RSBA is specially treated -- no matter host support it or not,
> > > qemu
> > > pretends it is supported.
> > >
> > > Signed-off-by: Robert Hoo <address@hidden>
> > > ---
> > > target/i386/cpu.c | 27 ++++++++++++++++++++++++++-
> > > target/i386/cpu.h | 12 ++++++++++++
> > > 2 files changed, 38 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> > > index 0160e97..8ec9613 100644
> > > --- a/target/i386/cpu.c
> > > +++ b/target/i386/cpu.c
> > > @@ -1129,6 +1129,24 @@ static FeatureWordInfo
> > > feature_word_info[FEATURE_WORDS] = {
> > > .reg = R_EDX, },
> > > .tcg_features = ~0U,
> > > },
> > > + /*Below are MSR exposed features*/
> > > + [FEATURE_WORDS_ARCH_CAPABILITIES] = {
> > > + .type = MSR_FEATURE_WORD,
> > > + .feat_names = {
> > > + "rdctl-no", "ibrs-all", "rsba", NULL,
> > > + "ssb-no", NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + NULL, NULL, NULL, NULL,
> > > + },
> > > + .msr = { .index = MSR_IA32_ARCH_CAPABILITIES,
> > > + .cpuid_dep = { FEAT_7_0_EDX,
> > > + CPUID_7_0_EDX_ARCH_CAPABILITIES }
> > > + },
> > > + },
> >
> > One critical piece of the code seems to be missing: where exactly
> > is the MSR value being set on the VCPU before it runs?
> >
> I don't quite understand. Isn't such feature MSR read-only, like CPUID,
> simply to enumerate features?
The MSR is read-only for the guest, yes. But QEMU needs to call
KVM_SET_MSRS somewhere, to tell KVM what's the MSR value the
guest should see. I don't see any code doing that.
> [...]
--
Eduardo
[Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES, Robert Hoo, 2018/09/02
[Qemu-devel] [PATCH v4 1/3] x86: Data structure changes to support MSR based features, Robert Hoo, 2018/09/02
Re: [Qemu-devel] [PATCH v4 0/3] x86: QEMU side support on MSR based features, Robert Hoo, 2018/09/11