On 05.08.2017 00:12, Radim Krčmář wrote: > This patch turns guest_cpuid_has_XYZ(cpuid) into guest_cpuid_has(cpuid, > X86_FEATURE_XYZ), which gets rid of many very similar helpers. > > When seeing a X86_FEATURE_*, we can know which cpuid it belongs to, but > this information isn't in common code, so we recreate it for KVM. > > Add some BUILD_BUG_ONs to make sure that it runs nicely. > > Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx> > --- > v2: > - fixed X86_FEATURE_RDTSCP (David) > - renamed best to entry (David) > - added const (David) > - added __always_inline (Paolo) > --- > arch/x86/kvm/cpuid.h | 170 +++++++++++++++++---------------------------------- > arch/x86/kvm/mmu.c | 7 ++- > arch/x86/kvm/mtrr.c | 2 +- > arch/x86/kvm/svm.c | 2 +- > arch/x86/kvm/vmx.c | 26 ++++---- > arch/x86/kvm/x86.c | 38 ++++++------ > 6 files changed, 95 insertions(+), 150 deletions(-) > Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> -- Thanks, David