arm/arm64: KVM: Complete WFI/WFE instructions
authorChristoffer Dall <christoffer.dall@linaro.org>
Tue, 26 Aug 2014 12:33:02 +0000 (14:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:10 +0000 (14:52 -0700)
commit6487706b8ab6a4b737d2b0019b4bcacdbf3db73b
treee78fe161323ccdfd12b166ff6d9a0196d1338362
parent4d9feb80bcbe13405171033ed7d7fdcee9065831
arm/arm64: KVM: Complete WFI/WFE instructions

commit 05e0127f9e362b36aa35f17b1a3d52bca9322a3a upstream.

The architecture specifies that when the processor wakes up from a WFE
or WFI instruction, the instruction is considered complete, however we
currrently return to EL1 (or EL0) at the WFI/WFE instruction itself.

While most guests may not be affected by this because their local
exception handler performs an exception returning setting the event bit
or with an interrupt pending, some guests like UEFI will get wedged due
this little mishap.

Simply skip the instruction when we have completed the emulation.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/handle_exit.c
arch/arm64/kvm/handle_exit.c