From patchwork Tue Feb 25 10:05:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 323899 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5F2312C0078 for ; Tue, 25 Feb 2014 21:06:21 +1100 (EST) Received: from localhost ([::1]:33966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIEu2-0007sl-JX for incoming@patchwork.ozlabs.org; Tue, 25 Feb 2014 05:06:18 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIEtF-0007rJ-3t for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:05:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIEt5-0005BJ-Da for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:05:28 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:46745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIEt5-00059I-3i for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:05:19 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Feb 2014 10:05:16 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Feb 2014 10:05:14 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id F189F1B0807C for ; Tue, 25 Feb 2014 10:04:54 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1PA52bL2031968 for ; Tue, 25 Feb 2014 10:05:02 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1PA5Dqc025061 for ; Tue, 25 Feb 2014 03:05:14 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1PA5DXT025056; Tue, 25 Feb 2014 03:05:13 -0700 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 73F47122443B; Tue, 25 Feb 2014 11:05:13 +0100 (CET) From: Christian Borntraeger To: Anthony Liguori , Peter Maydell Date: Tue, 25 Feb 2014 11:05:22 +0100 Message-Id: <1393322735-31277-5-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1393322735-31277-1-git-send-email-borntraeger@de.ibm.com> References: <1393322735-31277-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14022510-4966-0000-0000-000008877A17 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.106 Cc: Thomas Huth , qemu-devel , Alexander Graf , Christian Borntraeger , Jens Freimann , Cornelia Huck , Paolo Bonzini , Richard Henderson Subject: [Qemu-devel] [PATCH 04/17] s390x/kvm: Fixed bad SIGP SET-ARCHITECTURE handler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The SET-ARCHITECTURE handler in QEMU caused a program interruption. This is wrong according to the "Principles of Operations" specification (since SIGP should never cause a program interrupt) and was likely only introduced for debugging purposes. Since we handle SET-ARCHITECTURE in the kernel already and only dropped to user space in case of bad mode parameters, we should just report INVALID PARAMETER in QEMU instead. Signed-off-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- target-s390x/kvm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 9430a35..b93fe84 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -676,8 +676,10 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) cc = kvm_s390_cpu_restart(target_cpu); break; case SIGP_SET_ARCH: - /* make the caller panic */ - return -1; + *statusreg &= 0xffffffff00000000UL; + *statusreg |= SIGP_STAT_INVALID_PARAMETER; + cc = 1; /* status stored */ + break; case SIGP_INITIAL_CPU_RESET: cc = s390_cpu_initial_reset(target_cpu); break;