From: Alexander Graf <agraf@suse.de>
To: qemu-devel Developers <qemu-devel@nongnu.org>
Cc: Carsten Otte <carsteno@de.ibm.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset
Date: Fri, 14 May 2010 16:14:31 +0200 [thread overview]
Message-ID: <1273846471-11152-1-git-send-email-agraf@suse.de> (raw)
For SMP to work with KVM, we need to properly emulate the SIGP Initial Reset
Command. Recent (2.6.32) kernels issue that before the SIGP Reset command that
actually wakes up the vcpu.
This patch makes -smp work on S390x.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-s390x/kvm.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index a2d7741..9bf6abb 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -344,9 +344,20 @@ static int s390_store_status(CPUState *env, uint32_t parameter)
static int s390_cpu_initial_reset(CPUState *env)
{
- /* XXX */
- fprintf(stderr, "XXX SIGP init\n");
- return -1;
+ int i;
+
+ if (kvm_vcpu_ioctl(env, KVM_S390_INITIAL_RESET, NULL) < 0) {
+ perror("cannot init reset vcpu");
+ }
+
+ /* Manually zero out all registers */
+ cpu_synchronize_state(env);
+ for (i = 0; i < 16; i++) {
+ env->regs[i] = 0;
+ }
+
+ dprintf("DONE: SIGP initial reset: %p\n", env);
+ return 0;
}
static int handle_sigp(CPUState *env, struct kvm_run *run, uint8_t ipa1)
--
1.6.0.2
next reply other threads:[~2010-05-14 14:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 14:14 Alexander Graf [this message]
2010-05-18 19:24 ` [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset Aurelien Jarno
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=1273846471-11152-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=carsteno@de.ibm.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).