mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
RISC-V: KVM: Implement ONE_REG interface for SBI FWFT state
The KVM user-space needs a way to save/restore the state of SBI FWFT features so implement SBI extension ONE_REG callbacks. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Link: https://lore.kernel.org/r/20250823155947.1354229-6-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -220,6 +220,18 @@ struct kvm_riscv_sbi_sta {
|
||||
unsigned long shmem_hi;
|
||||
};
|
||||
|
||||
struct kvm_riscv_sbi_fwft_feature {
|
||||
unsigned long enable;
|
||||
unsigned long flags;
|
||||
unsigned long value;
|
||||
};
|
||||
|
||||
/* SBI FWFT extension registers for KVM_GET_ONE_REG and KVM_SET_ONE_REG */
|
||||
struct kvm_riscv_sbi_fwft {
|
||||
struct kvm_riscv_sbi_fwft_feature misaligned_deleg;
|
||||
struct kvm_riscv_sbi_fwft_feature pointer_masking;
|
||||
};
|
||||
|
||||
/* Possible states for kvm_riscv_timer */
|
||||
#define KVM_RISCV_TIMER_STATE_OFF 0
|
||||
#define KVM_RISCV_TIMER_STATE_ON 1
|
||||
@@ -303,6 +315,9 @@ struct kvm_riscv_sbi_sta {
|
||||
#define KVM_REG_RISCV_SBI_STA (0x0 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_STA_REG(name) \
|
||||
(offsetof(struct kvm_riscv_sbi_sta, name) / sizeof(unsigned long))
|
||||
#define KVM_REG_RISCV_SBI_FWFT (0x1 << KVM_REG_RISCV_SUBTYPE_SHIFT)
|
||||
#define KVM_REG_RISCV_SBI_FWFT_REG(name) \
|
||||
(offsetof(struct kvm_riscv_sbi_fwft, name) / sizeof(unsigned long))
|
||||
|
||||
/* Device Control API: RISC-V AIA */
|
||||
#define KVM_DEV_RISCV_APLIC_ALIGN 0x1000
|
||||
|
||||
Reference in New Issue
Block a user