From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796304323; b=fpm7RnmtdybQc4qmzjjDU+MwypQOTLdsOajUwY67mSw8QDtiipyhx+HbM41kiywdCYQh DmcU1cxxNtbEEcIEEOfRwC9Ize6Vq7uG0z2eK6NMBvmqt84YuVizHCGg4mN0FLVW9Yd/e rwBktgjswij5inDu0S1eXkCDpUp2Cb0f1S17np7rAMupG60Zti8KtAAJ8jRRdV8INrnja AtYFe4dleBV1lEQkWPdLcn5fOIOP5luRsKa76Tdz+0F8BNYazl4tT7H0bRTXar5cdty2L WMWzw4vK+NFHCH0f/L+8tWVFEUfhQXYcZrIfEsi9ZhiDp5uB+OtpUOxS542DiEIEnAA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796304323; 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:MIME-Version:Content-Transfer-Encoding; bh=mrQ+CqL307eY8uEmtSNk3GnKBnr5IQw3vPlW9taHSQQ=; b=qztUAB6NONlH6PDIydr1QZmrpyYLE5PH8VwfBdkyVVry039eI2oifHYeYxB+LrNPdWRP L5zXol4B0YjptAV+XgW+Dfn4IRVUVTNaDt5xgjOH9MBfY6PXNAl0ulnc+ZvJLUWTyeFyh a3fVFkc6qRMY607/B+h1sLxkB+u2HXmnMHbuhS4yTrI5TjyHdcxwdYdaobifNSict9ZTb HxHbDxzcvqW7ZSRr1mtyXAAtKkBfPhb7tH1pd+WoVxXptXUeSRzBbod0LZvnWG/rDnEF8 fZkHiAuxUcGENOyogh1mPK4qvss5fi2cEdw3jMrnYIIhV6YSEU8sm2thYRNTuEEZsxQ== 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=ZTKXxd9W; arc=none smtp.remote-ip=91.218.175.53 Received: from mta0.migadu.com (out-53.mta0.migadu.com [91.218.175.53]) (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 34B1E606A32D for ; Thu, 3 Dec 2026 13:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 34B1E606A32D 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=ZTKXxd9W X-Envelope-To: linux-kernel@vger.kernel.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-kernel@vger.kernel.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-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 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