From: Thorsten Blum <thorsten.blum@linux.dev>
To: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/sev: Use __pa() in __sme_early_map_unmap_mem()
Date: Wed, 17 Jun 2026 17:03:05 +0200 [thread overview]
Message-ID: <20260617150302.98522-4-thorsten.blum@linux.dev> (raw)
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 */
reply other threads:[~2026-06-17 15:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260617150302.98522-4-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox