diff options
author | Samuel Holland <samuel.holland@sifive.com> | 2024-03-27 07:49:50 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2024-04-29 20:49:32 +0300 |
commit | 74cd17792d28162fe692d5a25fe5cc081203ad19 (patch) | |
tree | 0658bc25719b17d844fca2068f71fe09991b3a44 /arch/riscv/mm/tlbflush.c | |
parent | d6dcdabafcd7c612b164079d00da6d9775863a0b (diff) | |
download | linux-74cd17792d28162fe692d5a25fe5cc081203ad19.tar.xz |
riscv: mm: Introduce cntx2asid/cntx2version helper macros
When using the ASID allocator, the MM context ID contains two values:
the ASID in the lower bits, and the allocator version number in the
remaining bits. Use macros to make this separation more obvious.
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20240327045035.368512-10-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/mm/tlbflush.c')
-rw-r--r-- | arch/riscv/mm/tlbflush.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 18af7b5053af..35266dd9a9a2 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -110,7 +110,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) ? - atomic_long_read(&mm->context.id) & asid_mask : FLUSH_TLB_NO_ASID; + cntx2asid(atomic_long_read(&mm->context.id)) : FLUSH_TLB_NO_ASID; } void flush_tlb_mm(struct mm_struct *mm) |