From 96aaef3a6a3ddf544a027cad10211b0d161047c7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 Nov 2014 08:58:44 -0800 Subject: [PATCH] 3.17-stable patches added patches: kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch --- ...erspace-emulation-error-to-userspace.patch | 37 +++++++++++++++++++ queue-3.17/series | 1 + 2 files changed, 38 insertions(+) create mode 100644 queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch diff --git a/queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch b/queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch new file mode 100644 index 00000000000..dfe856bdaad --- /dev/null +++ b/queue-3.17/kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch @@ -0,0 +1,37 @@ +From a2b9e6c1a35afcc0973acb72e591c714e78885ff Mon Sep 17 00:00:00 2001 +From: Nadav Amit +Date: Wed, 17 Sep 2014 02:50:50 +0300 +Subject: KVM: x86: Don't report guest userspace emulation error to userspace + +From: Nadav Amit + +commit a2b9e6c1a35afcc0973acb72e591c714e78885ff upstream. + +Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to +user-space") disabled the reporting of L2 (nested guest) emulation failures to +userspace due to race-condition between a vmexit and the instruction emulator. +The same rational applies also to userspace applications that are permitted by +the guest OS to access MMIO area or perform PIO. + +This patch extends the current behavior - of injecting a #UD instead of +reporting it to userspace - also for guest userspace code. + +Signed-off-by: Nadav Amit +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -5002,7 +5002,7 @@ static int handle_emulation_failure(stru + + ++vcpu->stat.insn_emulation_fail; + trace_kvm_emulate_insn_failed(vcpu); +- if (!is_guest_mode(vcpu)) { ++ if (!is_guest_mode(vcpu) && kvm_x86_ops->get_cpl(vcpu) == 0) { + vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; + vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; + vcpu->run->internal.ndata = 0; diff --git a/queue-3.17/series b/queue-3.17/series index 6bcc99dfe9d..d60e11a44a1 100644 --- a/queue-3.17/series +++ b/queue-3.17/series @@ -131,3 +131,4 @@ dell-wmi-fix-access-out-of-memory.patch builddeb-put-the-dbg-files-into-the-correct-directory.patch checkpatch-remove-unnecessary-after-8-8.patch mm-thp-fix-collapsing-of-hugepages-on-madvise.patch +kvm-x86-don-t-report-guest-userspace-emulation-error-to-userspace.patch -- 2.47.3