public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Check cc_vendor when printing memory encryption info
@ 2023-11-09 16:14 Jeremi Piotrowski
  2023-11-09 16:25 ` Dave Hansen
  0 siblings, 1 reply; 15+ messages in thread
From: Jeremi Piotrowski @ 2023-11-09 16:14 UTC (permalink / raw)
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, linux-kernel,
	Michael Kelley, Dexuan Cui
  Cc: Jeremi Piotrowski, linux-hyperv, stefan.bader, tim.gardner,
	roxana.nicolescu, cascardo, kys, haiyangz, wei.liu,
	kirill.shutemov, sashal

Check the value of cc_vendor to see if we're in an Intel TDX protected VM
instead of checking for the TDX_GUEST CPU feature. The rest of the function
already uses the abstractions available in cc_platform.h to check for
confidential computing features. For Intel, cc_vendor is set from
tdx_early_init() or hv_vtom_init(), so the new code correctly handles both
cases. The previous check relied on the Linux-controlled TDX_GUEST CPU feature
which is only set in tdx_early_init().

Signed-off-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
---
 arch/x86/mm/mem_encrypt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
index c290c55b632b..d3bd39aad8b6 100644
--- a/arch/x86/mm/mem_encrypt.c
+++ b/arch/x86/mm/mem_encrypt.c
@@ -44,7 +44,7 @@ static void print_mem_encrypt_feature_info(void)
 {
 	pr_info("Memory Encryption Features active:");
 
-	if (cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) {
+	if (cc_vendor == CC_VENDOR_INTEL) {
 		pr_cont(" Intel TDX\n");
 		return;
 	}
-- 
2.39.2


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

end of thread, other threads:[~2023-11-22 17:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-09 16:14 [PATCH] x86/mm: Check cc_vendor when printing memory encryption info Jeremi Piotrowski
2023-11-09 16:25 ` Dave Hansen
2023-11-09 16:35   ` Jeremi Piotrowski
2023-11-09 16:50     ` Dave Hansen
2023-11-09 18:41       ` Jeremi Piotrowski
2023-11-10 12:06         ` kirill.shutemov
2023-11-10 12:27           ` Jeremi Piotrowski
2023-11-10 12:46             ` kirill.shutemov
2023-11-10 13:42               ` Jeremi Piotrowski
2023-11-10 18:57                 ` kirill.shutemov
2023-11-22 17:11                   ` Jeremi Piotrowski
2023-11-10 13:17         ` Borislav Petkov
2023-11-10 15:51           ` Jeremi Piotrowski
2023-11-10 16:45             ` Borislav Petkov
2023-11-22 17:09               ` Jeremi Piotrowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox