riscv: mm: Introduce cntx2asid/cntx2version helper macros
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 27 Mar 2024 04:49:50 +0000 (21:49 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 29 Apr 2024 17:49:32 +0000 (10:49 -0700)
commit74cd17792d28162fe692d5a25fe5cc081203ad19
tree0658bc25719b17d844fca2068f71fe09991b3a44
parentd6dcdabafcd7c612b164079d00da6d9775863a0b
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>
arch/riscv/include/asm/mmu.h
arch/riscv/mm/context.c
arch/riscv/mm/tlbflush.c