diff options
author | Andrew Jones <ajones@ventanamicro.com> | 2023-05-30 19:50:24 +0200 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-06-06 09:15:21 +0530 |
commit | 95c99104cb42bea5a0874c362f284ae4b91289dd (patch) | |
tree | 693f9833139ed6c51bb0bc124ba7f4886fc682ac /arch/riscv/include/asm/kvm_vcpu_sbi.h | |
parent | 9f9e3ebe111c7aabf18a4085648dcc58c568c1d6 (diff) |
RISC-V: KVM: Probe for SBI extension status
Rather than defaulting the status to available and allowing the user
to set availability, default to uninitialized and only allow the user
to set the status to unavailable. Then, when an extension is first
used, ensure it is available by invoking its probe function, if it
has one (an extension is assumed available if it doesn't have a probe
function). Checking the status in kvm_vcpu_sbi_find_ext() ensures
extension functions cannot be invoked when they're unavailable.
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/include/asm/kvm_vcpu_sbi.h')
-rw-r--r-- | arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h index ad1588d6064b..14ee03df252d 100644 --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h @@ -15,6 +15,7 @@ #define KVM_SBI_VERSION_MINOR 0 enum kvm_riscv_sbi_ext_status { + KVM_RISCV_SBI_EXT_UNINITIALIZED, KVM_RISCV_SBI_EXT_AVAILABLE, KVM_RISCV_SBI_EXT_UNAVAILABLE, }; |