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 BD9DC25332E; Mon, 13 Apr 2026 16:03:37 +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=1776096217; cv=none; b=hbbCml07f6T/PWcoZh+IMW+Jt5xRAAklfcr4QEwhtIe9XJl28G/kK9X1RX9Nbbh6pn37lmzA7SCl4EpVVJgcoGb6wvT6p+Ei1Uin7qdqS/tY6pilGNqWBEQPZHwe/RggrsgQC/LT3SjdkHf2LDQNJwkeckZF93Jgojoc6RUI2Ak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096217; c=relaxed/simple; bh=j4gWz/bcNxV9BofQZfSBLmYxuPDTnSbLawkcXHB90OI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q23NCCkR+NjOw7WDkNPUAMhmHv8zWe7nENCO/JQigZHNHwwZEOx0CtCf694n7sjJAGlRGaax3yXTWDUvMh+mIipYpHum8NldU9qJ1UZarSO+l6TVLqTxErttKhUHN3wA6SHISWDgAsNwAK0pRiUP2qaiyMgvu0/VwAFchSytixo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nk7cYdN3; 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="nk7cYdN3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 220FAC2BCAF; Mon, 13 Apr 2026 16:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096217; bh=j4gWz/bcNxV9BofQZfSBLmYxuPDTnSbLawkcXHB90OI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nk7cYdN3RGwjgaTrpdhLOcM5YeEhzf7mlc91e7B2c59CrIKKPcY3BlT0/tfmUS3mF YY3NuAFilXgABOPTeh6pWzx3Sq1B/G2RnuDQUlJuF2DfmZBMAF9klni1+FLTai8Lo0 EeCuA8j7029sYd3M7atTNPVLKJ+pqcD2Bvus1l2M= 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.19 13/86] MIPS: mm: Suppress TLB uniquification on EHINV hardware Date: Mon, 13 Apr 2026 17:59:20 +0200 Message-ID: <20260413155732.069045212@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155731.568515178@linuxfoundation.org> References: <20260413155731.568515178@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-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 645f77e09d5b8..65f0357958fc7 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -640,7 +640,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