]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MIPS: Make ERET handle ERL before EXL
authorJames Hogan <james.hogan@imgtec.com>
Tue, 25 Oct 2016 15:11:11 +0000 (16:11 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Oct 2016 11:43:48 +0000 (13:43 +0200)
commit7039ec9189a226e2117d70ad61dd56423834fb94
tree78b8181810740891d519aaac0e7ed99375338afd
parentbde2d7a6783579eed4b34db3a3120c8e342cb080
KVM: MIPS: Make ERET handle ERL before EXL

The ERET instruction to return from exception is used for returning from
exception level (Status.EXL) and error level (Status.ERL). If both bits
are set however we should be returning from ERL first, as ERL can
interrupt EXL, for example when an NMI is taken. KVM however checks EXL
first.

Fix the order of the checks to match the pseudocode in the instruction
set manual.

Fixes: eecc25067136 ("KVM/MIPS32: Privileged instruction/target branch emulation.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/emulate.c