From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35B8A606A339 for ; Thu, 3 Dec 2026 13:25:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=erZQ/UKe; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ZTKXxd9W DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=mrQ+CqL307eY8uEmtSNk3GnKBnr5IQw3vPlW9taHSQQ=; b=erZQ/UKeuGg0syEdKgupOqeBX/ FsZFIhYdoY33im0v5RzYI1x+N/zNy/xSmithGBUVzmI7eh6x7+tWebtdo4bel6PvJJ/soVJwcQiDX R59v9rQu0acIa8ji/ty3StN7RNrvXWyJLILdU0OxYPhgjYdm5TEHA5wxss7BoN+3V4JEz4opW7YLV Bz0tYd2aqnMg21JrMrQUsq82pIq2owl17Q16FyZH1C/CwH0r4kOhBApKPwJJzwc3MT8dYy1RUPeQi eotpVJ1DJ8V0PphEqLrrd3BuLcGoELQb65jkUILvCfmrBivRiR7d7r1jyL1SUINbpvbGJ7ob5AuCW cFNVxJFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ6oP-0000000EiNj-2K0O; Thu, 03 Dec 2026 13:25:26 +0000 Received: from out-8.mta0.migadu.com ([2001:41d0:1004:224b::8] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ6oM-0000000EiL0-1bGd for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 13:25:24 +0000 X-Envelope-To: linux-arm-kernel@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=e55X7r8Dru3EeIyA+5G54Ca023TT17HJOaoltwp4JME=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796304320; v=1; x=1796909120; b=ZTKXxd9WrYFQn99Xp9Uc2PG0C7VOml2vjCQ8x7FYapIIxhIJk6bGwzd1pU7/LX5oy31Drp3J 2xzPe9U9xLD2UBQK7SHHk4hveNjOb29X+t2pZc5dZt6PeGKTye2HKJ6HcqOGyaCK5X5BP9Lnm0c kEc+4xm2s7xx1ioPNOiLmkK0= X-Envelope-To: linux-arm-kernel@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id f6ae9aeb8bf52bf0; Thu, 03 Dec 2026 13:25:18 +0000 X-Mizu-Trace-ID: f6ae9aeb8bf52bf0 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 0/2] arm64: mm: Fix a TLBI operand and a TTBR1 write in the KPTI nG rewrite Date: Thu, 3 Dec 2026 13:25:15 +0000 Message-ID: <20261203132517.428942-1-fuad.tabba@linux.dev> X-Mailer: git-send-email 2.47.3 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_052522_627030_73F4C563 X-CRM114-Status: GOOD ( 12.47 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi folks, This series fixes a TLBI operand and a TTBR1_EL1 write in idmap_kpti_install_ng_mappings(). Both came up while I was working on the ISB fix to the same code [1]. The first masks the TLBI operand in kpti_map_pgtbl(). Its upper bits hold a wrong TTL hint on 4K and 16K kernels, which can leave kernel mappings global. I couldn't find a CPU with FEAT_TTL that requires KPTI, so hitting this takes kpti=on. The Falkor workaround in tramp_map_kernel has the same unmasked operand. I left it alone, as AFAICT the CPUs with that erratum predate FEAT_TTL. The second converts the temporary pgd's address before writing it to TTBR1_EL1, which changes the value only for tables above 2^48 on a 52-bit PA kernel. Both bugs were introduced by commit 47546a1912fc4 ("arm64: mm: install KPTI nG mappings with MMU enabled"). I left out the Fixes: tags, as I don't think either is worth a backport. Tested on QEMU (4K, and 64K with 52-bit PA) and on FVP, with "nokaslr kpti=on". The second bug reproduces on QEMU with RAM placed at 2^48. Without the patch the boot hangs, and with it the kernel boots. I couldn't reproduce the first, as QEMU ignores the TTL hint and on FVP the patch doesn't change which mappings end up global. Based on Linux 7.4-rc1 (6628e7d4c6b25; also applies to arm64 for-next/fixes a7e632493acf3). Cheers, /fuad [1] https://lore.kernel.org/all/20261120121638.194154-1-fuad.tabba@linux.dev/ Fuad Tabba (2): arm64: mm: Mask the TLBI operand in kpti_map_pgtbl() arm64: mm: Convert the temporary KPTI pgd address for TTBR1_EL1 arch/arm64/mm/proc.S | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 -- 2.47.3