From nobody Fri Dec 27 00:37:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1678985140; cv=none; d=zohomail.com; s=zohoarc; b=iT1ikXNFGLsWKX0VxjPTR0oP1sr0lA1wd3nmfKRxnyJgvDijGtWZFok1ApkTjIC7FrbStgSvHfNA+jJ9vUgQTc3QBSfE4szApXkhjGylsoJml6QN5fVPJkeGe7IiRuokSgh2/5htMJOmrpUHFOeB2ep5nQjegPwdeymD4P8qX8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678985140; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SopI3bT10nFs+G/Z6vkYrxjFbp4FlJzEA/DA7IkYGbE=; b=ceJwyxpWBA3qAWaWMhIofHL8uzN7Zty8Y62yjm/KOz3v+ytQ6ugBs2LPsMgQS/gWvslOawLZVQ5XA5rM2eS1xvYToCiWn2JK60LQwKMkl/Ci2JQmlLl7QaW9N1qc1Caoo+D2bPmOjcldz8N5GsAvHE+lSJjeSHlEkbQVtxpYHFE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1678985140779999.5462670461874; Thu, 16 Mar 2023 09:45:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcqif-0004vp-3k; Thu, 16 Mar 2023 12:44:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqic-0004td-4W; Thu, 16 Mar 2023 12:44:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pcqia-0007zH-Ht; Thu, 16 Mar 2023 12:44:45 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32GGLr5l020974; Thu, 16 Mar 2023 16:44:42 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pc5ku2qhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:42 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32GGLbGc002105; Thu, 16 Mar 2023 16:44:41 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pc5ku2qgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:41 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32G1quEq008160; Thu, 16 Mar 2023 16:44:39 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3pbsu7gsr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Mar 2023 16:44:39 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32GGiZ0U28639936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Mar 2023 16:44:35 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC57420040; Thu, 16 Mar 2023 16:44:35 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18F4420043; Thu, 16 Mar 2023 16:44:35 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.2.157]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 Mar 2023 16:44:35 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=SopI3bT10nFs+G/Z6vkYrxjFbp4FlJzEA/DA7IkYGbE=; b=rGNYvfSM5r09iMtWHtdoARhcJ9uR8/FcmFCJPyVSouMtTOw1V/4PF6sCI8607RU9fiIG D6+ZVe822r+2fFyOq8iSp7v5SG9GTZPLxhhJkr9lgRBzHG8ODUbCrlAQcT5ZhYgWpN6D IFaa6+3yrT966AE5DYAcLBZ2wZqmxQhhDdTlD0yC0iA40AQ+9SxN7fjV3M/wsgIOEazU dEaT9OcVU9W9x8J7RxTmUfPsF/0g0UGQabtqOot/tLr0xI05B1rsdgmpxhDKW3bn4zfz S2aR4PrrZ1hedCWNYq5pw5ta9URVcady09UpRV0uxsRGqN2oY9rJGqKhTxY/+4rmiThY 6A== From: Ilya Leoshkevich To: Richard Henderson , David Hildenbrand Cc: Thomas Huth , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Ilya Leoshkevich , Nina Schoetterl-Glausch Subject: [PATCH v4 02/12] target/s390x: Handle EXECUTE of odd addresses Date: Thu, 16 Mar 2023 17:44:18 +0100 Message-Id: <20230316164428.275147-3-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230316164428.275147-1-iii@linux.ibm.com> References: <20230316164428.275147-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 0FeQ7gLYaTG1Ng2aT9sicdHG9iVy-h3g X-Proofpoint-ORIG-GUID: mbqNp7kBlqoTGEhcDGhzA10Llxr1pznO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-16_10,2023-03-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxlogscore=788 suspectscore=0 phishscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303160131 Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=iii@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1678985141936100001 Content-Type: text/plain; charset="utf-8" Generate a specification exception in the helper before trying to fetch the instruction. Reported-by: Nina Schoetterl-Glausch Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg/mem_helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 6835c26dda4..9d1c4bb7374 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -2468,8 +2468,16 @@ void HELPER(stpq_parallel)(CPUS390XState *env, uint6= 4_t addr, */ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, uint64_t r1, uint64_t a= ddr) { - uint64_t insn =3D cpu_lduw_code(env, addr); - uint8_t opc =3D insn >> 8; + uint64_t insn; + uint8_t opc; + + /* EXECUTE targets must be at even addresses. */ + if (addr & 1) { + tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); + } + + insn =3D cpu_lduw_code(env, addr); + opc =3D insn >> 8; =20 /* Or in the contents of R1[56:63]. */ insn |=3D r1 & 0xff; --=20 2.39.2