Paul Durrant 760849b147 KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
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_kvm_cpuid_base() (called from kvm_set_cpuid()) to locate the
leaves using the 'KVMKVMKVM\0\0\0' signature (which is now given a
definition in kvm_para.h). Adjustment of KVM_CPUID_FEATURES will hence now
target the correct leaf.

NOTE: A new for_each_possible_hypervisor_cpuid_base() macro is intoduced
      into processor.h to avoid having duplicate code for the iteration
      over possible hypervisor base leaves.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Message-Id: <20211105095101.5384-3-pdurrant@amazon.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-11 10:56:21 -05:00
..
2021-09-19 13:29:36 -07:00
2021-06-07 11:02:30 +02:00
2020-11-24 16:47:49 +01:00
2021-04-26 15:10:25 -07:00
2021-03-15 16:24:59 +01:00
2021-06-29 12:36:59 -07:00
2021-03-18 15:31:53 +01:00
2021-07-23 11:32:43 +10:00
2021-03-18 15:31:53 +01:00
2020-08-20 13:12:58 +02:00
2020-06-11 15:54:31 -07:00
2020-07-27 14:31:07 -04:00
2021-03-18 15:31:53 +01:00
2020-08-04 14:47:45 -07:00