From patchwork Fri May 29 08:21:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ehrhardt@linux.vnet.ibm.com X-Patchwork-Id: 26884 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4T8MgD2016048 for ; Fri, 29 May 2009 08:22:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756032AbZE2IV4 (ORCPT ); Fri, 29 May 2009 04:21:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756265AbZE2IV4 (ORCPT ); Fri, 29 May 2009 04:21:56 -0400 Received: from mtagate1.de.ibm.com ([195.212.17.161]:35113 "EHLO mtagate1.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755510AbZE2IVy (ORCPT ); Fri, 29 May 2009 04:21:54 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n4T8Lucx018475 for ; Fri, 29 May 2009 08:21:56 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4T8LteQ2687000 for ; Fri, 29 May 2009 10:21:55 +0200 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4T8LslJ018610 for ; Fri, 29 May 2009 10:21:55 +0200 Received: from localhost.localdomain (dyn-9-152-212-64.boeblingen.de.ibm.com [9.152.212.64]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4T8LstP018591; Fri, 29 May 2009 10:21:54 +0200 From: ehrhardt@linux.vnet.ibm.com To: kvm@vger.kernel.org, avi@redhat.com Cc: ehrhardt@linux.vnet.ibm.com, borntraeger@de.ibm.com, cotte@de.ibm.com, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com, mtosatti@redhat.com Subject: [PATCH 2/5] kvm-s390: fix interruption casued by signal - v2 Date: Fri, 29 May 2009 10:21:51 +0200 Message-Id: <1243585314-13734-3-git-send-email-ehrhardt@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1243585314-13734-1-git-send-email-ehrhardt@linux.vnet.ibm.com> References: <1243585314-13734-1-git-send-email-ehrhardt@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Ehrhardt *updates in v2* merged a small piece of code from patch 1/1 that belongs here themtically 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 --- [diffstat] kvm-s390.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) [diff] -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm/arch/s390/kvm/kvm-s390.c =================================================================== --- kvm.orig/arch/s390/kvm/kvm-s390.c +++ kvm/arch/s390/kvm/kvm-s390.c @@ -509,6 +509,7 @@ rerun_vcpu: vcpu->arch.sie_block->gpsw.addr = kvm_run->s390_sieic.addr; break; case KVM_EXIT_UNKNOWN: + case KVM_EXIT_INTR: case KVM_EXIT_S390_RESET: break; default: @@ -525,8 +526,10 @@ rerun_vcpu: if (rc == SIE_INTERCEPT_CHECKREQUESTS) 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 */