From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796304326; b=sN8u39UmETn2jpCK5RddMhTqlJsX6VLhu0LeS/I0Y1siQWNRAq/bl93Ls6+/M5vSV5U8 JDpMkmHYmxmFlwkOJe1YLwhAJMMF0oDFzR/w+2gyVGG+84SOZUKyi14SO+n/Xb6wxxAtd UAURod5l6bJ9AvQeTtjqPh5L+ZxmDJDKglUG7KoR3uBzxiB6kaUPJqICUR1M25wE2xZyr kQEt1MpLeb+PpeDmDDyonJvNFJNLwYTgkVwvTSYauqJ/JCEA++J4IwJ1a12oKTeQ1g+HM tkFmgqQ2XrIwZiK3xO0UaLv1ymdVOPXorRRZkkvcDArCzxhvdJW4XWDkl0r+6X6bZNQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304326; 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=fiYglMyZJSDCeCuWiO8BAvvYPZt6oVFpF2u111+mJ0o=; b=HrWNh7oYsUdlQGi5SRrNPuozI8yUs7iWsuxAdGIIdoz0rYBZ0i6rh30Mwo/utRLKzU5c vbmEIif71hTcRap0ZzbSTGpUSxwSAFLf1++UyftrrIYplhYM7Jd0VGaFBk5/ziN1Ur9CX ynodFbhlx7j2JYpIRR/xKRjcdqF3GFcMkLXpemRPVymFtr0vWBzpq26vTwjylTi9imxB9 FXqrDncaOZGGCUGLiITqJmIcwurlbY6l8r4ZWeNWq9eWrLwcZLPZaTLO/6SaV2ZnO3uc/ dqfqoz1c4ljc5w7ja4fpN/CWdBZP7xy1Mzy8LSJeykuuCjB3kdrHzHc5Db47uXnJ+GA== 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=L+iW888I; arc=none smtp.remote-ip=91.218.175.56 Received: from mta0.migadu.com (out-56.mta0.migadu.com [91.218.175.56]) (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 5A291606A33C for ; Thu, 3 Dec 2026 13:25:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5A291606A33C 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=L+iW888I X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=ozcKo8WDKU79SZPJSPjacS6wO7fpatkhxPOtrTlP4s0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796304323; v=1; x=1796909123; b=L+iW888I4f/HXApN13sT3thSCoFAD4Y02oKtsAzHkI/zhZK5T98zvSfcODUcfCt2KvZ0mugb LNMlq5X7ZuWQ9Ie9Jb4xGWF281g2g2+GFyT79ahLk2sA1pgjH1SDWe74WbPyu6fIO1SXE2O0NPC vhwFs7IfBxS2TQ8XsuM3/agg= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 5a9386e179711a23; Thu, 03 Dec 2026 13:25:20 +0000 X-Mizu-Trace-ID: 5a9386e179711a23 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 1/2] arm64: mm: Mask the TLBI operand in kpti_map_pgtbl() Date: Thu, 3 Dec 2026 13:25:16 +0000 Message-ID: <20261203132517.428942-2-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 kpti_map_pgtbl(), added by commit 47546a1912fc4 ("arm64: mm: install KPTI nG mappings with MMU enabled"), maps each page-table page at a fixed address near the top of the address space, after invalidating the address with TLBI VAAE1. The operand is the address shifted right by 12, so its upper bits end up in the TTL field as a hint for a 64K level 3 entry. On a 4K or 16K kernel the hint is wrong, and a CPU with FEAT_TTL isn't required to invalidate the old translation. idmap_kpti_install_ng_mappings() can then read the previous table through it instead of the next one, whose mappings stay global with KPTI enabled. Mask the operand down to VA[55:12], matching __TLBI_VADDR(). Signed-off-by: Fuad Tabba --- arch/arm64/mm/proc.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 12aacc74f7647..e122622838ff3 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -252,7 +252,7 @@ SYM_FUNC_ALIAS(__pi_idmap_cpu_replace_ttbr1, idmap_cpu_replace_ttbr1) str xzr, [temp_pte, #8 * (\level + 2)] // break before make dsb nshst add pte, temp_pte, #PAGE_SIZE * (\level + 2) - lsr pte, pte, #12 + ubfx pte, pte, #12, #44 tlbi vaae1, pte dsb nsh isb -- 2.47.3