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
Subject: [PATCH 2/3] kvm-s390: fix signal handling
Date: Wed, 20 May 2009 15:34:56 +0200 [thread overview]
Message-ID: <1242826497-6797-3-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1242826497-6797-1-git-send-email-ehrhardt@linux.vnet.ibm.com>
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
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 | 4 +++-
1 file changed, 3 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
@@ -524,8 +524,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 */
next prev parent reply other threads:[~2009-05-20 13:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-20 13:34 [PATCH 0/3] kvm-s390: revised version of kvm-s390 guest memory handling ehrhardt
2009-05-20 13:34 ` [PATCH 1/3] kvm-s390: infrastructure to kick vcpus out of guest state ehrhardt
2009-05-20 13:34 ` ehrhardt [this message]
2009-05-20 13:34 ` [PATCH 3/3] kvm-s390: streamline memslot handling ehrhardt
2009-05-24 14:39 ` Avi Kivity
2009-05-25 8:33 ` Christian Ehrhardt
2009-05-25 11:40 ` Christian Ehrhardt
2009-05-26 7:57 ` Avi Kivity
2009-05-26 8:31 ` Christian Bornträger
2009-05-26 9:27 ` Avi Kivity
2009-05-26 10:31 ` Christian Ehrhardt
-- strict thread matches above, loose matches on Subject: below --
2009-05-25 11:40 [PATCH 0/3] kvm-s390: revised version of kvm-s390 guest memory handling - v2 ehrhardt
2009-05-25 11:40 ` [PATCH 2/3] kvm-s390: fix signal handling 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=1242826497-6797-3-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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.