From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DB7E4963DF for ; Wed, 17 Jun 2026 15:04:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781708680; cv=none; b=ohvd7qO14X3NIMAIGYJmyRMOZ3889U35zFxuIJa2B/J9zCVhGUgDeF/KHx85+IeXGRzjMyBm0WsB1gXgIPZHlw5598MjW2o2zYDKaVqmP7ZsBJ/7Qi3AMpfldmxRgNVAl53X4HFJxe4E8pUuYAZkdyRXGicIwgjFuIyLQ75KIqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781708680; c=relaxed/simple; bh=uuFP33F/qZ0JgEPXSbPWhUozx/Uwux+VPaRLsjl00ww=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PXawMUG4w7Jr3AKEL8jdU6+cSTV6Yd+IoKEcR+5jkjnxOm8lF5P75LWYhRcnohMfr3aVwtxySgIgqz8heMyoHweSBTmtvqWStVdwRGRqy9/+iLq6MucRrGo8X5yP3ubxLxwPegs9kkSBLX1/4K7utdJZvM7/FUpagSM8PJj+6lg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=fixEIuGp; arc=none smtp.client-ip=91.218.175.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="fixEIuGp" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781708677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Ul6DJZJJa7yjEZxvMnKigq8lIBgnYLjoBdV3RBjkS1I=; b=fixEIuGppNAlS1Y3IBHb5J4Xe9b1UxPMeoOYctXXT6SLeV1+qXLcZkmYTJc2yqzOCG50mF VUljrbUczEdM9y8GGYX5j1a99VRib9hiPZ8pSjRikbWtuLxAu+5dgKQ18awpXUW24i1px1 47OEXGr8feFScSYORVzzzx6m5s36hk0= From: Thorsten Blum To: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Cc: Thorsten Blum , 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 Message-ID: <20260617150302.98522-4-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=812; i=thorsten.blum@linux.dev; h=from:subject; bh=Q9VVgj1vk2V0pWubXHOvS08WpuG1ZECjtneRDc/mnu4=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDFlG29Ue/Nr7eqJCR/zMB2UM8yxFS/+3PW47krRuYUlOQ 9fi+z+EO0pZGMS4GGTFFFkezPoxw7e0pnKTScROmDmsTCBDGLg4BWAiy6cw/I85G67pYBUmkMz2 zpNhlrfdq91LOVseWYg2bjY0L2fsD2ZkOGM98e/ZZY1HTj+tkTfbJW2duv2maEyCd3+z/paLmT9 rGAE= X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Replace the open-coded virtual to physical address conversion with the __pa() helper. Signed-off-by: Thorsten Blum --- 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 */