riscv: mm: Use a fixed layout for the MM context ID
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 27 Mar 2024 04:49:51 +0000 (21:49 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 29 Apr 2024 17:49:33 +0000 (10:49 -0700)
commitf58e5dc45fa93a2f2a0028381b2e06fe74ae9e2c
tree0102a9b57ed51756c9bb40dce62f8e4fd56cc3c0
parent74cd17792d28162fe692d5a25fe5cc081203ad19
riscv: mm: Use a fixed layout for the MM context ID

Currently, the size of the ASID field in the MM context ID dynamically
depends on the number of hardware-supported ASID bits. This requires
reading a global variable to extract either field from the context ID.
Instead, allocate the maximum possible number of bits to the ASID field,
so the layout of the context ID is known at compile-time.

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20240327045035.368512-11-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/mmu.h
arch/riscv/include/asm/tlbflush.h
arch/riscv/mm/context.c