diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-08-19 17:24:07 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-08-22 10:09:11 +0200 |
commit | 0c54914d0c52a15db9954a76ce80fee32cf318f4 (patch) | |
tree | d116b990512c350646f822725690c2a208687a9c /arch/x86/kvm/x86.c | |
parent | 50896de4be7e08fc47f857f6e0c0e9ab2654b941 (diff) | |
download | lwn-0c54914d0c52a15db9954a76ce80fee32cf318f4.tar.gz lwn-0c54914d0c52a15db9954a76ce80fee32cf318f4.zip |
KVM: x86: use Intel speculation bugs and features as derived in generic x86 code
Similar to AMD bits, set the Intel bits from the vendor-independent
feature and bug flags, because KVM_GET_SUPPORTED_CPUID does not care
about the vendor and they should be set on AMD processors as well.
Suggested-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 93b0bd45ac73..6b81c7609d09 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1254,6 +1254,13 @@ static u64 kvm_get_arch_capabilities(void) if (l1tf_vmx_mitigation != VMENTER_L1D_FLUSH_NEVER) data |= ARCH_CAP_SKIP_VMENTRY_L1DFLUSH; + if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) + data |= ARCH_CAP_RDCL_NO; + if (!boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS)) + data |= ARCH_CAP_SSB_NO; + if (!boot_cpu_has_bug(X86_BUG_MDS)) + data |= ARCH_CAP_MDS_NO; + return data; } |