diff options
author | Atish Patra <atishp@rivosinc.com> | 2023-02-04 17:15:05 -0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-02-07 20:35:39 +0530 |
commit | 026bac4574b5da5aa8715bf60584679fa269eb14 (patch) | |
tree | 17b3c21a98509d1a5525e5eaa2e97de66a31986d /arch/riscv/include/asm/kvm_vcpu_sbi.h | |
parent | 2723fb7b1e3d331fe6ce04629be6f66898a4cf3b (diff) |
RISC-V: KVM: Define a probe function for SBI extension data structures
Currently the probe function just checks if an SBI extension is
registered or not. However, the extension may not want to advertise
itself depending on some other condition.
An additional extension specific probe function will allow
extensions to decide if they want to be advertised to the caller or
not. Any extension that does not require additional dependency checks
can avoid implementing this function.
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
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 | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h index f79478a85d2d..45ba341e887a 100644 --- a/arch/riscv/include/asm/kvm_vcpu_sbi.h +++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h @@ -29,6 +29,9 @@ struct kvm_vcpu_sbi_extension { int (*handler)(struct kvm_vcpu *vcpu, struct kvm_run *run, unsigned long *out_val, struct kvm_cpu_trap *utrap, bool *exit); + + /* Extension specific probe function */ + unsigned long (*probe)(struct kvm_vcpu *vcpu); }; void kvm_riscv_vcpu_sbi_forward(struct kvm_vcpu *vcpu, struct kvm_run *run); |