aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kvm/reverse_cpuid.h
diff options
context:
space:
mode:
authorGravatar Paolo Bonzini <pbonzini@redhat.com> 2021-04-21 19:11:15 -0700
committerGravatar Paolo Bonzini <pbonzini@redhat.com> 2021-04-26 05:27:15 -0400
commitd9db0fd6c5c9fa7c9a462a2c54d5e91455a74fca (patch)
tree44ca9d2af91b6486a802b4f32d188f191f6b74e3 /arch/x86/kvm/reverse_cpuid.h
parentKVM: SVM: Move SEV module params/variables to sev.c (diff)
downloadlinux-d9db0fd6c5c9fa7c9a462a2c54d5e91455a74fca.tar.gz
linux-d9db0fd6c5c9fa7c9a462a2c54d5e91455a74fca.tar.bz2
linux-d9db0fd6c5c9fa7c9a462a2c54d5e91455a74fca.zip
KVM: SEV: Mask CPUID[0x8000001F].eax according to supported features
Add a reverse-CPUID entry for the memory encryption word, 0x8000001F.EAX, and use it to override the supported CPUID flags reported to userspace. Masking the reported CPUID flags avoids over-reporting KVM support, e.g. without the mask a SEV-SNP capable CPU may incorrectly advertise SNP support to userspace. Clear SEV/SEV-ES if their corresponding module parameters are disabled, and clear the memory encryption leaf completely if SEV is not fully supported in KVM. Advertise SME_COHERENT in addition to SEV and SEV-ES, as the guest can use SME_COHERENT to avoid CLFLUSH operations. Explicitly omit SME and VM_PAGE_FLUSH from the reporting. These features are used by KVM, but are not exposed to the guest, e.g. guest access to related MSRs will fault. Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Co-developed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210422021125.3417167-6-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/reverse_cpuid.h')
-rw-r--r--arch/x86/kvm/reverse_cpuid.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/reverse_cpuid.h b/arch/x86/kvm/reverse_cpuid.h
index 8e0756ddab1a..a19d473d0184 100644
--- a/arch/x86/kvm/reverse_cpuid.h
+++ b/arch/x86/kvm/reverse_cpuid.h
@@ -47,6 +47,7 @@ static const struct cpuid_reg reverse_cpuid[] = {
[CPUID_7_EDX] = { 7, 0, CPUID_EDX},
[CPUID_7_1_EAX] = { 7, 1, CPUID_EAX},
[CPUID_12_EAX] = {0x00000012, 0, CPUID_EAX},
+ [CPUID_8000_001F_EAX] = {0x8000001f, 0, CPUID_EAX},
};
/*