Skip to content

Commit e98b108

Browse files
committed
RISC-V: KVM: Factor-out ONE_REG related code to its own source file
The VCPU ONE_REG interface has grown over time and it will continue to grow with new ISA extensions and other features. Let us move all ONE_REG related code to its own source file so that vcpu.c only focuses only on high-level VCPU functions. Signed-off-by: Anup Patel <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent 52a93d3 commit e98b108

File tree

4 files changed

+556
-528
lines changed

4 files changed

+556
-528
lines changed

arch/riscv/include/asm/kvm_host.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ int kvm_riscv_vcpu_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
337337

338338
void __kvm_riscv_switch_to(struct kvm_vcpu_arch *vcpu_arch);
339339

340+
void kvm_riscv_vcpu_setup_isa(struct kvm_vcpu *vcpu);
341+
int kvm_riscv_vcpu_get_reg(struct kvm_vcpu *vcpu,
342+
const struct kvm_one_reg *reg);
343+
int kvm_riscv_vcpu_set_reg(struct kvm_vcpu *vcpu,
344+
const struct kvm_one_reg *reg);
345+
340346
int kvm_riscv_vcpu_set_interrupt(struct kvm_vcpu *vcpu, unsigned int irq);
341347
int kvm_riscv_vcpu_unset_interrupt(struct kvm_vcpu *vcpu, unsigned int irq);
342348
void kvm_riscv_vcpu_flush_interrupts(struct kvm_vcpu *vcpu);

arch/riscv/kvm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ kvm-y += vcpu_exit.o
1919
kvm-y += vcpu_fp.o
2020
kvm-y += vcpu_vector.o
2121
kvm-y += vcpu_insn.o
22+
kvm-y += vcpu_onereg.o
2223
kvm-y += vcpu_switch.o
2324
kvm-y += vcpu_sbi.o
2425
kvm-$(CONFIG_RISCV_SBI_V01) += vcpu_sbi_v01.o

0 commit comments

Comments
 (0)