From patchwork Fri May 14 14:14:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 52621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3001CB7DE9 for ; Sat, 15 May 2010 00:55:14 +1000 (EST) Received: from localhost ([127.0.0.1]:47610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCvhB-0002M8-Vr for incoming@patchwork.ozlabs.org; Fri, 14 May 2010 10:16:58 -0400 Received: from [140.186.70.92] (port=36097 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCves-0000jS-QS for qemu-devel@nongnu.org; Fri, 14 May 2010 10:14:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCver-0001Pj-CO for qemu-devel@nongnu.org; Fri, 14 May 2010 10:14:34 -0400 Received: from cantor.suse.de ([195.135.220.2]:55110 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCver-0001PX-78 for qemu-devel@nongnu.org; Fri, 14 May 2010 10:14:33 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 170D86CB00; Fri, 14 May 2010 16:14:32 +0200 (CEST) From: Alexander Graf To: qemu-devel Developers Date: Fri, 14 May 2010 16:14:31 +0200 Message-Id: <1273846471-11152-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Carsten Otte , Aurelien Jarno Subject: [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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)