Re: [PATCH] KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES

From: Sean Christopherson
Date: Thu Nov 04 2021 - 16:08:09 EST


On Thu, Nov 04, 2021, Durrant, Paul wrote:
> > -----Original Message-----
> > From: Sean Christopherson <seanjc@xxxxxxxxxx>
> > Sent: 04 November 2021 19:23
> > To: Paul Durrant <paul@xxxxxxx>
> > Cc: kvm@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Durrant, Paul <pdurrant@xxxxxxxxxxxx>; Paolo
> > Bonzini <pbonzini@xxxxxxxxxx>; Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>; Wanpeng Li
> > <wanpengli@xxxxxxxxxxx>; Jim Mattson <jmattson@xxxxxxxxxx>; Joerg Roedel <joro@xxxxxxxxxx>
> > Subject: RE: [EXTERNAL] [PATCH] KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
> >
> > On Thu, Nov 04, 2021, Paul Durrant wrote:
> > > From: Paul Durrant <pdurrant@xxxxxxxxxx>
> > >
> > > Currently when kvm_update_cpuid_runtime() runs, it assumes that the
> > > KVM_CPUID_FEATURES leaf is located at 0x40000001. This is not true,
> > > however, if Hyper-V support is enabled. In this case the KVM leaves will
> > > be offset.
> > >
> > > This patch introdues as new 'kvm_cpuid_base' field into struct
> > > kvm_vcpu_arch to track the location of the KVM leaves and function
> > > kvm_update_cpuid_base() (called from kvm_update_cpuid_runtime()) to locate
> > > the leaves using the 'KVMKVMKVM\0\0\0' signature. Adjustment of
> > > KVM_CPUID_FEATURES will hence now target the correct leaf.
> > >
> > > Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>
> > > ---
> > > Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> > > Cc: Sean Christopherson <seanjc@xxxxxxxxxx>
> > > Cc: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
> > > Cc: Wanpeng Li <wanpengli@xxxxxxxxxxx>
> > > Cc: Jim Mattson <jmattson@xxxxxxxxxx>
> > > Cc: Joerg Roedel <joro@xxxxxxxxxx>
> >
> > scripts/get_maintainer.pl is your friend :-)
>
> That's what I used, but thought it prudent to trim the list to just KVM reviewers.

Ah, yeah, I run get_maintainer.pl with "--pattern-depth=1" when I'm sending KVM
patches/series. That tells the script to stop recursing once its found a match.