Received: from eggs.gnu.org ([2001:4830:134:3::10]:51990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJmk-0002W5-4K for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:31:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJJmS-0004mD-V3 for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:31:14 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:56508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJJmS-0004le-L6 for qemu-devel@nongnu.org; Fri, 28 Feb 2014 04:30:56 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Feb 2014 09:30:55 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6FDF62190061 for ; Fri, 28 Feb 2014 09:30:49 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1S9Ue3v59113596 for ; Fri, 28 Feb 2014 09:30:40 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1S9UnxJ016121 for ; Fri, 28 Feb 2014 02:30:52 -0700 From: Christian Borntraeger Date: Fri, 28 Feb 2014 10:30:48 +0100 Message-Id: <1393579866-43465-5-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1393579866-43465-1-git-send-email-borntraeger@de.ibm.com> References: <1393579866-43465-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 04/22] s390x/kvm: Fixed bad SIGP SET-ARCHITECTURE handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Anthony Liguori , Peter Maydell Cc: Thomas Huth , Alexander Graf , Christian Borntraeger , Jens Freimann , Cornelia Huck , Richard Henderson 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; -- 1.8.4.2