• He Chen's avatar
    x86/cpuid: Provide get_scattered_cpuid_leaf() · 47bdf337
    He Chen authored
    Sparse populated CPUID leafs are collected in a software provided leaf to
    avoid bloat of the x86_capability array, but there is no way to rebuild the
    real leafs (e.g. for KVM CPUID enumeration) other than rereading the CPUID
    leaf from the CPU. While this is possible it is problematic as it does not
    take software disabled features into account. If a feature is disabled on
    the host it should not be exposed to a guest either.
    
    Add get_scattered_cpuid_leaf() which rebuilds the leaf from the scattered
    cpuid table information and the active CPU features.
    
    [ tglx: Rewrote changelog ]
    Signed-off-by: default avatarHe Chen <he.chen@linux.intel.com>
    Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: Luwei Kang <luwei.kang@intel.com>
    Cc: kvm@vger.kernel.org
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Piotr Luc <Piotr.Luc@intel.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Link: http://lkml.kernel.org/r/1478856336-9388-3-git-send-email-he.chen@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    47bdf337
processor.h 21.4 KB