From: Greg Kroah-Hartman Date: Thu, 22 Aug 2013 21:44:35 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.0.94~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba79a8be68c1634fbe8d162e9a15ffa9d579b103;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: kvm-s390-move-kvm_guest_enter-exit-closer-to-sie.patch --- diff --git a/queue-3.10/kvm-s390-move-kvm_guest_enter-exit-closer-to-sie.patch b/queue-3.10/kvm-s390-move-kvm_guest_enter-exit-closer-to-sie.patch new file mode 100644 index 00000000000..aa78b478e75 --- /dev/null +++ b/queue-3.10/kvm-s390-move-kvm_guest_enter-exit-closer-to-sie.patch @@ -0,0 +1,65 @@ +From 2b29a9fdcb92bfc6b6f4c412d71505869de61a56 Mon Sep 17 00:00:00 2001 +From: Dominik Dingel +Date: Fri, 26 Jul 2013 15:04:00 +0200 +Subject: KVM: s390: move kvm_guest_enter,exit closer to sie + +From: Dominik Dingel + +commit 2b29a9fdcb92bfc6b6f4c412d71505869de61a56 upstream. + +Any uaccess between guest_enter and guest_exit could trigger a page fault, +the page fault handler would handle it as a guest fault and translate a +user address as guest address. + +Signed-off-by: Dominik Dingel +Signed-off-by: Christian Borntraeger +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + + +--- + arch/s390/kvm/kvm-s390.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +--- a/arch/s390/kvm/kvm-s390.c ++++ b/arch/s390/kvm/kvm-s390.c +@@ -622,14 +622,25 @@ static int __vcpu_run(struct kvm_vcpu *v + kvm_s390_deliver_pending_interrupts(vcpu); + + vcpu->arch.sie_block->icptcode = 0; +- preempt_disable(); +- kvm_guest_enter(); +- preempt_enable(); + VCPU_EVENT(vcpu, 6, "entering sie flags %x", + atomic_read(&vcpu->arch.sie_block->cpuflags)); + trace_kvm_s390_sie_enter(vcpu, + atomic_read(&vcpu->arch.sie_block->cpuflags)); ++ ++ /* ++ * As PF_VCPU will be used in fault handler, between guest_enter ++ * and guest_exit should be no uaccess. ++ */ ++ preempt_disable(); ++ kvm_guest_enter(); ++ preempt_enable(); + rc = sie64a(vcpu->arch.sie_block, vcpu->run->s.regs.gprs); ++ kvm_guest_exit(); ++ ++ VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", ++ vcpu->arch.sie_block->icptcode); ++ trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode); ++ + if (rc) { + if (kvm_is_ucontrol(vcpu->kvm)) { + rc = SIE_INTERCEPT_UCONTROL; +@@ -639,10 +650,6 @@ static int __vcpu_run(struct kvm_vcpu *v + rc = kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); + } + } +- VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", +- vcpu->arch.sie_block->icptcode); +- trace_kvm_s390_sie_exit(vcpu, vcpu->arch.sie_block->icptcode); +- kvm_guest_exit(); + + memcpy(&vcpu->run->s.regs.gprs[14], &vcpu->arch.sie_block->gg14, 16); + return rc; diff --git a/queue-3.10/series b/queue-3.10/series new file mode 100644 index 00000000000..630b59faf9c --- /dev/null +++ b/queue-3.10/series @@ -0,0 +1 @@ +kvm-s390-move-kvm_guest_enter-exit-closer-to-sie.patch