lkml.org 
[lkml]   [2020]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@intel.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.
>

\
 
 \ /
  Last update: 2020-02-24 23:42    [W:0.833 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site