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 557A6283CBF; Mon, 13 Apr 2026 16:15:03 +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=1776096903; cv=none; b=h6I1A5H20GRKehTQt8XqSM1d4E8y3sboxP/dflAj5SxvJsPOZYonZ8fwHsvyfI510IszAuW/YJRxoZPJRGNY32hLAoidzonWNcflGT2A+p6ptS9s+dMPch68utkcTaNyBh4+WFOwIx6GDJofeGyS8gZMNNlUO5/HzkIa9xJS3Vo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096903; c=relaxed/simple; bh=k1Rf+S1zJJjoPjH860UVrm2HgNkFPoAO00sc0+fp1+Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cRVunEHnIL8J36eK0SJ2YX0KaW8kOeqw6iElbr/7UpahGB84qnF408ayJTUtgu4ulHQovtG9WD4E+f2+nOUzo8qihckvoIUQaj6+nNWYvfLIWToNafr68x3H8h3oL/aVlKWMdzNBm1UIPHNMxfazvOTjABCDRp+DiQuJPZlK2Og= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SOfjC+QI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SOfjC+QI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFFA4C2BCAF; Mon, 13 Apr 2026 16:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096903; bh=k1Rf+S1zJJjoPjH860UVrm2HgNkFPoAO00sc0+fp1+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SOfjC+QItiQj1/1MoXyiFlV2LDRbQT5MXK5YUombUOXdsRU5kHq3rI2yEBv2Cq5ed ocJ37mu6HqA015fyBfRYeINutuefWlfYcTy6f6vKLes9ZtGPjrzFRn81Mg9XCQn+je SU43k9uLXbl2rXa6e6xLMsmGkjsX7/kj2bScaEog= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Maciej W. Rozycki" , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 6.6 09/50] MIPS: mm: Suppress TLB uniquification on EHINV hardware Date: Mon, 13 Apr 2026 18:00:36 +0200 Message-ID: <20260413155724.855813029@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155724.497323914@linuxfoundation.org> References: <20260413155724.497323914@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit 74283cfe216392c7b776ebf6045b5b15ed9dffcd upstream. Hardware that supports the EHINV feature, mandatory for R6 ISA and FTLB implementation, lets software mark TLB entries invalid, which eliminates the need to ensure no duplicate matching entries are ever created. This feature is already used by local_flush_tlb_all(), via the UNIQUE_ENTRYHI macro, making the preceding call to r4k_tlb_uniquify() superfluous. The next change will also modify uniquification code such that it'll become incompatible with the FTLB and MMID features, as well as MIPSr6 CPUs that do not implement 4KiB pages. Therefore prevent r4k_tlb_uniquify() from being used on EHINV hardware, as denoted by `cpu_has_tlbinv'. Signed-off-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/mm/tlb-r4k.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 4d49ecf276103..18ae61b6f2b17 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -638,7 +638,8 @@ static void r4k_tlb_configure(void) temp_tlb_entry = current_cpu_data.tlbsize - 1; /* From this point on the ARC firmware is dead. */ - r4k_tlb_uniquify(); + if (!cpu_has_tlbinv) + r4k_tlb_uniquify(); local_flush_tlb_all(); /* Did I tell you that ARC SUCKS? */ -- 2.53.0