From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5A543164DF for ; Fri, 10 Apr 2026 00:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.133.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775782390; cv=none; b=ZZt1myNyUOf9WAz20Y/Oa6yoKqdkyzknf9Gz4aFs8a9mxm/QNG2jXste+BRyWn2o6cHefKKhGQomCF9P/0JLZyAPbBwerfFbrZSDk9vAk8kbrDBLe09gMG+lQQPdjOYPMJj/oDVz39r9xYUwbW0hzhTlbTkZW31DJsnodDtze+Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775782390; c=relaxed/simple; bh=AcWBppZmSEyfD07vgovCMVznzoCH/SlfNUKTvXQAWwU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Xc1M1f4hm+Jfo3wctkw5KlNztNLCWagNzzc1RKLOIMVWerMcGGK6aaEqHeD3rov9SV0Wf+TXRwXteyZ/wzFwBqDh+QH+zxtGAI9oax2kmDwB5sXTisQ5C+b5sIz4ttYClX+Qv9Qmq6hSubvC4HBbcS0R1PiqJ5THYLm0W3r19Ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk; spf=none smtp.mailfrom=orcam.me.uk; arc=none smtp.client-ip=78.133.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0690C92009D; Fri, 10 Apr 2026 02:53:08 +0200 (CEST) From: "Maciej W. Rozycki" To: stable@vger.kernel.org Cc: "Maciej W. Rozycki" , Thomas Bogendoerfer Subject: [PATCH 6.1.y 2/3] MIPS: mm: Suppress TLB uniquification on EHINV hardware Date: Fri, 10 Apr 2026 01:52:58 +0100 Message-Id: <20260410005259.49430-2-macro@orcam.me.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20260410005259.49430-1-macro@orcam.me.uk> References: <20260410005259.49430-1-macro@orcam.me.uk> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 d9631f3b6460..3669895a85bf 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -630,7 +630,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.20.1