@@ -216,6 +216,7 @@ struct __attribute__ ((__packed__)) vmcb {
};
#define SVM_CPUID_FUNC 0x8000000a
+#define SVM_SME_CPUID_FUNC 0x8000001f
#define SVM_VM_CR_SVM_DISABLE 4
@@ -749,7 +749,7 @@ static __init void svm_adjust_mmio_mask(void)
u64 msr, mask;
/* If there is no memory encryption support, use existing mask */
- if (cpuid_eax(0x80000000) < 0x8000001f)
+ if (cpuid_eax(0x80000000) < SVM_SME_CPUID_FUNC)
return;
/* If memory encryption is not enabled, use existing mask */
@@ -757,7 +757,7 @@ static __init void svm_adjust_mmio_mask(void)
if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT))
return;
- enc_bit = cpuid_ebx(0x8000001f) & 0x3f;
+ enc_bit = cpuid_ebx(SVM_SME_CPUID_FUNC) & 0x3f;
mask_bit = boot_cpu_data.x86_phys_bits;
/* Increment the mask bit if it is the same as the encryption bit */
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com> --- arch/x86/include/asm/svm.h | 1 + arch/x86/kvm/svm/svm.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)