Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.63 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796304331; b=yI5f/ZM/qtBsBAl9+OBzaMiN7qBSo5exvTOdqQLQJ+CrnMrSesZUgPF5vQHYGH6Ow8Hz i17IDDWkKMu9x5Zw+HXAk6Gqw/JXgqpcGvLx4jp3W6ZIj+HV1R00urQ0x6VHgJMFSRvvs yshPmooIIWHSwLDivXwWNGGOoKDRjTIoqwHYFVsp9Iq3bFmIIKawloxkg/6n960KhLThE orWbovxiM2PpNYDYD95l9v6QCZUuEv3VW3x2maPZfSS47rsbZYIhRg0/scTycJgpCMN7G mNBuRghem9TJrIeVdzaqsQtpAeTjcPYUSupuUtumCxPV5yT1damq9mZOsuQkVHr+Y5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304331; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=835yNwGM86WqkR3S671K4f3d5Kys/8CW3lx6gMxxtM0=; b=HxwHdWWHx4EshTzAijwBvuWBne2t0JrPmo+Qi52ET5gTPxuNG2CdxQXYvu9IKJMPqqc3 uKi9jReX3zso5vzm0niGK7ZHPbF8QnBRzFTMMzVpJTeDuxE0IwvdR+pIDZyBQ6JmV7Lls 6y3AkXXh33tFjwszEvPl+hUwUpb1ePF6PNNcKzu4koiAyF/ipdWIx8RYyFEoavg/vn3Md fpUmahOGhOmDL4Okxw1jBNw/SOtvYAsBLssFUn9IuU1xKm0/L/ONvUFrCapcLZvD/6YXy ZpWdwNzAD/e29k6fK+a38uvVmnEgG3kxP9jLUA6lRnvb1QWhjh1U2uMkmoagFlrdZJA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Zo9NQPhD; arc=none smtp.remote-ip=91.218.175.63 Received: from mta0.migadu.com (out-63.mta0.migadu.com [91.218.175.63]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23CC2606A322 for ; Thu, 3 Dec 2026 13:25:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 23CC2606A322 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, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Zo9NQPhD X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=SGXzDCFsiMN7eBiCVY4H4MPwc6Q+FgvETLfaHrBkybg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796304329; v=1; x=1796909129; b=Zo9NQPhDgEI0Z2Z1Ny9MgBjEf7FijsSieXdipVPin9BbQlCphNAyDV7TBIzAOGoWvPBHgb5u bt8CSJCQ0MAT/auU30pk3zXtEK6Cr//Bn2ePKmrhOubgvA3dvbsJv1fF3SF03UEYYSifO65jDz0 ltcV7jtkgmwHGo1cNbMM9Ruo= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id d18c99f83662b8ce; Thu, 03 Dec 2026 13:25:25 +0000 X-Mizu-Trace-ID: d18c99f83662b8ce X-Migadu-Flow: FLOW_OUT From: Fuad Tabba To: Catalin Marinas , Will Deacon Cc: Mark Rutland , Ard Biesheuvel , Ryan Roberts , Anshuman Khandual , Kevin Brodsky , Vladimir Murzin , Carl Worth , Linu Cherian , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Fuad Tabba Subject: [PATCH 2/2] arm64: mm: Convert the temporary KPTI pgd address for TTBR1_EL1 Date: Thu, 3 Dec 2026 13:25:17 +0000 Message-ID: <20261203132517.428942-3-fuad.tabba@linux.dev> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261203132517.428942-1-fuad.tabba@linux.dev> References: <20261203132517.428942-1-fuad.tabba@linux.dev> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since commit 47546a1912fc4 ("arm64: mm: install KPTI nG mappings with MMU enabled"), idmap_kpti_install_ng_mappings() writes the address of the temporary pgd to TTBR1_EL1 without the phys_to_ttbr conversion. For a pgd above 2^48 with CONFIG_ARM64_PA_BITS_52, the CPU walks from the wrong table and the boot hangs. The kernel image is kept below 2^48, but this pgd comes from the page allocator. Systems aren't known to have RAM that high. Use load_ttbr1, which does the conversion. Signed-off-by: Fuad Tabba --- arch/arm64/mm/proc.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index e122622838ff3..5b95489152a78 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -313,9 +313,7 @@ SYM_TYPED_FUNC_START(idmap_kpti_install_ng_mappings) /* Switch to the temporary page tables on this CPU only */ __idmap_cpu_set_reserved_ttbr1 x8, x9 - offset_ttbr1 temp_pgd_phys, x8 - msr ttbr1_el1, temp_pgd_phys - isb + load_ttbr1 temp_pgd_phys, x8, x9 mov temp_pte, x5 mov_q pte_flags, KPTI_NG_PTE_FLAGS -- 2.47.3