From b1d16c495d9e6fe48e7df2e1d18cafc6555a116a Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Wed, 20 May 2009 15:34:56 +0200 Subject: 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 Signed-off-by: Avi Kivity --- arch/s390/kvm/kvm-s390.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/s390/kvm') diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 1d65f627716..5c1c3025900 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -527,8 +527,10 @@ rerun_vcpu: if (rc == SIE_INTERCEPT_RERUNVCPU) goto rerun_vcpu; - if (signal_pending(current) && !rc) + if (signal_pending(current) && !rc) { + kvm_run->exit_reason = KVM_EXIT_INTR; rc = -EINTR; + } if (rc == -ENOTSUPP) { /* intercept cannot be handled in-kernel, prepare kvm-run */ -- cgit v1.2.3