summaryrefslogtreecommitdiff
path: root/arch/riscv/mm/tlbflush.c
diff options
context:
space:
mode:
authorDylan Jhong <dylan@andestech.com>2023-03-13 06:49:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-30 13:49:28 +0300
commitaa8a49b61007395c30c18a7478086c93945d1835 (patch)
tree22d5b3e65d168d3ff84a02ba2f4c8236dc596703 /arch/riscv/mm/tlbflush.c
parent75e10d7fb97906ddb641c7b09773a91693570f63 (diff)
downloadlinux-aa8a49b61007395c30c18a7478086c93945d1835.tar.xz
riscv: mm: Fix incorrect ASID argument when flushing TLB
commit 9a801afd3eb95e1a89aba17321062df06fb49d98 upstream. Currently, we pass the CONTEXTID instead of the ASID to the TLB flush function. We should only take the ASID field to prevent from touching the reserved bit field. Fixes: 3f1e782998cd ("riscv: add ASID-based tlbflushing methods") Signed-off-by: Dylan Jhong <dylan@andestech.com> Reviewed-by: Sergey Matyukevich <sergey.matyukevich@syntacore.com> Link: https://lore.kernel.org/r/20230313034906.2401730-1-dylan@andestech.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/riscv/mm/tlbflush.c')
-rw-r--r--arch/riscv/mm/tlbflush.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c
index 37ed760d007c..ef701fa83f36 100644
--- a/arch/riscv/mm/tlbflush.c
+++ b/arch/riscv/mm/tlbflush.c
@@ -42,7 +42,7 @@ static void __sbi_tlb_flush_range(struct mm_struct *mm, unsigned long start,
/* check if the tlbflush needs to be sent to other CPUs */
broadcast = cpumask_any_but(cmask, cpuid) < nr_cpu_ids;
if (static_branch_unlikely(&use_asid_allocator)) {
- unsigned long asid = atomic_long_read(&mm->context.id);
+ unsigned long asid = atomic_long_read(&mm->context.id) & asid_mask;
if (broadcast) {
sbi_remote_sfence_vma_asid(cmask, start, size, asid);