summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/kvm_vcpu_sbi.h
diff options
context:
space:
mode:
authorAndrew Jones <ajones@ventanamicro.com>2023-12-20 17:00:21 +0100
committerAnup Patel <anup@brainfault.org>2023-12-30 11:26:35 +0530
commitf61ce890b1f0742f17b3a5d1f8c72574a33ffeb2 (patch)
treef17c2b49c6e15c984ed6b50effbe5a943ec4f7b6 /arch/riscv/include/asm/kvm_vcpu_sbi.h
parent5b9e41321ba919dd051c68d2a1d2c753aa61634c (diff)
RISC-V: KVM: Add support for SBI STA registers
KVM userspace needs to be able to save and restore the steal-time shared memory address. Provide the address through the get/set-one-reg interface with two ulong-sized SBI STA extension registers (lo and hi). 64-bit KVM userspace must not set the hi register to anything other than zero and is allowed to completely neglect saving/restoring it. Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Andrew Jones <ajones@ventanamicro.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.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/kvm_vcpu_sbi.h b/arch/riscv/include/asm/kvm_vcpu_sbi.h
index dd60f73b5c36..b96705258cf9 100644
--- a/arch/riscv/include/asm/kvm_vcpu_sbi.h
+++ b/arch/riscv/include/asm/kvm_vcpu_sbi.h
@@ -70,6 +70,11 @@ bool riscv_vcpu_supports_sbi_ext(struct kvm_vcpu *vcpu, int idx);
int kvm_riscv_vcpu_sbi_ecall(struct kvm_vcpu *vcpu, struct kvm_run *run);
void kvm_riscv_vcpu_sbi_init(struct kvm_vcpu *vcpu);
+int kvm_riscv_vcpu_get_reg_sbi_sta(struct kvm_vcpu *vcpu, unsigned long reg_num,
+ unsigned long *reg_val);
+int kvm_riscv_vcpu_set_reg_sbi_sta(struct kvm_vcpu *vcpu, unsigned long reg_num,
+ unsigned long reg_val);
+
#ifdef CONFIG_RISCV_SBI_V01
extern const struct kvm_vcpu_sbi_extension vcpu_sbi_ext_v01;
#endif