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/4] kvm-s390: fix interruption caused by signal - v2
Date: Fri, 29 May 2009 12:58:48 +0200 [thread overview]
Message-ID: <1243594730-20625-2-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1243594730-20625-1-git-send-email-ehrhardt@linux.vnet.ibm.com>
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
*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 <ehrhardt@linux.vnet.ibm.com>
---
[diffstat]
kvm-s390.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[diff]
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 */
next prev parent reply other threads:[~2009-05-29 10:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-29 10:58 [PATCH 1/4] kvm-s390: infrastructure to kick vcpus out of guest state - v3 ehrhardt
2009-05-29 10:58 ` ehrhardt [this message]
2009-05-29 10:58 ` [PATCH 3/4] kvm-s390: update vcpu->cpu ehrhardt
2009-05-29 10:58 ` [PATCH 4/4] kvm-s390: streamline memslot handling - v6 ehrhardt
2009-05-31 8:22 ` Avi Kivity
2009-06-02 12:32 ` Marcelo Tosatti
2009-06-02 14:23 ` Christian Ehrhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1243594730-20625-2-git-send-email-ehrhardt@linux.vnet.ibm.com \
--to=ehrhardt@linux.vnet.ibm.com \
--cc=avi@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox