diff options
author | Samuel Holland <samuel.holland@sifive.com> | 2024-03-26 21:49:54 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2024-04-29 10:49:36 -0700 |
commit | daef19263fc102551d734f39d9ad417098ffb360 (patch) | |
tree | 176ad901b7512769856c468ef91620275a91c81f /arch/riscv/mm | |
parent | 8fc21cc672e8ea7954fdc6b59d9ce350730e9c92 (diff) |
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>
Diffstat (limited to 'arch/riscv/mm')
-rw-r--r-- | arch/riscv/mm/tlbflush.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 35266dd9a9a2..44e7ed4e194f 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -109,8 +109,7 @@ static void __flush_tlb_range(struct cpumask *cmask, unsigned long asid, static inline unsigned long get_mm_asid(struct mm_struct *mm) { - return static_branch_unlikely(&use_asid_allocator) ? - cntx2asid(atomic_long_read(&mm->context.id)) : FLUSH_TLB_NO_ASID; + return cntx2asid(atomic_long_read(&mm->context.id)); } void flush_tlb_mm(struct mm_struct *mm) |