diff options
author | John Allen <john.allen@amd.com> | 2019-12-19 23:17:59 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-27 21:59:35 +0300 |
commit | a47970ed74a535b1accb4bc73643fd5a93993c3e (patch) | |
tree | 31d40bc27e0c957f81ab4ce892ec9c20ad480167 /arch/x86/kvm/vmx/capabilities.h | |
parent | 8bd826d629d6ff4a4e647079db15d64d06346004 (diff) | |
download | linux-a47970ed74a535b1accb4bc73643fd5a93993c3e.tar.xz |
kvm/svm: PKU not currently supported
Current SVM implementation does not have support for handling PKU. Guests
running on a host with future AMD cpus that support the feature will read
garbage from the PKRU register and will hit segmentation faults on boot as
memory is getting marked as protected that should not be. Ensure that cpuid
from SVM does not advertise the feature.
Signed-off-by: John Allen <john.allen@amd.com>
Cc: stable@vger.kernel.org
Fixes: 0556cbdc2fbc ("x86/pkeys: Don't check if PKRU is zero before writing it")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx/capabilities.h')
-rw-r--r-- | arch/x86/kvm/vmx/capabilities.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h index 7aa69716d516..283bdb7071af 100644 --- a/arch/x86/kvm/vmx/capabilities.h +++ b/arch/x86/kvm/vmx/capabilities.h @@ -145,6 +145,11 @@ static inline bool vmx_umip_emulated(void) SECONDARY_EXEC_DESC; } +static inline bool vmx_pku_supported(void) +{ + return boot_cpu_has(X86_FEATURE_PKU); +} + static inline bool cpu_has_vmx_rdtscp(void) { return vmcs_config.cpu_based_2nd_exec_ctrl & |