From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D63A136CDEC for ; Tue, 7 Apr 2026 15:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775575761; cv=none; b=Al2zCNyt2z7jcJQ7RHzS8AoDM+JXfm0wDrRvQJAOPIXtYfF2V3Sh7RPCF44x6qJ/C3jTaZDTgrz78PH6GPtbPqUR3APCDdIJP7/1n+btkHjpSRa3tQg35nryZqAFhL5X2AmhBJgUGbtVEF86yFVK4ltQ+dng5FIIPziQymZt1tY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775575761; c=relaxed/simple; bh=uIhIdZLZ5hlz4N22TCntanIRfx8ojw1qhm3OsUrpWeY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RiIX1u6gUhSCCfTFcJsjmSHKTynvG5OAVcIBdPi9M0jsvW2uxl7HWrmunVU5e5PGCRMAbXmg7hL8V48Z8z9lwA+mgauPpZeRO+/kjGJun/cLuFkDhG+Vv8yFwDWXUOzAKObUQNkABPizLjP9kuFAH20UeBoGn8Datm5tLmesUFM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rt08gB/p; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rt08gB/p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F18F9C116C6; Tue, 7 Apr 2026 15:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775575759; bh=uIhIdZLZ5hlz4N22TCntanIRfx8ojw1qhm3OsUrpWeY=; h=From:To:Cc:Subject:Date:From; b=rt08gB/pYh7ggAIc3BfgQhWJdvwpABmMc7TP6Kchi0fa+AB5vsRs388bhi/GWRED9 vLj9H9vIe6Nn3RTOVAtGulB4XoJqL/0UpRONaB5CcwBrQ3PNDB42rldvcFbKbukh41 NQ/87kvEMmAb67K+I2DhJ3iJQOz63s3AIVAfsLYk/Dq13CtLeR8E078Mtb62E0zbTI Ew8QUQ3CSBgof3TpOu4F1IpNDZD5LPoXqqODPdYi+Prf2rwhiAlQB4mjQDBaB/1vLa AjmkGQVpo3V/SuoVJ3W9GMKZqmKjyvwgB+Z60GRqKuelDibISNYSqI/yfb2Vp3G9Ly Lb4pg/bDD+plA== From: "Aneesh Kumar K.V (Arm)" To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: "Aneesh Kumar K.V (Arm)" , Catalin Marinas , Will Deacon , Suzuki K Poulose , Steven Price , Gavin Shan Subject: [PATCH] arm64: rsi: use linear-map alias for realm config buffer Date: Tue, 7 Apr 2026 20:59:00 +0530 Message-ID: <20260407152900.396431-1-aneesh.kumar@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit rsi_get_realm_config() passes its argument to virt_to_phys(), but &config is a kernel image address and not a linear-map alias. On arm64 this triggers the below warning: virt_to_phys used for non-linear address: (____ptrval____) (config+0x0/0x1000) WARNING: arch/arm64/mm/physaddr.c:15 at __virt_to_phys+0x50/0x70, CPU#0: swapper/0 Modules linked in: ..... Hardware name: linux,dummy-virt (DT) pstate: 200000c5 (nzCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __virt_to_phys+0x50/0x70 lr : __virt_to_phys+0x4c/0x70 ..... ...... Call trace: __virt_to_phys+0x50/0x70 (P) arm64_rsi_init+0xa0/0x1b8 setup_arch+0x13c/0x1a0 start_kernel+0x68/0x398 __primary_switched+0x88/0x90 Pass lm_alias(&config) instead so the RSI call uses the linear-map alias of the same buffer and avoids the boot-time warning. Signed-off-by: Aneesh Kumar K.V (Arm) --- Cc: Catalin Marinas Cc: Will Deacon Cc: Suzuki K Poulose Cc: Steven Price Cc: Gavin Shan --- arch/arm64/kernel/rsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/rsi.c b/arch/arm64/kernel/rsi.c index 9e846ce4ef9c..92160f2e57ff 100644 --- a/arch/arm64/kernel/rsi.c +++ b/arch/arm64/kernel/rsi.c @@ -145,7 +145,7 @@ void __init arm64_rsi_init(void) return; if (!rsi_version_matches()) return; - if (WARN_ON(rsi_get_realm_config(&config))) + if (WARN_ON(rsi_get_realm_config(lm_alias(&config)))) return; prot_ns_shared = __phys_to_pte_val(BIT(config.ipa_bits - 1)); -- 2.43.0