Received: from eggs.gnu.org ([2001:4830:134:3::10]:42517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBp2N-000181-IH for qemu-devel@nongnu.org; Fri, 07 Feb 2014 12:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBp29-0005i5-25 for qemu-devel@nongnu.org; Fri, 07 Feb 2014 12:16:23 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:46762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBp28-0005hD-OA for qemu-devel@nongnu.org; Fri, 07 Feb 2014 12:16:08 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Feb 2014 17:16:06 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id E437E17D805A for ; Fri, 7 Feb 2014 17:16:28 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s17HFqtX64225410 for ; Fri, 7 Feb 2014 17:15:52 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s17HG4g0029271 for ; Fri, 7 Feb 2014 10:16:04 -0700 From: Christian Borntraeger Date: Fri, 7 Feb 2014 18:16:13 +0100 Message-Id: <1391793385-46694-5-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1391793385-46694-1-git-send-email-borntraeger@de.ibm.com> References: <1391793385-46694-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [Patch/RFC 04/16] s390x/kvm: Fixed bad SIGP SET-ARCHITECTURE handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: Heinz Graalfs , Thomas Huth , Alexander Graf , Dominik Dingel , Christian Borntraeger , Jens Freimann , Paolo Bonzini , Richard Henderson From: Thomas Huth The SET-ARCHITECTURE handler in QEMU caused an 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; -- 1.8.4.2