RISC-V: KVM: selftests: Add guest_sbi_probe_extension
authorAndrew Jones <ajones@ventanamicro.com>
Wed, 20 Dec 2023 16:00:24 +0000 (17:00 +0100)
committerAnup Patel <anup@brainfault.org>
Sat, 30 Dec 2023 05:56:43 +0000 (11:26 +0530)
commit945d880d6be0fd19bbc77d80d113bd2ca74c74f8
tree3bf303d123003aed86dfb6292f24e59748f993c1
parent0dcab5c4762ac166aa7e635ae4b6d649e15717e2
RISC-V: KVM: selftests: Add guest_sbi_probe_extension

Add guest_sbi_probe_extension(), allowing guest code to probe for
SBI extensions. As guest_sbi_probe_extension() needs
SBI_ERR_NOT_SUPPORTED, take the opportunity to bring in all SBI
error codes. We don't bring in all current extension IDs or base
extension function IDs though, even though we need one of each,
because we'd prefer to bring those in as necessary.

Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/riscv/processor.h
tools/testing/selftests/kvm/lib/riscv/processor.c