mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH AUTOSEL for 3.18 01/16] KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure
@ 2018-01-24  4:17 Sasha Levin
  2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 03/16] KVM: X86: Fix operand/address-size during instruction decoding Sasha Levin
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Sasha Levin @ 2018-01-24  4:17 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Liran Alon, Konrad Rzeszutek Wilk, Radim Krčmář,
	Sasha Levin

From: Liran Alon <liran.alon@oracle.com>

[ Upstream commit 1f4dcb3b213235e642088709a1c54964d23365e9 ]

On this case, handle_emulation_failure() fills kvm_run with
internal-error information which it expects to be delivered
to user-mode for further processing.
However, the code reports a wrong return-value which makes KVM to never
return to user-mode on this scenario.

Fixes: 6d77dbfc88e3 ("KVM: inject #UD if instruction emulation fails and exit to
userspace")

Signed-off-by: Liran Alon <liran.alon@oracle.com>
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 0dcbe370374f..80a83113a1ce 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5109,7 +5109,7 @@ static int handle_emulation_failure(struct kvm_vcpu *vcpu)
 		vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
 		vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION;
 		vcpu->run->internal.ndata = 0;
-		r = EMULATE_FAIL;
+		r = EMULATE_USER_EXIT;
 	}
 	kvm_queue_exception(vcpu, UD_VECTOR);
 
-- 
2.11.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-01-24  4:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24  4:17 [PATCH AUTOSEL for 3.18 01/16] KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 03/16] KVM: X86: Fix operand/address-size during instruction decoding Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 02/16] KVM: x86: Don't re-execute instruction when not passing CR2 value Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 04/16] bcache: check return value of register_shrinker Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 05/16] mac80211: fix the update of path metric for RANN frame Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 06/16] KVM: VMX: Fix rflags cache during vCPU reset Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 07/16] xen-netfront: remove warning when unloading module Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 08/16] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 10/16] hwmon: (pmbus) Use 64bit math for DIRECT format values Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 09/16] nfsd: check for use of the closed special stateid Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 11/16] net: ethernet: xilinx: Mark XILINX_LL_TEMAC broken on 64-bit Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 13/16] scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 12/16] quota: Check for register_shrinker() failure Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 14/16] media: usbtv: add a new usbid Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 15/16] usb: gadget: don't dereference g until after it has been null checked Sasha Levin
2018-01-24  4:17 ` [PATCH AUTOSEL for 3.18 16/16] staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome