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 2A8CC24DCF6; Mon, 13 Apr 2026 16:16:33 +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=1776096993; cv=none; b=lvRs791oOVM+1pK5J2CJjpE0t8HCCX82pZqfaB6bOOpfIErmXCaJ07c7raRe1Eu5nPffwUgWWR5D12oNBHN0T/G5VcLflycIqZOPXo/ucutJfSwzRKxsZgdthESVXyPl7Nd6ElVnO1YRFPiJ2kBVkA5zwfYRkZBIXYnZwx/NTDM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096993; c=relaxed/simple; bh=/PMoO0SYHdJYqwy1MjPg4GWu47ITimf+cXk2383U/lQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uj6vw877TsJOc1H8CfuA7/3ac5Vk50l3a4Ui2gYt/ZqFI0AAhb6z5Vgx9PtAvxamt5yYImkEhmURlqosgjNqfLZS/irmEbdik9gYMDtuaMTK1A2WmSgg9TQ1+P5pfbF7L+cpopfTT0Qh35118XrLgnC1Kf0Qq9tgJFnUfznzhmU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ND8uEXKF; 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="ND8uEXKF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6C7AC2BCAF; Mon, 13 Apr 2026 16:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096993; bh=/PMoO0SYHdJYqwy1MjPg4GWu47ITimf+cXk2383U/lQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ND8uEXKFjFmsanYt3DQt2/ho742/Q3KPNNt8B8xZ/NcYy8aU5GAiwKwvraBOivx+B fKefBGY3fy9dr7VHpC6bkCWKwa0n/ROy8lVqeJM2Ls8yPdeOlEh9N8sfqIUTQWJ0hY vWWaBtY5hay0AWT54h3QS8VMOTyL9D9QRN1ufycE= 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.1 08/55] MIPS: mm: Suppress TLB uniquification on EHINV hardware Date: Mon, 13 Apr 2026 18:00:42 +0200 Message-ID: <20260413155725.134292983@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155724.820472494@linuxfoundation.org> References: <20260413155724.820472494@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.1-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 d9631f3b6460d..3669895a85bf2 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.53.0