From: Magnus Lindholm <linmag7@gmail.com>
To: richard.henderson@linaro.org, mattst88@gmail.com,
linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org
Cc: linmag7@gmail.com, stable@vger.kernel.org
Subject: [PATCH v5 7/8] alpha: invalidate the local context in flush_tlb_mm()
Date: Sat, 10 Oct 2026 16:24:33 +0200 [thread overview]
Message-ID: <20261010142533.974797-8-linmag7@gmail.com> (raw)
In-Reply-To: <20261010142533.974797-1-linmag7@gmail.com>
flush_tlb_mm() has the same caller-CPU omission that was fixed in
flush_tlb_page(): when the target mm is not the calling CPU's active_mm
nothing happens locally, and smp_call_function() handles only the other
CPUs, so this CPU may later reuse the old ASN together with the
translations it still holds.
The active_mm test itself is left alone here. That path calls
flush_tlb_current(), which loads a fresh context through
__load_new_mm_context() rather than issuing a targeted tbi() against
whatever ASN happens to be loaded, so it does not depend on which context
is current.
The uniprocessor implementation in asm/tlbflush.h already has the missing
branch. Counted over a fork-heavy run, flush_tlb_mm() was entered with the
mm not this CPU's active_mm 2934 times, and 632 times while otherwise idle.
The proposed Alpha hugetlb support routes hugetlb invalidations through
flush_tlb_range(), which calls this function. Unmapping or migrating a
hugetlb folio from another context will also need this local invalidate.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
---
arch/alpha/kernel/smp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index a5a42ae4a7d8..988e397b0b8a 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -649,6 +649,9 @@ flush_tlb_mm(struct mm_struct *mm)
preempt_enable();
return;
}
+ } else {
+ /* smp_call_function() does not call back into this CPU. */
+ flush_tlb_other(mm);
}
smp_call_function(ipi_flush_tlb_mm, mm, 1);
--
2.43.0
next prev parent reply other threads:[~2026-10-10 14:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 14:24 [PATCH v5 0/8] alpha: fix stale TLB translations breaking copy-on-write and writeback Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 1/8] alpha: load the MMU context when switch_mm() switches the current task Magnus Lindholm
2026-10-10 23:32 ` Matt Turner
2026-10-11 14:48 ` Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 2/8] alpha: run check_mmu_context() from finish_arch_post_lock_switch() Magnus Lindholm
2026-10-10 23:32 ` Matt Turner
2026-10-11 14:56 ` Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 3/8] alpha: only use a targeted tbi() when the target mm is really current Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 4/8] alpha: invalidate the local context in flush_tlb_page() Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 5/8] alpha: fix the local TLB invalidate " Magnus Lindholm
2026-10-10 14:24 ` [PATCH v5 6/8] alpha: fix the local TLB invalidate in the UP flush_tlb_page() Magnus Lindholm
2026-10-10 14:24 ` Magnus Lindholm [this message]
2026-10-10 14:24 ` [PATCH v5 8/8] alpha: invalidate the local context in flush_icache_user_page() Magnus Lindholm
2026-10-10 23:31 ` [PATCH v5 0/8] alpha: fix stale TLB translations breaking copy-on-write and writeback Matt Turner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261010142533.974797-8-linmag7@gmail.com \
--to=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=richard.henderson@linaro.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.