]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: mm: don't advertise 1 num_asid for 0 asid bits
authorVineet Gupta <vgupta@kernel.org>
Wed, 8 Sep 2021 17:30:29 +0000 (10:30 -0700)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Mon, 4 Oct 2021 21:16:58 +0000 (14:16 -0700)
commit7acd732b288b1b1de209afa5b18b515a1ab4a817
tree18de43d8f315a7cee64ada4fa2b6f9ac5d57bf6e
parentaf181ad6396fd28a17c8f3e9787e36fac4dbc142
riscv: mm: don't advertise 1 num_asid for 0 asid bits

Even if mmu doesn't support ASID, current code calculates @num_asids=1
which is misleading, so avoid setting any asid related variables in such
case.

Also while here, print the number of asid bits discovered even for the
disabled case.

Verified this on Hifive Unmatched.

Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/mm/context.c