From patchwork Tue Mar 14 11:00:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13174058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5F2EC6FD1C for ; Tue, 14 Mar 2023 11:01:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pc2Of-0001LR-E2; Tue, 14 Mar 2023 07:00: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 1pc2OZ-0001Ka-Tt; Tue, 14 Mar 2023 07:00: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 1pc2OY-0004Kd-8v; Tue, 14 Mar 2023 07:00:43 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32EAlOKa015217; Tue, 14 Mar 2023 11:00:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=2DbQaCFh+Y39uT6oOw9JPLybqDSaG14GTS8W7R+xgVw=; b=BmmsrRTPA9AHcGpDlc5HzCtkklSWfbrjJ1S6VguiDMQTjyWnK2Qa02wMAFHSC8dVDnKm CwDhxK62+4gWboW55fUnXUnj2vpDcDGF2po+Z+deOwvnTC5rC5+T1qF9plCSGd5q9Pbh pUOYwV372P+xcFbQ1zKp/Qdnspj7ibXuf09MlaWmf4RYRdy+K4FUsLQz2KvzD2rMG+z1 UdtWyWfQAcynigkon73dO+lWFc8dEAQNaS2eIEognnTbaRS2d339MMxRaiypyJa0ux2t tca0+d3puIkPMbAsDBX9NF5rQ3ZuRYJycPQzU6nyIqpUzjNGSzzGYTvMCn0k2LSoOTh5 vQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pae0se85y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 11:00:38 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32E8GFSd025091; Tue, 14 Mar 2023 11:00:38 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pae0se84v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 11:00:38 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32E8dN9S028582; Tue, 14 Mar 2023 11:00:35 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3p8gwfkpbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Mar 2023 11:00:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32EB0XMi8061478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Mar 2023 11:00:33 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00CF82004E; Tue, 14 Mar 2023 11:00:33 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72D6C20040; Tue, 14 Mar 2023 11:00:32 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.171.57.117]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 14 Mar 2023 11:00:32 +0000 (GMT) From: Ilya Leoshkevich To: Richard Henderson , David Hildenbrand , Thomas Huth Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH 0/2] target/s390x: Implement Early Exception Recognition Date: Tue, 14 Mar 2023 12:00:20 +0100 Message-Id: <20230314110022.184717-1-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: AOj8fIqwF_h7F52f18AqyMRgBbjN2fDW X-Proofpoint-GUID: 6MCk5Oo0BfFhPFimO6N0qPd9oyXp-PV0 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-14_04,2023-03-14_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=385 priorityscore=1501 mlxscore=0 adultscore=0 clxscore=1015 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303140090 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Hi, Currently loading bad PSW flags does not lead to an exception, which is not correct. This series fixes this by implementing what PoP calls "Early Exception Recognition". Since it applies to both loading PSW with LPSW/LPSWE and to interrupt handling, s390_cpu_set_psw() looks like the right place for it to be in. Patch 1 fixes the issue, patch 2 adds a test. Best regards, Ilya Ilya Leoshkevich (2): target/s390x: Implement Early Exception Recognition tests/tcg/s390x: Add early-exception-recognition.S target/s390x/cpu.c | 26 +++++++++++++ target/s390x/cpu.h | 1 + target/s390x/tcg/excp_helper.c | 3 +- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/early-exception-recognition.S | 38 +++++++++++++++++++ 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/s390x/early-exception-recognition.S