aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>2009-05-20 09:34:56 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:32:42 -0400
commitb1d16c495d9e6fe48e7df2e1d18cafc6555a116a (patch)
tree759aa4b488f4c0874b2561e932b04f018b514463
parent9ace903d171db7dc2fed96e44ac62b6f4c3ccb3d (diff)
KVM: s390: fix signal handling
If signal pending is true we exit without updating kvm_run, userspace currently just does nothing and jumps to kvm_run again. Since we did not set an exit_reason we might end up with a random one (whatever was the last exit). Therefore it was possible to e.g. jump to the psw position the last real interruption set. Setting the INTR exit reason ensures that no old psw data is swapped in on reentry. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/s390/kvm/kvm-s390.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 1d65f6277166..5c1c30259002 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -527,8 +527,10 @@ rerun_vcpu:
527 if (rc == SIE_INTERCEPT_RERUNVCPU) 527 if (rc == SIE_INTERCEPT_RERUNVCPU)
528 goto rerun_vcpu; 528 goto rerun_vcpu;
529 529
530 if (signal_pending(current) && !rc) 530 if (signal_pending(current) && !rc) {
531 kvm_run->exit_reason = KVM_EXIT_INTR;
531 rc = -EINTR; 532 rc = -EINTR;
533 }
532 534
533 if (rc == -ENOTSUPP) { 535 if (rc == -ENOTSUPP) {
534 /* intercept cannot be handled in-kernel, prepare kvm-run */ 536 /* intercept cannot be handled in-kernel, prepare kvm-run */