RISC-V: KVM: Implement VCPU world-switch
This patch implements the VCPU world-switch for KVM RISC-V. The KVM RISC-V world-switch (i.e. __kvm_riscv_switch_to()) mostly switches general purpose registers, SSTATUS, STVEC, SSCRATCH and HSTATUS CSRs. Other CSRs are switched via vcpu_load() and vcpu_put() interface in kvm_arch_vcpu_load() and kvm_arch_vcpu_put() functions respectively. Signed-off-by:Anup Patel <anup.patel@wdc.com> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Alexander Graf <graf@amazon.com> Acked-by:
Palmer Dabbelt <palmerdabbelt@google.com>
Showing
- arch/riscv/include/asm/kvm_host.h 9 additions, 1 deletionarch/riscv/include/asm/kvm_host.h
- arch/riscv/kernel/asm-offsets.c 78 additions, 0 deletionsarch/riscv/kernel/asm-offsets.c
- arch/riscv/kvm/Makefile 1 addition, 1 deletionarch/riscv/kvm/Makefile
- arch/riscv/kvm/vcpu.c 28 additions, 2 deletionsarch/riscv/kvm/vcpu.c
- arch/riscv/kvm/vcpu_switch.S 203 additions, 0 deletionsarch/riscv/kvm/vcpu_switch.S
Loading