aboutsummaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-05-14 16:14:31 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-05-18 21:23:24 +0200
commitd5900813807e237b9f4251290f46125a817da66d (patch)
treed40b23555723efc674563a16954cace35e54f823 /target-s390x
parent3d78499a4971132b075b067bdcd202dad50d9217 (diff)
downloadqemu-d5900813807e237b9f4251290f46125a817da66d.zip
qemu-d5900813807e237b9f4251290f46125a817da66d.tar.gz
qemu-d5900813807e237b9f4251290f46125a817da66d.tar.bz2
target-s390: enable SIGP Initial Reset
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> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/kvm.c17
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)