]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: KVM: Handle WFI exits for VCPU
authorAnup Patel <anup.patel@wdc.com>
Mon, 27 Sep 2021 11:40:07 +0000 (17:10 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 4 Oct 2021 10:25:01 +0000 (15:55 +0530)
commit4c551d4c48ebb5941a2358eeb8961c93197e5d3a
treeeb389e40031e2ab24b9d4244f52d4e4a9b7268ef
parent66da6244f0cdacf3b8f8341969e7dca6fb8f8c5f
RISC-V: KVM: Handle WFI exits for VCPU

We get illegal instruction trap whenever Guest/VM executes WFI
instruction.

This patch handles WFI trap by blocking the trapped VCPU using
kvm_vcpu_block() API. The blocked VCPU will be automatically
resumed whenever a VCPU interrupt is injected from user-space
or from in-kernel IRQCHIP emulation.

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/kvm/vcpu_exit.c