|
@@ -67,9 +67,7 @@ u64 kvm_supported_xcr0(void)
|
|
|
|
|
|
#define F(x) bit(X86_FEATURE_##x)
|
|
#define F(x) bit(X86_FEATURE_##x)
|
|
|
|
|
|
-/* These are scattered features in cpufeatures.h. */
|
|
|
|
-#define KVM_CPUID_BIT_AVX512_4VNNIW 2
|
|
|
|
-#define KVM_CPUID_BIT_AVX512_4FMAPS 3
|
|
|
|
|
|
+/* For scattered features from cpufeatures.h; we currently expose none */
|
|
#define KF(x) bit(KVM_CPUID_BIT_##x)
|
|
#define KF(x) bit(KVM_CPUID_BIT_##x)
|
|
|
|
|
|
int kvm_update_cpuid(struct kvm_vcpu *vcpu)
|
|
int kvm_update_cpuid(struct kvm_vcpu *vcpu)
|
|
@@ -392,7 +390,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|
|
|
|
|
/* cpuid 7.0.edx*/
|
|
/* cpuid 7.0.edx*/
|
|
const u32 kvm_cpuid_7_0_edx_x86_features =
|
|
const u32 kvm_cpuid_7_0_edx_x86_features =
|
|
- KF(AVX512_4VNNIW) | KF(AVX512_4FMAPS);
|
|
|
|
|
|
+ F(AVX512_4VNNIW) | F(AVX512_4FMAPS);
|
|
|
|
|
|
/* all calls to cpuid_count() should be made on the same cpu */
|
|
/* all calls to cpuid_count() should be made on the same cpu */
|
|
get_cpu();
|
|
get_cpu();
|
|
@@ -477,7 +475,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|
if (!tdp_enabled || !boot_cpu_has(X86_FEATURE_OSPKE))
|
|
if (!tdp_enabled || !boot_cpu_has(X86_FEATURE_OSPKE))
|
|
entry->ecx &= ~F(PKU);
|
|
entry->ecx &= ~F(PKU);
|
|
entry->edx &= kvm_cpuid_7_0_edx_x86_features;
|
|
entry->edx &= kvm_cpuid_7_0_edx_x86_features;
|
|
- entry->edx &= get_scattered_cpuid_leaf(7, 0, CPUID_EDX);
|
|
|
|
|
|
+ cpuid_mask(&entry->edx, CPUID_7_EDX);
|
|
} else {
|
|
} else {
|
|
entry->ebx = 0;
|
|
entry->ebx = 0;
|
|
entry->ecx = 0;
|
|
entry->ecx = 0;
|