KVM: riscv: selftests: Add helper functions for extension checks
authorAtish Patra <atishp@rivosinc.com>
Sat, 20 Apr 2024 15:17:34 +0000 (08:17 -0700)
committerAnup Patel <anup@brainfault.org>
Fri, 26 Apr 2024 07:44:00 +0000 (13:14 +0530)
commit97be675bfdb5086a6ad1aeeaa43df78b1afd5a0d
treec6472812adce5533136604279461568d11ac379d
parent9408a23fac62d31de067bd2b0099eb9151395345
KVM: riscv: selftests: Add helper functions for extension checks

__vcpu_has_ext can check both SBI and ISA extensions when the first
argument is properly converted to SBI/ISA extension IDs. Introduce
two helper functions to make life easier for developers so they
don't have to worry about the conversions.

Replace the current usages as well with new helpers.

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20240420151741.962500-19-atishp@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/riscv/processor.h
tools/testing/selftests/kvm/riscv/arch_timer.c