]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: Implement VCPU world-switch
authorAnup Patel <anup.patel@wdc.com>
Mon, 27 Sep 2021 11:40:05 +0000 (17:10 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 4 Oct 2021 10:19:57 +0000 (15:49 +0530)
commitc5536e0679391ce564fc3f7361d0a49add468a7f
treeff74abdabe5103aae8533e738446e2b0df2be4c8
parent53dc2d2fb799240e96c364a53f34e357e654ae1e
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>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kernel/asm-offsets.c
arch/riscv/kvm/Makefile
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_switch.S [new file with mode: 0644]