From nobody Sat Apr 27 15:14:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1572979580; cv=none; d=zoho.com; s=zohoarc; b=TZVkGdhCEzfFZxiOhveC+ALujhMxs4vDrnZtSZiZkUtRq/f/fAljHQwNdv028IN/pFz0hebvtjXJLw90IxUoB+HGh1yv0QTjURAUDNYKYWf/6XGJRufQCl+PM0EJbR5yzMQQz3zqQGmptCUZBW0DfmIRAAAdvGP+EJLy47OseVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572979580; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=YwSbNZozfhNGF7iRIsTYmTJhLI5I2WYwjyrO1ck4d3c=; b=cC/9mdF/921iboCMvEc+Y7PdHF8SYRn9Bg4FTArZYdfvsXjdqN3cfGF04LwaEyC6IudJHzIY/xrC8at6E2sC8KWx23d1BQZSZWj5klxaXl9yNVNZCFcEohLh0/pQj4Hm1/oVlhLnGzU98M4i4YK8mSqKCDFYcdq855XBOPt1zmY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572979580871779.8724247002139; Tue, 5 Nov 2019 10:46:20 -0800 (PST) Received: from localhost ([::1]:47418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS3qL-0004hE-Ue for importer@patchew.org; Tue, 05 Nov 2019 13:46:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59821) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS3ox-0003tT-Rd for qemu-devel@nongnu.org; Tue, 05 Nov 2019 13:44:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iS3ow-0003Ei-OW for qemu-devel@nongnu.org; Tue, 05 Nov 2019 13:44:51 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:7780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iS3ow-0003DW-BZ for qemu-devel@nongnu.org; Tue, 05 Nov 2019 13:44:50 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xA5IbPLd052194 for ; Tue, 5 Nov 2019 13:44:48 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2w3dd0tq3g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 05 Nov 2019 13:44:47 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Nov 2019 18:44:45 -0000 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 5 Nov 2019 18:44:42 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xA5Ii6FD28442960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Nov 2019 18:44:06 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 202F111C054; Tue, 5 Nov 2019 18:44:41 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A4CE11C052; Tue, 5 Nov 2019 18:44:39 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.10.78]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Nov 2019 18:44:39 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH] s390x: Properly fetch and test the short psw on diag308 subc 0/1 Date: Tue, 5 Nov 2019 13:44:34 -0500 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 19110518-0020-0000-0000-00000382D5D2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19110518-0021-0000-0000-000021D9011B Message-Id: <20191105184434.16148-1-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-05_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=802 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911050155 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: borntraeger@de.ibm.com, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We need to actually fetch the cpu mask and set it after checking for psw bit 12 instead of completely ignoring it. Signed-off-by: Janosch Frank --- target/s390x/cpu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 736a7903e2..0acba843a7 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -76,8 +76,15 @@ static bool s390_cpu_has_work(CPUState *cs) static void s390_cpu_load_normal(CPUState *s) { S390CPU *cpu =3D S390_CPU(s); - cpu->env.psw.addr =3D ldl_phys(s->as, 4) & PSW_MASK_ESA_ADDR; - cpu->env.psw.mask =3D PSW_MASK_32 | PSW_MASK_64; + uint64_t spsw =3D ldq_phys(s->as, 0); + + /* Mask out bit 12 and instruction address */ + cpu->env.psw.mask =3D spsw & 0xfff7ffff80000000UL; + cpu->env.psw.addr =3D spsw & 0x7fffffffUL; + + if (!(spsw & 0x8000000000000UL)) { + s390_program_interrupt(&cpu->env, PGM_SPECIFICATION, 0, RA_IGNORED= ); + } s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu); } #endif --=20 2.20.1