Re: [PATCH 2/3] KVM: x86: Report CPUID.7.1 support on CPUs with CPUID.7 indices > 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 26, 2022 at 4:54 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Fri, Aug 26, 2022, Jim Mattson wrote:
> > Previously, KVM reported support for CPUID.(EAX=7,ECX=1) only if the
> > maximum leaf 7 index on the host was exactly 1. A recent microcode
> > patch for Ice Lake raised the maximum leaf 7 index from 0 to 2,
> > skipping right over 1. Though that patch left CPUID.(EAX=7,ECX=1)
> > filled with zeros on Ice Lake, it nonetheless exposed this bug.
> >
> > Report CPUID.(EAX=7,ECX=1) support if the maximum leaf 7 index on the
> > host is at least 1.
> >
> > Cc: Sean Christopherson <seanjc@xxxxxxxxxx>
> > Fixes: bcf600ca8d21 ("KVM: x86: Remove the unnecessary loop on CPUID 0x7 sub-leafs")
> > Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
> > ---
> >  arch/x86/kvm/cpuid.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> > index 07be45c5bb93..64cdabb3cb2c 100644
> > --- a/arch/x86/kvm/cpuid.c
> > +++ b/arch/x86/kvm/cpuid.c
> > @@ -886,7 +886,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
> >               cpuid_entry_override(entry, CPUID_7_EDX);
> >
> >               /* KVM only supports 0x7.0 and 0x7.1, capped above via min(). */
> > -             if (entry->eax == 1) {
> > +             if (entry->eax >= 1) {
>
> But as the comment says, above this is:
>
>                 entry->eax = min(entry->eax, 1u);
>
>                 ...
>
>                 /* KVM only supports 0x7.0 and 0x7.1, capped above via min(). */
>                 if (entry->eax == 1) {
>
> What am I missing?

It's not you; it's me. There's no bug here.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux