[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200224224219.GN29865@linux.intel.com>
Date: Mon, 24 Feb 2020 14:42:19 -0800
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 27/61] KVM: x86: Introduce
cpuid_entry_{change,set,clear}() mutators
On Mon, Feb 24, 2020 at 02:43:07PM +0100, Vitaly Kuznetsov wrote:
> Sean Christopherson <sean.j.christopherson@...el.com> writes:
>
> > diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
> > index 64e96e4086e2..51f19eade5a0 100644
> > --- a/arch/x86/kvm/cpuid.h
> > +++ b/arch/x86/kvm/cpuid.h
> > @@ -135,6 +135,37 @@ static __always_inline bool cpuid_entry_has(struct kvm_cpuid_entry2 *entry,
> > return cpuid_entry_get(entry, x86_feature);
> > }
> >
> > +static __always_inline void cpuid_entry_clear(struct kvm_cpuid_entry2 *entry,
> > + unsigned x86_feature)
> > +{
> > + u32 *reg = cpuid_entry_get_reg(entry, x86_feature);
> > +
> > + *reg &= ~__feature_bit(x86_feature);
> > +}
> > +
> > +static __always_inline void cpuid_entry_set(struct kvm_cpuid_entry2 *entry,
> > + unsigned x86_feature)
> > +{
> > + int *reg = cpuid_entry_get_reg(entry, x86_feature);
>
> I think 'reg' should be 'u32', similar to cpuid_entry_clear()
Doh, thanks!
> > +
> > + *reg |= __feature_bit(x86_feature);
> > +}
> > +
> > +static __always_inline void cpuid_entry_change(struct kvm_cpuid_entry2 *entry,
> > + unsigned x86_feature, bool set)
> > +{
> > + int *reg = cpuid_entry_get_reg(entry, x86_feature);
>
> Ditto.
>
Powered by blists - more mailing lists