All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] SVM: Replace numeric value for SME CPUID leaf with a #define
@ 2020-08-29  0:59 Krish Sadhukhan
  2020-08-29  0:59 ` [PATCH 2/2] KVM: SVM: Don't flush cache of SEV-encrypted pages if hardware enforces cache coherency across encryption domains Krish Sadhukhan
  0 siblings, 1 reply; 4+ messages in thread
From: Krish Sadhukhan @ 2020-08-29  0:59 UTC (permalink / raw)
  To: kvm; +Cc: pbonzini, jmattson

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(-)

diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h
index 8a1f5382a4ea..9eea127563fb 100644
--- a/arch/x86/include/asm/svm.h
+++ b/arch/x86/include/asm/svm.h
@@ -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
 
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 03dd7bac8034..97333b4ece5a 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -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 */
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-02  2:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29  0:59 [PATCH 1/2] SVM: Replace numeric value for SME CPUID leaf with a #define Krish Sadhukhan
2020-08-29  0:59 ` [PATCH 2/2] KVM: SVM: Don't flush cache of SEV-encrypted pages if hardware enforces cache coherency across encryption domains Krish Sadhukhan
2020-08-31 16:14   ` Tom Lendacky
2020-09-02  2:20     ` Krish Sadhukhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.