Re: [PATCH 2/2] KVM: Mask KVM_GET_SUPPORTED_CPUID data with Linux cpuid info

Avi Kivity
2010-11-09T14:08:06Z

On 11/01/2010 05:58 PM, Marcelo Tosatti wrote:
> On Sun, Oct 24, 2010 at 03:38:46PM +0200, Avi Kivity wrote:
> > This allows Linux to mask cpuid bits if, for example, nx is enabled on only
> > some cpus.
> >
> > Signed-off-by: Avi Kivity<avi@redhat.com>
> > ---
> > arch/x86/kvm/x86.c | 9 +++++++++
> > 1 files changed, 9 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 48ce015..54fda7e 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -2229,6 +2229,11 @@ out:
> > return r;
> > }
> >
> > +static void cpuid_mask(u32 *word, int wordnum)
> > +{
> > + *word&= boot_cpu_data.x86_capability[wordnum];
> > +}
> > +
> > static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> > u32 index)
> > {
> > @@ -2303,7 +2308,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> > break;
> > case 1:
> > entry->edx&= kvm_supported_word0_x86_features;
> > + cpuid_mask(&entry->edx, 0);
> > entry->ecx&= kvm_supported_word4_x86_features;
> > + cpuid_mask(&entry->edx, 4);
>
> ecx?
>

Yes. Will repost.

--
error compiling committee.c: too many arguments to function