summaryrefslogtreecommitdiff
path: root/arch/riscv/kvm/vm.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-09-27 14:40:06 +0300
committerAnup Patel <anup@brainfault.org>2021-10-04 13:21:47 +0300
commit9f7013265112a92340cef5debec8d02ec8d1de06 (patch)
tree4f77126d24e2124aa992f910012f49ce260602fa /arch/riscv/kvm/vm.c
parent34bde9d8b9e6e5249db3c07cf1ebfe75c23c671c (diff)
downloadlinux-9f7013265112a92340cef5debec8d02ec8d1de06.tar.xz
RISC-V: KVM: Handle MMIO exits for VCPU
We will get stage2 page faults whenever Guest/VM access SW emulated MMIO device or unmapped Guest RAM. This patch implements MMIO read/write emulation by extracting MMIO details from the trapped load/store instruction and forwarding the MMIO read/write to user-space. The actual MMIO emulation will happen in user-space and KVM kernel module will only take care of register updates before resuming the trapped VCPU. The handling for stage2 page faults for unmapped Guest RAM will be implemeted by a separate patch later. [jiangyifei: ioeventfd and in-kernel mmio device support] Signed-off-by: Yifei Jiang <jiangyifei@huawei.com> 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>
Diffstat (limited to 'arch/riscv/kvm/vm.c')
-rw-r--r--arch/riscv/kvm/vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/riscv/kvm/vm.c b/arch/riscv/kvm/vm.c
index 22490803d904..ad38c575c0bd 100644
--- a/arch/riscv/kvm/vm.c
+++ b/arch/riscv/kvm/vm.c
@@ -62,6 +62,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
int r;
switch (ext) {
+ case KVM_CAP_IOEVENTFD:
case KVM_CAP_DEVICE_CTRL:
case KVM_CAP_USER_MEMORY:
case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: