Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit daef192

Browse files
SiFiveHollandpalmer-dabbelt
authored andcommitted
riscv: mm: Always use an ASID to flush mm contexts
Even if multiple ASIDs are not supported, using the single-ASID variant of the sfence.vma instruction preserves TLB entries for global (kernel) pages. So it is always more efficient to use the single-ASID code path. Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Link: https://lore.kernel.org/r/20240327045035.368512-14-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 8fc21cc commit daef192

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/riscv/mm/tlbflush.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ static void __flush_tlb_range(struct cpumask *cmask, unsigned long asid,
109109

110110
static inline unsigned long get_mm_asid(struct mm_struct *mm)
111111
{
112-
return static_branch_unlikely(&use_asid_allocator) ?
113-
cntx2asid(atomic_long_read(&mm->context.id)) : FLUSH_TLB_NO_ASID;
112+
return cntx2asid(atomic_long_read(&mm->context.id));
114113
}
115114

116115
void flush_tlb_mm(struct mm_struct *mm)

0 commit comments

Comments
 (0)