]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: Add SBI v0.1 support
authorAtish Patra <atish.patra@wdc.com>
Mon, 27 Sep 2021 11:40:14 +0000 (17:10 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 4 Oct 2021 10:41:30 +0000 (16:11 +0530)
commit694be2b5a02b04ec5308f3bcc82dc4e750174ff5
treef2505e728be6bd47af59f10d4ab6296fdcbe9704
parent2202a70903ccbd52e8c480148240586771107f5a
RISC-V: KVM: Add SBI v0.1 support

The KVM host kernel is running in HS-mode needs so we need to handle
the SBI calls coming from guest kernel running in VS-mode.

This patch adds SBI v0.1 support in KVM RISC-V. Almost all SBI v0.1
calls are implemented in KVM kernel module except GETCHAR and PUTCHART
calls which are forwarded to user space because these calls cannot be
implemented in kernel space. In future, when we implement SBI v0.2 for
Guest, we will forward SBI v0.2 experimental and vendor extension calls
to user space.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/Makefile
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_exit.c
arch/riscv/kvm/vcpu_sbi.c [new file with mode: 0644]
include/uapi/linux/kvm.h