* [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem()
@ 2026-06-17 15:03 Thorsten Blum
2026-06-18 11:16 ` Thorsten Blum
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem()
2026-06-17 15:03 [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem() Thorsten Blum
@ 2026-06-18 11:16 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2026-06-18 11:16 UTC (permalink / raw)
To: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin
Cc: linux-kernel
On Wed, Jun 17, 2026 at 05:03:05PM +0200, Thorsten Blum wrote:
> Replace the open-coded virtual to physical address conversion with the
> __pa() helper.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
sashiko [1] found that when CONFIG_DEBUG_VIRTUAL is enabled, the
validation in __phys_addr() can fail and trigger VIRTUAL_BUG_ON(). The
concern seems valid, so let's drop this patch.
[1] https://sashiko.dev/#/patchset/20260617150302.98522-4-thorsten.blum%40linux.dev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-18 11:16 UTC | newest]
Thread overview: 2+ messages (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
2026-06-18 11:16 ` Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox