Loading arch/arm/include/asm/kvm_emulate.h +0 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ unsigned long *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num); unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu); int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run); bool kvm_condition_valid(struct kvm_vcpu *vcpu); void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr); void kvm_inject_undefined(struct kvm_vcpu *vcpu); Loading arch/arm/kvm/emulate.c +0 −16 Original line number Diff line number Diff line Loading @@ -161,22 +161,6 @@ unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu) } } /** * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest * @vcpu: the vcpu pointer * @run: the kvm_run structure pointer * * Simply sets the wait_for_interrupts flag on the vcpu structure, which will * halt execution of world-switches and schedule other host processes until * there is an incoming IRQ or FIQ to the VM. */ int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) { trace_kvm_wfi(*vcpu_pc(vcpu)); kvm_vcpu_block(vcpu); return 1; } /* * A conditional instruction is allowed to trap, even though it * wouldn't be executed. So let's re-implement the hardware, in Loading arch/arm/kvm/handle_exit.c +19 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,9 @@ #include <asm/kvm_coproc.h> #include <asm/kvm_mmu.h> #include <asm/kvm_psci.h> #include <trace/events/kvm.h> #include "trace.h" #include "trace.h" Loading Loading @@ -72,6 +75,22 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run) return -EFAULT; } /** * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest * @vcpu: the vcpu pointer * @run: the kvm_run structure pointer * * Simply sets the wait_for_interrupts flag on the vcpu structure, which will * halt execution of world-switches and schedule other host processes until * there is an incoming IRQ or FIQ to the VM. */ static int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) { trace_kvm_wfi(*vcpu_pc(vcpu)); kvm_vcpu_block(vcpu); return 1; } static exit_handle_fn arm_exit_handlers[] = { [HSR_EC_WFI] = kvm_handle_wfi, [HSR_EC_CP15_32] = kvm_handle_cp15_32, Loading Loading
arch/arm/include/asm/kvm_emulate.h +0 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ unsigned long *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num); unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu); int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run); bool kvm_condition_valid(struct kvm_vcpu *vcpu); void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr); void kvm_inject_undefined(struct kvm_vcpu *vcpu); Loading
arch/arm/kvm/emulate.c +0 −16 Original line number Diff line number Diff line Loading @@ -161,22 +161,6 @@ unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu) } } /** * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest * @vcpu: the vcpu pointer * @run: the kvm_run structure pointer * * Simply sets the wait_for_interrupts flag on the vcpu structure, which will * halt execution of world-switches and schedule other host processes until * there is an incoming IRQ or FIQ to the VM. */ int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) { trace_kvm_wfi(*vcpu_pc(vcpu)); kvm_vcpu_block(vcpu); return 1; } /* * A conditional instruction is allowed to trap, even though it * wouldn't be executed. So let's re-implement the hardware, in Loading
arch/arm/kvm/handle_exit.c +19 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,9 @@ #include <asm/kvm_coproc.h> #include <asm/kvm_mmu.h> #include <asm/kvm_psci.h> #include <trace/events/kvm.h> #include "trace.h" #include "trace.h" Loading Loading @@ -72,6 +75,22 @@ static int handle_dabt_hyp(struct kvm_vcpu *vcpu, struct kvm_run *run) return -EFAULT; } /** * kvm_handle_wfi - handle a wait-for-interrupts instruction executed by a guest * @vcpu: the vcpu pointer * @run: the kvm_run structure pointer * * Simply sets the wait_for_interrupts flag on the vcpu structure, which will * halt execution of world-switches and schedule other host processes until * there is an incoming IRQ or FIQ to the VM. */ static int kvm_handle_wfi(struct kvm_vcpu *vcpu, struct kvm_run *run) { trace_kvm_wfi(*vcpu_pc(vcpu)); kvm_vcpu_block(vcpu); return 1; } static exit_handle_fn arm_exit_handlers[] = { [HSR_EC_WFI] = kvm_handle_wfi, [HSR_EC_CP15_32] = kvm_handle_cp15_32, Loading