From: Robert Hoo <robert.hu@linux.intel.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: robert.hu@intel.com, robert.hu@linux.intel.com,
pbonzini@redhat.com, rth@twiddle.net, thomas.lendacky@amd.com,
qemu-devel@nongnu.org, jingqi.liu@intel.com
Subject: Re: [Qemu-devel] [PATCH v3 1/3] x86: Data structure changes to support MSR based features
Date: Sat, 18 Aug 2018 11:10:16 +0800 [thread overview]
Message-ID: <1534561816.4104.3.camel@linux.intel.com> (raw)
In-Reply-To: <20180817031019.GZ15372@localhost.localdomain>
On Fri, 2018-08-17 at 00:10 -0300, Eduardo Habkost wrote:
[trim...]
> > +
> > typedef struct FeatureWordInfo {
> > - /* feature flags names are taken from "Intel Processor Identification and
> > + FeatureWordType type;
> > + /* feature flags names are taken from "Intel Processor Identification and
> > * the CPUID Instruction" and AMD's "CPUID Specification".
> > * In cases of disagreement between feature naming conventions,
> > * aliases may be added.
> > */
> > const char *feat_names[32];
> > - uint32_t cpuid_eax; /* Input EAX for CPUID */
> > - bool cpuid_needs_ecx; /* CPUID instruction uses ECX as input */
> > - uint32_t cpuid_ecx; /* Input ECX value for CPUID */
> > - int cpuid_reg; /* output register (R_* constant) */
> > + union {
> > + /* If type==CPUID_FEATURE_WORD */
> > + struct {
> > + uint32_t eax; /* Input EAX for CPUID */
> > + bool needs_ecx; /* CPUID instruction uses ECX as input */
> > + uint32_t ecx; /* Input ECX value for CPUID */
> > + int reg; /* output register (R_* constant) */
> > + } cpuid;
> > + /* If type==MSR_FEATURE_WORD */
> > + struct {
> > + uint32_t index;
> > + struct { /*CPUID that enumerate this MSR*/
> > + FeatureWord cpuid_class;
> > + uint32_t cpuid_flag;
> > + } cpuid_dep;
> > + } msr;
> > + };
> > uint32_t tcg_features; /* Feature flags supported by TCG */
> > uint32_t unmigratable_flags; /* Feature flags known to be unmigratable */
> > uint32_t migratable_flags; /* Feature flags known to be migratable */
>
> The data structure change looks good, but you are breaking the
> build if you touch them without updating the existing code. If
> you break the build in your series, you break git-bisect.
>
I had tested in my environment before send out, build has no even a
warning. Is it because this patch is based on master + previous icelake
cpu model set? I see you are pulling in previous icelake cpu model patch
set. I will rebase this patch to then master. Will previous icelake cpu
model patch set appear in master soon?
>
> [...]
> > + /*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 }
> > + },
> > + },
>
> I suggest moving this hunk to a separate patch: first we refactor
> the existing code without changing behavior or adding new
> features, then we add the new features.
>
Sure.
> > };
> >
> > typedef struct X86RegisterInfo32 {
> > diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> > index cddf9d9..9e8879e 100644
> > --- a/target/i386/cpu.h
> > +++ b/target/i386/cpu.h
> > @@ -502,9 +502,14 @@ typedef enum FeatureWord {
> > FEAT_6_EAX, /* CPUID[6].EAX */
> > FEAT_XSAVE_COMP_LO, /* CPUID[EAX=0xd,ECX=0].EAX */
> > FEAT_XSAVE_COMP_HI, /* CPUID[EAX=0xd,ECX=0].EDX */
> > + FEATURE_WORDS_NUM_CPUID,
> > + FEATURE_WORDS_FIRST_MSR = FEATURE_WORDS_NUM_CPUID,
> > + FEATURE_WORDS_ARCH_CAPABILITIES = FEATURE_WORDS_FIRST_MSR,
> > FEATURE_WORDS,
> > } FeatureWord;
> >
> > +#define FEATURE_WORDS_NUM_MSRS (FEATURE_WORDS - FEATURE_WORDS_FIRST_MSR)
> > +
> > typedef uint32_t FeatureWordArray[FEATURE_WORDS];
> >
> > /* cpuid_features bits */
> > --
> > 1.8.3.1
> >
> >
>
next prev parent reply other threads:[~2018-08-18 3:11 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 14:06 [Qemu-devel] [PATCH v3 0/3] x86: QEMU side support on MSR based features Robert Hoo
2018-08-10 14:06 ` [Qemu-devel] [PATCH v3 1/3] x86: Data structure changes to support " Robert Hoo
2018-08-17 3:10 ` Eduardo Habkost
2018-08-18 3:10 ` Robert Hoo [this message]
2018-08-18 5:48 ` Robert Hoo
2018-08-18 7:50 ` Paolo Bonzini
2018-08-17 15:50 ` Paolo Bonzini
2018-08-17 15:55 ` Eduardo Habkost
2018-08-17 17:34 ` Paolo Bonzini
2018-08-17 17:48 ` [Qemu-devel] X86CPU "feature-words" property on QEMU (was Re: [PATCH v3 1/3] x86: Data structure changes to support MSR based) features Eduardo Habkost
2018-08-17 17:59 ` Paolo Bonzini
2018-08-17 18:10 ` Eduardo Habkost
2018-08-10 14:06 ` [Qemu-devel] [PATCH v3 2/3] kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl Robert Hoo
2018-08-17 13:18 ` Eduardo Habkost
2018-08-18 7:27 ` Robert Hoo
2018-08-18 15:05 ` Eduardo Habkost
2018-08-23 6:28 ` Robert Hoo
2018-08-23 17:11 ` Eduardo Habkost
2018-08-23 17:28 ` Paolo Bonzini
2018-08-23 17:36 ` Eduardo Habkost
2018-08-23 20:23 ` Paolo Bonzini
2018-08-25 17:27 ` Eduardo Habkost
2018-08-30 4:22 ` Robert Hoo
2018-08-30 18:28 ` Eduardo Habkost
2018-08-10 14:06 ` [Qemu-devel] [PATCH v3 3/3] Change other funcitons referring to feature_word_info[] Robert Hoo
2018-08-10 15:17 ` Eric Blake
2018-08-14 10:06 ` Robert Hoo
2018-08-17 13:28 ` Eduardo Habkost
2018-08-18 9:01 ` Robert Hoo
2018-08-18 15:10 ` Eduardo Habkost
2018-08-17 15:52 ` Paolo Bonzini
2018-08-18 12:53 ` Robert Hoo
2018-09-05 5:47 ` Robert Hoo
2018-09-05 14:10 ` Eduardo Habkost
2018-09-05 15:32 ` Eric Blake
2018-09-05 16:44 ` Eduardo Habkost
2018-09-05 17:41 ` Eric Blake
2018-09-06 6:00 ` Hu, Robert
2018-09-10 17:38 ` Eduardo Habkost
2018-09-11 1:44 ` Robert Hoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1534561816.4104.3.camel@linux.intel.com \
--to=robert.hu@linux.intel.com \
--cc=ehabkost@redhat.com \
--cc=jingqi.liu@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=robert.hu@intel.com \
--cc=rth@twiddle.net \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.