All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem()
@ 2026-06-17 15:03 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-06-17 15:03 UTC (permalink / raw)
  To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin
  Cc: Thorsten Blum, linux-kernel

Replace the open-coded virtual to physical address conversion with the
__pa() helper.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/x86/mm/mem_encrypt_amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mem_encrypt_amd.c b/arch/x86/mm/mem_encrypt_amd.c
index 2f8c32173972..8bd68bafc8cc 100644
--- a/arch/x86/mm/mem_encrypt_amd.c
+++ b/arch/x86/mm/mem_encrypt_amd.c
@@ -156,7 +156,7 @@ void __init sme_early_decrypt(resource_size_t paddr, unsigned long size)
 static void __init __sme_early_map_unmap_mem(void *vaddr, unsigned long size,
 					     bool map)
 {
-	unsigned long paddr = (unsigned long)vaddr - __PAGE_OFFSET;
+	unsigned long paddr = __pa(vaddr);
 	pmdval_t pmd_flags, pmd;
 
 	/* Use early_pmd_flags but remove the encryption mask */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-17 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 15:03 [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem() Thorsten Blum

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.