From patchwork Fri Mar 31 11:30:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195799 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E49B3C761AF for ; Fri, 31 Mar 2023 11:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbjCaLcA (ORCPT ); Fri, 31 Mar 2023 07:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbjCaLb5 (ORCPT ); Fri, 31 Mar 2023 07:31:57 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10571D847 for ; Fri, 31 Mar 2023 04:31:22 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32V9tLsn014574; Fri, 31 Mar 2023 11:30:49 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 : content-transfer-encoding : mime-version; s=pp1; bh=jE3XAsRL4apKqIgk4wKSWm8Bj8iNCgxeTkbraJKcpeU=; b=C4QSibggde5u6olWf4HaVcrv4hl2ZOROGV0P5J7e4pN5JPhLlaBk8HXufIMfaB/HHfgO sKGvSmjh3GNW+EdzGeesR7MeGHYS2KgwwD/lTWcFNyyQidv2BP/RcfEKGCldM9HIN5XF I/Ui7rvXBoRDXktLAiuHPZ+UJ99g45kalQaMDtSdckMwVRXpTLSiCP89SJhL108OQmso gpGOO4HoPVEnVpn5Hh5ZVJcQ7t4X1G1QEhcxBAuFkgcTE2J8Y8uCJquqyCgfpnO63jLW Ye8C3yfqMxO3PFxZUfej8HxfkN1Uhl4oWDid6R9S6dy0nkBiAImay1METu1udBTE/8Zv Xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahte77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:48 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32V9tQJf014747; Fri, 31 Mar 2023 11:30:48 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahte6k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:48 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32VB087Y000367; Fri, 31 Mar 2023 11:30:46 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3phrk6nf8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:46 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUhbf17957544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:43 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F2F952004F; Fri, 31 Mar 2023 11:30:42 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 057C02004D; Fri, 31 Mar 2023 11:30:42 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:41 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer Subject: [kvm-unit-tests GIT PULL 01/14] .gitignore: ignore `s390x/comm.key` file Date: Fri, 31 Mar 2023 13:30:15 +0200 Message-Id: <20230331113028.621828-2-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: aw6LjmBIhEwSupZ-4Tt5xBAYwMxrvSpr X-Proofpoint-GUID: bLTRCY2r-3k4f71ELXxGS5kTUWzf5yF1 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Ignore the Secure Execution Customer Communication Key file. Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr Link: https://lore.kernel.org/r/20230307091051.13945-2-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 33529b6..601822d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ cscope.* /s390x/*.bin /s390x/snippets/*/*.gbin /efi-tests/* +/s390x/comm.key /s390x/snippets/*/*.hdr /s390x/snippets/*/*.*obj From patchwork Fri Mar 31 11:30:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195798 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F03A8C77B6C for ; Fri, 31 Mar 2023 11:32:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjCaLcC (ORCPT ); Fri, 31 Mar 2023 07:32:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230492AbjCaLb6 (ORCPT ); Fri, 31 Mar 2023 07:31:58 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 525301EA36 for ; Fri, 31 Mar 2023 04:31:23 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32V9tP1V014715; Fri, 31 Mar 2023 11:30:51 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 : content-transfer-encoding : mime-version; s=pp1; bh=aanmbrJYv3OIXlGSQQoRHZ9MgLHCYPpj4c0GGSrYoeA=; b=N2DLi4EOtuqYxRGvHQIWeRl9J6On0HiHcYqoMN/mDSWtG92EzVpckQa0DndwwXG1FTSX i2BivBpqOGEQik6Os39lJG5FQVFPxudGtNytm9KRUnARQzcnLcp8JgeFzQKRxw7rp36/ lz1bFEJjQVXlg2gAwNgk6t6RlfNGsX6nuV6UuRDjVolYjtagBmYfl2b5AXdm9UAwn1kO upur5ojmx7rKLfbuTvXwaeZR/Cv+WPOTiM8yI99KWFvd9z8DS6hoLeCPuYZu8547w+Qv wIlK8QG5+WaJYVnIQ6Lp4rOyzWYv/4oVNwSftBgVo7Wt39hIkksqJkCJ1ECuPTOs2J1b Yw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahte85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:51 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBJNgX012151; Fri, 31 Mar 2023 11:30:50 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahte7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:50 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UMQnrg009344; Fri, 31 Mar 2023 11:30:49 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6ppgq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:48 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUjIj7733956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:45 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1745F20040; Fri, 31 Mar 2023 11:30:45 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 180EE2005A; Fri, 31 Mar 2023 11:30:43 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:43 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer Subject: [kvm-unit-tests GIT PULL 02/14] s390x/Makefile: simplify `%.hdr` target rules Date: Fri, 31 Mar 2023 13:30:16 +0200 Message-Id: <20230331113028.621828-3-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: MQGUuxoh8DrDr0PEFA1uO83LPhaqmC9- X-Proofpoint-GUID: DtzJY8Ig6GL6yW66CVqTRDA4zHrVLQgf X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Merge the two Makefile target rules `$(SNIPPET_DIR)/asm/%.hdr` and `$(SNIPPET_DIR)/c/%.hdr` into one target rule. Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230307091051.13945-3-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 97a6161..660ff06 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -145,10 +145,7 @@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) $(OBJCOPY) -O binary -j ".rodata" -j ".lowcore" -j ".text" -j ".data" -j ".bss" --set-section-flags .bss=alloc,load,contents $@ $@ truncate -s '%4096' $@ -$(SNIPPET_DIR)/asm/%.hdr: $(SNIPPET_DIR)/asm/%.gbin $(HOST_KEY_DOCUMENT) - $(GEN_SE_HEADER) -k $(HOST_KEY_DOCUMENT) -c $<,0x0,0x00000000000000420000000000000000 --psw-addr 0x4000 -o $@ - -$(SNIPPET_DIR)/c/%.hdr: $(SNIPPET_DIR)/c/%.gbin $(HOST_KEY_DOCUMENT) +%.hdr: %.gbin $(HOST_KEY_DOCUMENT) $(GEN_SE_HEADER) -k $(HOST_KEY_DOCUMENT) -c $<,0x0,0x00000000000000420000000000000000 --psw-addr 0x4000 -o $@ .SECONDARY: From patchwork Fri Mar 31 11:30:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195800 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ABC7C76196 for ; Fri, 31 Mar 2023 11:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231697AbjCaLcD (ORCPT ); Fri, 31 Mar 2023 07:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjCaLb6 (ORCPT ); Fri, 31 Mar 2023 07:31:58 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84EE1EA3C for ; Fri, 31 Mar 2023 04:31:23 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VA2qDg013266; Fri, 31 Mar 2023 11:30:52 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 : content-transfer-encoding : mime-version; s=pp1; bh=TjfFo4xmo0DzslTSyxbkiwnNOCoceQDllmcY9S6/NuA=; b=USbf4eiCHysm2594ncwuf3VcpB3KS4mSSd9fFkw1p8+c2ZJW5ULCoWXRHy+M7jbyFY26 pf7vxl9SWaVjSw2+ATX1+Cb9rNd7Jwi/exPcQsORHm2ZJZ/e7r9VNVkXHjLbkwMF9418 p4fZs/m81suVNMSKzYlpDfV1WYhpLXI6YJau+Wt8XTKXjcqHpTe/dmmydu2G+GXS0kCT EFdtRCH9giOdmX1vOgIUAPf04rnKKhqCDO5hNIje05YUc8y9n5xUxWU40Dsx/OLngrMX dzcQX0bzivDwLm2PIgAuRDTHgCjhiFMUwg6dfbAg0V0c10/uDthChdUmyDKMK+wWzSPz Zw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnu3nws6p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:52 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VB4QCf019680; Fri, 31 Mar 2023 11:30:51 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnu3nws67-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:51 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32V0q6kr007596; Fri, 31 Mar 2023 11:30:49 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6ppgs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:49 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUkoK45154574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:46 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3554320040; Fri, 31 Mar 2023 11:30:46 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31A782004B; Fri, 31 Mar 2023 11:30:45 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:45 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer Subject: [kvm-unit-tests GIT PULL 03/14] s390x/Makefile: fix `*.gbin` target dependencies Date: Fri, 31 Mar 2023 13:30:17 +0200 Message-Id: <20230331113028.621828-4-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Xp4kRZT_RSVjCTdF2rEx5q5Tyr19JRgT X-Proofpoint-GUID: t4LFZtLQSyb9hAz1RSWX2zrJUh8yUyOP X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 phishscore=0 suspectscore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer If the linker scripts change, then the .gbin binaries must be rebuilt. While at it, replace `$(SRCDIR)/s390x/snippets` with `$(SNIPPET_DIR)` for these Makefile rules. Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230307091051.13945-4-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 660ff06..71e6563 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -135,13 +135,13 @@ $(SNIPPET_DIR)/asm/%.o: $(SNIPPET_DIR)/asm/%.S $(asm-offsets) $(SNIPPET_DIR)/c/%.o: $(SNIPPET_DIR)/c/%.c $(asm-offsets) $(CC) $(CFLAGS) -c -nostdlib -o $@ $< -$(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o - $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/snippets/asm/flat.lds $< +$(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(SNIPPET_DIR)/asm/flat.lds + $(CC) $(LDFLAGS) -o $@ -T $(SNIPPET_DIR)/asm/flat.lds $< $(OBJCOPY) -O binary -j ".rodata" -j ".lowcore" -j ".text" -j ".data" -j ".bss" --set-section-flags .bss=alloc,load,contents $@ $@ truncate -s '%4096' $@ -$(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) - $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/snippets/c/flat.lds $< $(snippet_lib) $(FLATLIBS) +$(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) $(SNIPPET_DIR)/c/flat.lds + $(CC) $(LDFLAGS) -o $@ -T $(SNIPPET_DIR)/c/flat.lds $< $(snippet_lib) $(FLATLIBS) $(OBJCOPY) -O binary -j ".rodata" -j ".lowcore" -j ".text" -j ".data" -j ".bss" --set-section-flags .bss=alloc,load,contents $@ $@ truncate -s '%4096' $@ From patchwork Fri Mar 31 11:30:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195806 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9379C6FD18 for ; Fri, 31 Mar 2023 11:32:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231186AbjCaLcK (ORCPT ); Fri, 31 Mar 2023 07:32:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbjCaLcI (ORCPT ); Fri, 31 Mar 2023 07:32:08 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B16951EA06 for ; Fri, 31 Mar 2023 04:31:35 -0700 (PDT) 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 32V9EGlu021038; Fri, 31 Mar 2023 11:30:53 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 : content-transfer-encoding : mime-version; s=pp1; bh=l5l4q23RGMnutNa/7XCsxjMtV7gtI0yTPTrgJQkADdc=; b=KlW+oxKnFJZN1A5+iqQCbYYQgBXo6dSEVQZIkRfxUkmhDUCaUhMcL0x5N9BGgZCg685v EFduwRc3XqAVnZiGCvJmTA/vyfSjjBXWIzQ3HnSCkuEjGhZArbDteC6xFnyW8N3OuyxF bvbtSo6BiKNfrt1fJ9vB1LD0qWwU6DKPdMvkB4Fx6eu7o1jipN9AeJSumFA0CPyC4xoR kxSfsn/cXXfH6ce0jiq/1FfXivdSMHjgzBG0RkBQL+y4pdK5EmULkKAfHo/lCrTc+z9h qNwgpv490a5OanX86bjzTAD1JKCfYvdGlvg3m07bRxZv0PyOgg3qxpSNtbms+/Cwgoam Iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvq9k8px-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:53 +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 32VBOeJl009206; Fri, 31 Mar 2023 11:30:53 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvq9k8p5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:53 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UMQnrh009344; Fri, 31 Mar 2023 11:30:51 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6ppgt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:50 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUlnI13959804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:47 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E8AB20040; Fri, 31 Mar 2023 11:30:47 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C46F2004D; Fri, 31 Mar 2023 11:30:46 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:46 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer Subject: [kvm-unit-tests GIT PULL 04/14] s390x/Makefile: refactor CPPFLAGS Date: Fri, 31 Mar 2023 13:30:18 +0200 Message-Id: <20230331113028.621828-5-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 46qhvvx8tPAoq4M6-mnMoNMbKKaVet8Y X-Proofpoint-ORIG-GUID: _1FOd_7S8MW42GbkyUF8R2e-ZquL5mGO X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer This change makes it easier to reuse them. While at it, add a comment why the `lib` include path is required. Signed-off-by: Marc Hartmayer Link: https://lore.kernel.org/r/20230331082709.35955-1-mhartmay@linux.ibm.com [ nrb: remove trailing space after INCLUDE_PATHS ] Signed-off-by: Nico Boehr Reviewed-by: Nico Boehr Tested-by: Nico Boehr --- s390x/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/s390x/Makefile b/s390x/Makefile index 71e6563..50171f3 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -63,9 +63,14 @@ test_cases: $(tests) test_cases_binary: $(tests_binary) test_cases_pv: $(tests_pv_binary) +INCLUDE_PATHS = $(SRCDIR)/lib $(SRCDIR)/lib/s390x +# Include generated header files (e.g. in case of out-of-source builds) +INCLUDE_PATHS += lib +CPPFLAGS = $(addprefix -I,$(INCLUDE_PATHS)) + CFLAGS += -std=gnu99 CFLAGS += -ffreestanding -CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/s390x -I lib +CFLAGS += $(CPPFLAGS) CFLAGS += -O2 CFLAGS += -march=zEC12 CFLAGS += -mbackchain From patchwork Fri Mar 31 11:30:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195805 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B214FC76196 for ; Fri, 31 Mar 2023 11:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231723AbjCaLcJ (ORCPT ); Fri, 31 Mar 2023 07:32:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjCaLcH (ORCPT ); Fri, 31 Mar 2023 07:32:07 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 038461DF97 for ; Fri, 31 Mar 2023 04:31:32 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VAv49a021997; Fri, 31 Mar 2023 11:30:55 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 : content-transfer-encoding : mime-version; s=pp1; bh=CirDOu72pqhfGVinfulpnXVBLKQVBeyS7mRU+bp/Ado=; b=RvJWyI/U03Xax+c0eVvhAXsORqbvMcSqUYuEzFC8e+/ZSUBYZV/rNt6tqH2PlomrT5Iv +DLlFz+W0pC3WTbZhYpQvcp6bTKIW7w4XX3QwmPfdg3zWTO+k3NEgoRzy696NV5qFuYN qr+EADp6r1pOo7+LSqMdtr0YJKH1lIT8yp88E+C+0adGR9gjWNL/wsm0YleX+HD0q+Vl wIDF31GywkClBSfESAnFVurrVg8x1g76q4OFQT8hpsjLtlvAHpNHPXi17t0bikEQ+Y8Y RgW8oMp+7jFLwpQUR2XKmWKalDSo92ETjDqL84AnMUlXp5ZZ37lwioYgDko+TCUodHN/ Iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnr111aqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:55 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VAvKT2022482; Fri, 31 Mar 2023 11:30:54 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnr111aqj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:54 +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 32UKqGBu025657; Fri, 31 Mar 2023 11:30:53 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3phr7fwfuf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:52 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUnih58327296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:49 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 048212004B; Fri, 31 Mar 2023 11:30:49 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A304720040; Fri, 31 Mar 2023 11:30:47 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:47 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer , Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 05/14] s390x: use preprocessor for linker script generation Date: Fri, 31 Mar 2023 13:30:19 +0200 Message-Id: <20230331113028.621828-6-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _A1PwaX2Av4HjR21qa-u1HtmbjXViQFV X-Proofpoint-ORIG-GUID: YWJ68TRF2nzKcL1HhNTdcvKyCx0oDlLH X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=939 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer The old `.lds` scripts are being renamed to `.lds.S` and the actual `.lds` scripts are being generated by the assembler preprocessor. This change allows us to use constants defined by macros in the `.lds.S` files. Signed-off-by: Marc Hartmayer Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20230307091051.13945-6-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/Makefile | 7 +++++-- s390x/{flat.lds => flat.lds.S} | 0 s390x/snippets/asm/{flat.lds => flat.lds.S} | 0 s390x/snippets/c/{flat.lds => flat.lds.S} | 0 .gitignore | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) rename s390x/{flat.lds => flat.lds.S} (100%) rename s390x/snippets/asm/{flat.lds => flat.lds.S} (100%) rename s390x/snippets/c/{flat.lds => flat.lds.S} (100%) diff --git a/s390x/Makefile b/s390x/Makefile index 50171f3..6732b48 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -78,7 +78,7 @@ CFLAGS += -fno-delete-null-pointer-checks LDFLAGS += -nostdlib -Wl,--build-id=none # We want to keep intermediate files -.PRECIOUS: %.o +.PRECIOUS: %.o %.lds asm-offsets = lib/$(ARCH)/asm-offsets.h include $(SRCDIR)/scripts/asm-offsets.mak @@ -161,6 +161,9 @@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) $(SNIPP %.hdr.obj: %.hdr $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $< $@ +lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@ +%.lds: %.lds.S + $(CPP) $(lds-autodepend-flags) $(CPPFLAGS) -P -C -o $@ $< .SECONDEXPANSION: %.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o @@ -213,7 +216,7 @@ $(snippet_asmlib): $$(patsubst %.o,%.S,$$@) $(asm-offsets) arch_clean: asm_offsets_clean - $(RM) $(TEST_DIR)/*.{o,elf,bin} $(SNIPPET_DIR)/*/*.{o,elf,*bin,*obj,hdr} $(SNIPPET_DIR)/asm/.*.d $(TEST_DIR)/.*.d lib/s390x/.*.d $(comm-key) + $(RM) $(TEST_DIR)/*.{o,elf,bin,lds} $(SNIPPET_DIR)/*/*.{o,elf,*bin,*obj,hdr,lds} $(SNIPPET_DIR)/asm/.*.d $(TEST_DIR)/.*.d lib/s390x/.*.d $(comm-key) generated-files = $(asm-offsets) $(tests:.elf=.o) $(asmlib) $(cflatobjs): $(generated-files) diff --git a/s390x/flat.lds b/s390x/flat.lds.S similarity index 100% rename from s390x/flat.lds rename to s390x/flat.lds.S diff --git a/s390x/snippets/asm/flat.lds b/s390x/snippets/asm/flat.lds.S similarity index 100% rename from s390x/snippets/asm/flat.lds rename to s390x/snippets/asm/flat.lds.S diff --git a/s390x/snippets/c/flat.lds b/s390x/snippets/c/flat.lds.S similarity index 100% rename from s390x/snippets/c/flat.lds rename to s390x/snippets/c/flat.lds.S diff --git a/.gitignore b/.gitignore index 601822d..29f352c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ cscope.* /s390x/comm.key /s390x/snippets/*/*.hdr /s390x/snippets/*/*.*obj +/s390x/**/*.lds From patchwork Fri Mar 31 11:30:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195807 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22DA1C6FD18 for ; Fri, 31 Mar 2023 11:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231806AbjCaLcM (ORCPT ); Fri, 31 Mar 2023 07:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231753AbjCaLcJ (ORCPT ); Fri, 31 Mar 2023 07:32:09 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04251E736 for ; Fri, 31 Mar 2023 04:31:35 -0700 (PDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VAC523010463; Fri, 31 Mar 2023 11:30:56 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 : content-transfer-encoding : mime-version; s=pp1; bh=YeidoZ6UYcu5yanv23XQkMVHFykVjJlMLJoGb5DTzy4=; b=Bs1tfx/18J2h92DyMu3dd/LmuDCSaTMstsOF92cEbSFGY9Rjm8TA91l4dibuElY+Gic5 kopI22lHOYeL/2ZbUf6Qe1i80BSrOSYff/zgpCiX0Gn1SiqtGmoS/tUoAyYZ47TW1I6B SOO9z0yCAa3aGvFd2XU2wp6Jcf86JFKa6lOirEAbpyZGt/Ws4N+0Q6ETYS64yjmps65G 7uf7jWB4PrmZX1j2Xi5dO/ov8wMZxqwJrrEgcY4Tl0VpCF4QB+ncV5LuMEKm81IBr/9t ITf15z7inQjrWFAadz528wzaOhzESPMXrDadN0JnNjtLyZ9edc/EAsKVNxfPSBdyEv0/ AA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwj61wdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:56 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBHSCo017343; Fri, 31 Mar 2023 11:30:56 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwj61wcu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:55 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32ULi5l5005448; Fri, 31 Mar 2023 11:30:53 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6pqpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:53 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUokb22020718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:50 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 184562004B; Fri, 31 Mar 2023 11:30:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F30220040; Fri, 31 Mar 2023 11:30:49 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:49 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer , Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 06/14] s390x: define a macro for the stack frame size Date: Fri, 31 Mar 2023 13:30:20 +0200 Message-Id: <20230331113028.621828-7-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: H7stvmq47uzxiSFt1SErMwmLNcJ8Ljv_ X-Proofpoint-ORIG-GUID: 1zE6EcJEzVveEPDvN3UChxq2m6T7qe3b X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 malwarescore=0 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer Define and use a macro for the stack frame size. While at it, fix whitespace in the `gs_handler_asm` block. Signed-off-by: Marc Hartmayer Co-developed-by: Nina Schoetterl-Glausch Reviewed-by: Nina Schoetterl-Glausch Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20230307091051.13945-7-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/Makefile | 2 +- lib/s390x/asm-offsets.c | 1 + s390x/cstart64.S | 2 +- s390x/flat.lds.S | 4 +++- s390x/macros.S | 4 ++-- s390x/snippets/c/flat.lds.S | 6 ++++-- s390x/gs.c | 38 +++++++++++++++++++++---------------- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 6732b48..ab146eb 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -162,7 +162,7 @@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) $(SNIPP $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $< $@ lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@ -%.lds: %.lds.S +%.lds: %.lds.S $(asm-offsets) $(CPP) $(lds-autodepend-flags) $(CPPFLAGS) -P -C -o $@ $< .SECONDEXPANSION: diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c index f612f32..188dd2e 100644 --- a/lib/s390x/asm-offsets.c +++ b/lib/s390x/asm-offsets.c @@ -87,6 +87,7 @@ int main(void) OFFSET(STACK_FRAME_INT_GRS0, stack_frame_int, grs0); OFFSET(STACK_FRAME_INT_GRS1, stack_frame_int, grs1); DEFINE(STACK_FRAME_INT_SIZE, sizeof(struct stack_frame_int)); + DEFINE(STACK_FRAME_SIZE, sizeof(struct stack_frame)); return 0; } diff --git a/s390x/cstart64.S b/s390x/cstart64.S index 6f83da2..468ace3 100644 --- a/s390x/cstart64.S +++ b/s390x/cstart64.S @@ -38,7 +38,7 @@ start: /* setup stack */ larl %r15, stackptr /* Clear first stack frame */ - xc 0(160,%r15), 0(%r15) + xc 0(STACK_FRAME_SIZE,%r15), 0(%r15) /* setup initial PSW mask + control registers*/ larl %r1, initial_psw lpswe 0(%r1) diff --git a/s390x/flat.lds.S b/s390x/flat.lds.S index 952f6cd..0cb7e38 100644 --- a/s390x/flat.lds.S +++ b/s390x/flat.lds.S @@ -1,3 +1,5 @@ +#include + SECTIONS { .lowcore : { @@ -44,6 +46,6 @@ SECTIONS /* * stackptr set with initial stack frame preallocated */ - stackptr = . - 160; + stackptr = . - STACK_FRAME_SIZE; stacktop = .; } diff --git a/s390x/macros.S b/s390x/macros.S index 13cff29..e2a56a3 100644 --- a/s390x/macros.S +++ b/s390x/macros.S @@ -21,14 +21,14 @@ /* Save the stack address in GR2 which is the first function argument */ lgr %r2, %r15 /* Allocate stack space for called C function, as specified in s390 ELF ABI */ - slgfi %r15, 160 + slgfi %r15, STACK_FRAME_SIZE /* * Save the address of the interrupt stack into the back chain * of the called function. */ stg %r2, STACK_FRAME_INT_BACKCHAIN(%r15) brasl %r14, \c_func - algfi %r15, 160 + algfi %r15, STACK_FRAME_SIZE RESTORE_REGS_STACK lpswe \old_psw .endm diff --git a/s390x/snippets/c/flat.lds.S b/s390x/snippets/c/flat.lds.S index 9e5eb66..468b5f1 100644 --- a/s390x/snippets/c/flat.lds.S +++ b/s390x/snippets/c/flat.lds.S @@ -1,3 +1,5 @@ +#include + SECTIONS { .lowcore : { @@ -18,9 +20,9 @@ SECTIONS . = 0x4000; /* * The stack grows down from 0x4000 to 0x2000, we pre-allocoate - * a frame via the -160. + * a frame via the -STACK_FRAME_SIZE. */ - stackptr = . - 160; + stackptr = . - STACK_FRAME_SIZE; stacktop = .; /* Start text 0x4000 */ .text : { diff --git a/s390x/gs.c b/s390x/gs.c index 4993eb8..9ae893e 100644 --- a/s390x/gs.c +++ b/s390x/gs.c @@ -9,6 +9,7 @@ * Janosch Frank */ #include +#include #include #include #include @@ -35,22 +36,27 @@ static inline unsigned long load_guarded(unsigned long *p) /* guarded-storage event handler and finally it calls gs_handler */ extern void gs_handler_asm(void); - asm(".globl gs_handler_asm\n" - "gs_handler_asm:\n" - " lgr %r14,%r15\n" /* Save current stack address in r14 */ - " aghi %r15,-320\n" /* Allocate stack frame */ - " stmg %r0,%r13,192(%r15)\n" /* Store regs to save area */ - " stg %r14,312(%r15)\n" - " la %r2,160(%r15)\n" /* Store gscb address in this_cb */ - " .insn rxy,0xe30000000049,0,160(%r15)\n" /* stgsc */ - " lg %r14,24(%r2)\n" /* Get GSEPLA from GSCB*/ - " lg %r14,40(%r14)\n" /* Get GSERA from GSEPL*/ - " stg %r14,304(%r15)\n" /* Store GSERA in r14 of reg save area */ - " brasl %r14,gs_handler\n" /* Jump to gs_handler */ - " lmg %r0,%r15,192(%r15)\n" /* Restore regs */ - " aghi %r14, 6\n" /* Add lgg instr len to GSERA */ - " br %r14\n" /* Jump to next instruction after lgg */ - " .size gs_handler_asm,.-gs_handler_asm\n"); + asm ( ".macro STGSC args:vararg\n" + " .insn rxy,0xe30000000049,\\args\n" + " .endm\n" + " .globl gs_handler_asm\n" + "gs_handler_asm:\n" + " lgr %r14,%r15\n" /* Save current stack address in r14 */ + ".Lgs_handler_frame = 16*8+32+" xstr(STACK_FRAME_SIZE) "\n" + " aghi %r15,-(.Lgs_handler_frame)\n" /* Allocate stack frame */ + " stmg %r0,%r13,192(%r15)\n" /* Store regs to save area */ + " stg %r14,312(%r15)\n" + " la %r2," xstr(STACK_FRAME_SIZE) "(%r15)\n" /* Store gscb address in this_cb */ + " STGSC %r0," xstr(STACK_FRAME_SIZE) "(%r15)\n" + " lg %r14,24(%r2)\n" /* Get GSEPLA from GSCB*/ + " lg %r14,40(%r14)\n" /* Get GSERA from GSEPL*/ + " stg %r14,304(%r15)\n" /* Store GSERA in r14 of reg save area */ + " brasl %r14,gs_handler\n" /* Jump to gs_handler */ + " lmg %r0,%r15,192(%r15)\n" /* Restore regs */ + " aghi %r14, 6\n" /* Add lgg instr len to GSERA */ + " br %r14\n" /* Jump to next instruction after lgg */ + ".size gs_handler_asm,.-gs_handler_asm\n" + ); void gs_handler(struct gs_cb *this_cb) { From patchwork Fri Mar 31 11:30:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195801 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D33CC6FD18 for ; Fri, 31 Mar 2023 11:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbjCaLcE (ORCPT ); Fri, 31 Mar 2023 07:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbjCaLb6 (ORCPT ); Fri, 31 Mar 2023 07:31:58 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556CB1DF87 for ; Fri, 31 Mar 2023 04:31:26 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VBTk8H017642; Fri, 31 Mar 2023 11:30:59 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 : content-transfer-encoding : mime-version; s=pp1; bh=eooVMNY12d4PIRdlfRREXKlBB/c6LetaDTS5O1I3m78=; b=XxTtwJnSraDmpaHkUIH0OJ+NYy9u/OGMfzuq2kyaPGlmlDZKpgc7xyLnWKc5YtN824BQ RmCpULi3kevG32emA2ZeKpe2ICBfVqi7/1XOS1v+EDmoPQqroP1QqfCkgaLKXrQTbMcY s98t2BXXD8VB9F8KbPidDuUWSjxzfCoz2k6Fu7jDMaXcOdyzeUYTfWp2c11Q/h+mxGNY 7nS3TBUH8u0OmrM0QwbaPsVXL3G8FFy8LiXUNdILmoBKoGUbU0EerOrnOyOYIoAbknCG YyZRcChBMROvaJS2X8Id+YmKd/2ZbERoeZFDHgc+B8tJaIfYwLjfhCbEZQdidbaX/d/W dg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnxpt816f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:58 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBUnua022788; Fri, 31 Mar 2023 11:30:58 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnxpt815k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:58 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UMQnrj009344; Fri, 31 Mar 2023 11:30:56 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6ppgx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:56 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUqJN47841958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:52 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B6AB2004E; Fri, 31 Mar 2023 11:30:51 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 317CE20040; Fri, 31 Mar 2023 11:30:50 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:50 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Marc Hartmayer Subject: [kvm-unit-tests GIT PULL 07/14] lib/linux/const.h: test for `__ASSEMBLER__` as well Date: Fri, 31 Mar 2023 13:30:21 +0200 Message-Id: <20230331113028.621828-8-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 6a2z8evvL_fVCQ2-eRB_cNem99D94nIv X-Proofpoint-ORIG-GUID: cb6BekrdxZIeRrtTGtGD38OBYGu7zEKC X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 phishscore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Marc Hartmayer On s390x we're using the preprocessor for generating our linker scripts out of assembly files. The macro `__ASSEMBLER__` is defined with value 1 when preprocessing assembly language using gcc. [1] Therefore, let's check for the macro `__ASSEMBLER__` in `lib/linux/const.h` as well. Thus we can use macros that makes use of the `_AC` or `_AT` macro in the "linker scripts". [1] https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20230307091051.13945-8-mhartmay@linux.ibm.com Signed-off-by: Nico Boehr --- lib/linux/const.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linux/const.h b/lib/linux/const.h index c872bfd..be114dc 100644 --- a/lib/linux/const.h +++ b/lib/linux/const.h @@ -12,7 +12,7 @@ * leave it unchanged in asm. */ -#ifdef __ASSEMBLY__ +#if defined(__ASSEMBLY__) || defined(__ASSEMBLER__) #define _AC(X,Y) X #define _AT(T,X) X #else From patchwork Fri Mar 31 11:30:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195802 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B654C77B62 for ; Fri, 31 Mar 2023 11:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231681AbjCaLcF (ORCPT ); Fri, 31 Mar 2023 07:32:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbjCaLcB (ORCPT ); Fri, 31 Mar 2023 07:32:01 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AE6A1EFD7 for ; Fri, 31 Mar 2023 04:31:27 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VADT5R013192; Fri, 31 Mar 2023 11:30:59 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 : content-transfer-encoding : mime-version; s=pp1; bh=xFE5QZFk6ul6HVx9P7Kafn+pt20xSCSZ1axo1spcuF8=; b=g85nVgF/7H5WLvaaN6ysNhGzWKnLRg7lMXu2rLVX/8qJ5omCtYVGsruwELCrEBU+rUF0 C6owacw9ukiqAxm7v4Lrn3yJ0duT3NJMgjH/SKMVQTzXF4F64wd0ORi+IuqmMRDoEd6G hG/tkW/MdWKkkt1eGM+y2zTL3QXkHObXq7WfQ+kVVrUsbIkXmts2PWF+7EQ9+VJdeGnN QvRI9H/jtT1/Qe8pkrhdKjYctZgpvRw2yHD8/Z//7Lmb6Wq56NRsVnVbt16Zd97+tBVh LQWlc30GLWGMH0eZhmr2ASb5ntDzfP+r61owvfbSnjsCLbVBHfGvdX2PeRdsQf4RV+YW mg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnu3nws9w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:59 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBU41Q028007; Fri, 31 Mar 2023 11:30:58 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnu3nws8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:58 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UNUper013396; Fri, 31 Mar 2023 11:30:56 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma02fra.de.ibm.com (PPS) with ESMTPS id 3phrk6wefa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:56 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUrKM45875776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:53 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 145EF2004D; Fri, 31 Mar 2023 11:30:53 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C762F20040; Fri, 31 Mar 2023 11:30:51 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:51 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 08/14] s390x/spec_ex: Use PSW macro Date: Fri, 31 Mar 2023 13:30:22 +0200 Message-Id: <20230331113028.621828-9-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: gYazr1EAozJuK5QQoEa-cJfJsugjPphM X-Proofpoint-GUID: q1bllldOzKxkGzggVIXMGc9ocNAynTZG X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 impostorscore=0 phishscore=0 suspectscore=0 clxscore=1015 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nina Schoetterl-Glausch Replace explicit psw definition by PSW macro. No functional change intended. Reviewed-by: Janosch Frank Signed-off-by: Nina Schoetterl-Glausch Link: https://lore.kernel.org/r/20230317133253.965010-2-nsg@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/spec_ex.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c index 42ecaed..2adc599 100644 --- a/s390x/spec_ex.c +++ b/s390x/spec_ex.c @@ -105,10 +105,7 @@ static int check_invalid_psw(void) /* For normal PSWs bit 12 has to be 0 to be a valid PSW*/ static int psw_bit_12_is_1(void) { - struct psw invalid = { - .mask = BIT(63 - 12), - .addr = 0x00000000deadbeee - }; + struct psw invalid = PSW(BIT(63 - 12), 0x00000000deadbeee); expect_invalid_psw(invalid); load_psw(invalid); @@ -118,10 +115,7 @@ static int psw_bit_12_is_1(void) /* A short PSW needs to have bit 12 set to be valid. */ static int short_psw_bit_12_is_0(void) { - struct psw invalid = { - .mask = BIT(63 - 12), - .addr = 0x00000000deadbeee - }; + struct psw invalid = PSW(BIT(63 - 12), 0x00000000deadbeee); struct short_psw short_invalid = { .mask = 0x0, .addr = 0xdeadbeee From patchwork Fri Mar 31 11:30:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195808 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B4E5C76196 for ; Fri, 31 Mar 2023 11:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbjCaLcO (ORCPT ); Fri, 31 Mar 2023 07:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbjCaLcL (ORCPT ); Fri, 31 Mar 2023 07:32:11 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7751EFE3 for ; Fri, 31 Mar 2023 04:31:38 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32V9BnrQ014031; Fri, 31 Mar 2023 11:31:20 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 : content-transfer-encoding : mime-version; s=pp1; bh=dUkXD1al7TFzOAl68/MHN5RYqdl61DOCw75IxI0+mcs=; b=QSPxVqn8migLBtjX3zYflsBhieelj2/I+T8vOFlrGUPCmjVn89z4Y9opnI8SIQ1PHRXl gI+mph0KljcFaDQyoat3pnkU/QTCPGEgg1OgXeTiCaHzdB+ZwCHlXprFlMUpOlesI/jW eIYQNnQ5S9WutJ6nLJqz4YrcIOmDUsByQYwwYqJ+SYGRl07JpI87+xeR2PTfx3m38NZg dMxuRaSq/q1qE4epAS6xmlJxVOb/SLyyLZJxF/4uLlFcr72zYqsmPDKeYRmawEQ9k1tT th7WwusbIldPNqTtSs2V6WUpUt9wOCdL5Otf/8MfMaPetNoro0vyuFo7xofn1u2/jhH5 rw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvnyb8vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:19 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32V9wIFb001620; Fri, 31 Mar 2023 11:31:19 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvnyb8pa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:19 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32V2Zf77032707; Fri, 31 Mar 2023 11:30:57 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3phrk6dfas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:57 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUsPH15729404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:54 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E7C120040; Fri, 31 Mar 2023 11:30:54 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E86B2004E; Fri, 31 Mar 2023 11:30:53 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:53 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 09/14] s390x/spec_ex: Add test introducing odd address into PSW Date: Fri, 31 Mar 2023 13:30:23 +0200 Message-Id: <20230331113028.621828-10-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: rfyPgSNKdHVKs_x3kfCbs6HUJldibV61 X-Proofpoint-GUID: Lh3Wg0WuIUSfYYFFfimovi_11VRMsLuO X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310094 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nina Schoetterl-Glausch Instructions on s390 must be halfword aligned. Introducing an odd instruction address into the PSW leads to a specification exception when attempting to execute the instruction at the odd address. Add a test for this. Acked-by: Janosch Frank Signed-off-by: Nina Schoetterl-Glausch Link: https://lore.kernel.org/r/20230317133253.965010-3-nsg@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/spec_ex.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c index 2adc599..ab02334 100644 --- a/s390x/spec_ex.c +++ b/s390x/spec_ex.c @@ -88,12 +88,23 @@ static void expect_invalid_psw(struct psw psw) invalid_psw_expected = true; } +static void clear_invalid_psw(void) +{ + expected_psw = PSW(0, 0); + invalid_psw_expected = false; +} + static int check_invalid_psw(void) { /* Since the fixup sets this to false we check for false here. */ if (!invalid_psw_expected) { + /* + * Early exception recognition: pgm_int_id == 0. + * Late exception recognition: psw address has been + * incremented by pgm_int_id (unpredictable value) + */ if (expected_psw.mask == invalid_psw.mask && - expected_psw.addr == invalid_psw.addr) + expected_psw.addr == invalid_psw.addr - lowcore.pgm_int_id) return 0; report_fail("Wrong invalid PSW"); } else { @@ -112,6 +123,42 @@ static int psw_bit_12_is_1(void) return check_invalid_psw(); } +extern char misaligned_code[]; +asm ( ".balign 2\n" +" . = . + 1\n" +"misaligned_code:\n" +" larl %r0,0\n" +" br %r1\n" +); + +static int psw_odd_address(void) +{ + struct psw odd = PSW_WITH_CUR_MASK((uint64_t)&misaligned_code); + uint64_t executed_addr; + + expect_invalid_psw(odd); + fixup_psw.mask = extract_psw_mask(); + asm volatile ( "xgr %%r0,%%r0\n" + " larl %%r1,0f\n" + " stg %%r1,%[fixup_addr]\n" + " lpswe %[odd_psw]\n" + "0: lr %[executed_addr],%%r0\n" + : [fixup_addr] "=&T" (fixup_psw.addr), + [executed_addr] "=d" (executed_addr) + : [odd_psw] "Q" (odd) + : "cc", "%r0", "%r1" + ); + + if (!executed_addr) { + return check_invalid_psw(); + } else { + assert(executed_addr == odd.addr); + clear_invalid_psw(); + report_fail("did not execute unaligned instructions"); + return 1; + } +} + /* A short PSW needs to have bit 12 set to be valid. */ static int short_psw_bit_12_is_0(void) { @@ -170,6 +217,7 @@ struct spec_ex_trigger { static const struct spec_ex_trigger spec_ex_triggers[] = { { "psw_bit_12_is_1", &psw_bit_12_is_1, false, &fixup_invalid_psw }, { "short_psw_bit_12_is_0", &short_psw_bit_12_is_0, false, &fixup_invalid_psw }, + { "psw_odd_address", &psw_odd_address, false, &fixup_invalid_psw }, { "bad_alignment", &bad_alignment, true, NULL }, { "not_even", ¬_even, true, NULL }, { NULL, NULL, false, NULL }, From patchwork Fri Mar 31 11:30:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195803 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7095C76196 for ; Fri, 31 Mar 2023 11:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231631AbjCaLcG (ORCPT ); Fri, 31 Mar 2023 07:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjCaLcD (ORCPT ); Fri, 31 Mar 2023 07:32:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B36041EFE2 for ; Fri, 31 Mar 2023 04:31:28 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VAusRn021792; Fri, 31 Mar 2023 11:31:02 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 : content-transfer-encoding : mime-version; s=pp1; bh=OjkS+rW7GQdY10cUGLGCIZ9HtfpHtacd1RoW+sSzIWw=; b=FrvyfmKghellXPeHIKWxDsLcqRhoAsjSQTICjH/KCGRChP0UPaMw9vAWotw8YJari2tA Nlkb6jDUVIIRL5bLX6MzdhvvXAl1H82v4mhbMj0XzaU681p49GM3tdgLkgNasvDJxrC4 NWZLVH5NR1W5cHabodbCpN7S/8X6obJS8XoCvqd2MLW5fwfC6N0zNxHCXhplPAkSG8Pp stKLbjH22f1b3Bv9OoGvkVndbnf1IP1iu2hX1Rgv1EIWP+EleafmHmclX56eudjIUuQS kYTYlZ3Lb/QILQm5eb/ODPOnxAZtYsKQ4NlYmEcfF3dcFGEL43Rw3p5dW/CHk3vZWfIo WA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnr111at6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:01 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VAwieo029655; Fri, 31 Mar 2023 11:31:01 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnr111asn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:01 +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 32V1sZkm008283; Fri, 31 Mar 2023 11:30:59 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3phr7fwfun-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:59 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUtiV14615058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:55 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2576A20040; Fri, 31 Mar 2023 11:30:55 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 493382004B; Fri, 31 Mar 2023 11:30:54 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:54 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 10/14] s390x/spec_ex: Add test of EXECUTE with odd target address Date: Fri, 31 Mar 2023 13:30:24 +0200 Message-Id: <20230331113028.621828-11-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9S8Y0r3tcjYbt_u5-QwzNbVuFSCRGmSQ X-Proofpoint-ORIG-GUID: OZZxM6wh-hYQ9pyOhkWA6N136KqzGYTQ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nina Schoetterl-Glausch The EXECUTE instruction executes the instruction at the given target address. This address must be halfword aligned, otherwise a specification exception occurs. Add a test for this. Reviewed-by: Janosch Frank Signed-off-by: Nina Schoetterl-Glausch Link: https://lore.kernel.org/r/20230317133253.965010-4-nsg@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/spec_ex.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c index ab02334..b4b9095 100644 --- a/s390x/spec_ex.c +++ b/s390x/spec_ex.c @@ -177,6 +177,30 @@ static int short_psw_bit_12_is_0(void) return 0; } +static int odd_ex_target(void) +{ + uint64_t pre_target_addr; + int to = 0, from = 0x0dd; + + asm volatile ( ".pushsection .text.ex_odd\n" + " .balign 2\n" + "pre_odd_ex_target:\n" + " . = . + 1\n" + " lr %[to],%[from]\n" + " .popsection\n" + + " larl %[pre_target_addr],pre_odd_ex_target\n" + " ex 0,1(%[pre_target_addr])\n" + : [pre_target_addr] "=&a" (pre_target_addr), + [to] "+d" (to) + : [from] "d" (from) + ); + + assert((pre_target_addr + 1) & 1); + report(to != from, "did not perform ex with odd target"); + return 0; +} + static int bad_alignment(void) { uint32_t words[5] __attribute__((aligned(16))); @@ -218,6 +242,7 @@ static const struct spec_ex_trigger spec_ex_triggers[] = { { "psw_bit_12_is_1", &psw_bit_12_is_1, false, &fixup_invalid_psw }, { "short_psw_bit_12_is_0", &short_psw_bit_12_is_0, false, &fixup_invalid_psw }, { "psw_odd_address", &psw_odd_address, false, &fixup_invalid_psw }, + { "odd_ex_target", &odd_ex_target, true, NULL }, { "bad_alignment", &bad_alignment, true, NULL }, { "not_even", ¬_even, true, NULL }, { NULL, NULL, false, NULL }, From patchwork Fri Mar 31 11:30:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195811 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1E8AC77B62 for ; Fri, 31 Mar 2023 11:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231907AbjCaLcT (ORCPT ); Fri, 31 Mar 2023 07:32:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231846AbjCaLcO (ORCPT ); Fri, 31 Mar 2023 07:32:14 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9D11EA07 for ; Fri, 31 Mar 2023 04:31:44 -0700 (PDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VAlOqX029338; Fri, 31 Mar 2023 11:31:42 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 : content-transfer-encoding : mime-version; s=pp1; bh=htu18JeVPa7/z7Aj/NlsLMkqwzWQdS3VFbhEbHPmYk4=; b=rqbAKq37tsEog96j8jamS9RhEIomfPn669qT1b6iziD+IKkPVoi2IWUdUdmf31GgN36W H6JwIYC8iH//LKU/4JJHLn920JdsxanS6UNorg/pP21p6P5gefjqL6I2JYYkULzCqiUN 8A3yYHBxGCGIi2LUS39gvOl8PZ/U5gyj/fr5sNJNbC2RVgFzBLFPS3yd+aSxNLwbrdA5 IDxGI3kbHpsJsuIK+5BKsZxDeExiRUaqpqboOodrvqFykqxrT/JrlfCl6syynT/sN6vB TsOCyi8i2kYkrRCgp9ND87sjLfBUW+sxvCpgMm9VmR/JTPEEtRSe8qybMMG8KKLXw5kO 8g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwj61wt4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:41 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VApHSA015830; Fri, 31 Mar 2023 11:31:40 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwj61wfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:40 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32ULi5l6005448; Fri, 31 Mar 2023 11:30:59 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3phrk6pqpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:30:59 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUuaj58327308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:56 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E13220040; Fri, 31 Mar 2023 11:30:56 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4156A2004B; Fri, 31 Mar 2023 11:30:55 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:55 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 11/14] s390x: Add tests for execute-type instructions Date: Fri, 31 Mar 2023 13:30:25 +0200 Message-Id: <20230331113028.621828-12-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: UMjNEQGbYcImav2JvVkNyvRTH0aaYyc- X-Proofpoint-ORIG-GUID: Hs5CGEdh0N45XKD6fDZk3H-vf3C_S9vq X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 malwarescore=0 clxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310094 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nina Schoetterl-Glausch Test the instruction address used by targets of an execute instruction. When the target instruction calculates a relative address, the result is relative to the target instruction, not the execute instruction. Reviewed-by: Janosch Frank Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20230317112339.774659-1-nsg@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/Makefile | 1 + s390x/ex.c | 188 ++++++++++++++++++++++++++++++++++++++++++++ s390x/unittests.cfg | 3 + .gitlab-ci.yml | 1 + 4 files changed, 193 insertions(+) create mode 100644 s390x/ex.c diff --git a/s390x/Makefile b/s390x/Makefile index ab146eb..a80db53 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -39,6 +39,7 @@ tests += $(TEST_DIR)/panic-loop-extint.elf tests += $(TEST_DIR)/panic-loop-pgm.elf tests += $(TEST_DIR)/migration-sck.elf tests += $(TEST_DIR)/exittime.elf +tests += $(TEST_DIR)/ex.elf pv-tests += $(TEST_DIR)/pv-diags.elf diff --git a/s390x/ex.c b/s390x/ex.c new file mode 100644 index 0000000..dbd8030 --- /dev/null +++ b/s390x/ex.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright IBM Corp. 2023 + * + * Test EXECUTE (RELATIVE LONG). + * These instructions execute a target instruction. The target instruction is formed + * by reading an instruction from memory and optionally modifying some of its bits. + * The execution of the target instruction is the same as if it was executed + * normally as part of the instruction sequence, except for the instruction + * address and the instruction-length code. + */ + +#include + +/* + * Accesses to the operand of execute-type instructions are instruction fetches. + * Minimum alignment is two, since the relative offset is specified by number of halfwords. + */ +asm ( ".pushsection .text.exrl_targets,\"x\"\n" +" .balign 2\n" +" .popsection\n" +); + +/* + * BRANCH AND SAVE, register register variant. + * Saves the next instruction address (address from PSW + length of instruction) + * to the first register. No branch is taken in this test, because 0 is + * specified as target. + * BASR does *not* perform a relative address calculation with an intermediate. + */ +static void test_basr(void) +{ + uint64_t ret_addr, after_ex; + + report_prefix_push("BASR"); + asm volatile ( ".pushsection .text.exrl_targets\n" + "0: basr %[ret_addr],0\n" + " .popsection\n" + + " larl %[after_ex],1f\n" + " exrl 0,0b\n" + "1:\n" + : [ret_addr] "=d" (ret_addr), + [after_ex] "=d" (after_ex) + ); + + report(ret_addr == after_ex, "return address after EX"); + report_prefix_pop(); +} + +/* + * BRANCH RELATIVE AND SAVE. + * According to PoP (Branch-Address Generation), the address calculated relative + * to the instruction address is relative to BRAS when it is the target of an + * execute-type instruction, not relative to the execute-type instruction. + */ +static void test_bras(void) +{ + uint64_t after_target, ret_addr, after_ex, branch_addr; + + report_prefix_push("BRAS"); + asm volatile ( ".pushsection .text.exrl_targets\n" + "0: bras %[ret_addr],1f\n" + " nopr %%r7\n" + "1: larl %[branch_addr],0\n" + " j 4f\n" + " .popsection\n" + + " larl %[after_target],1b\n" + " larl %[after_ex],3f\n" + "2: exrl 0,0b\n" +/* + * In case the address calculation is correct, we jump by the relative offset 1b-0b from 0b to 1b. + * In case the address calculation is relative to the exrl (i.e. a test failure), + * put a valid instruction at the same relative offset from the exrl, so the test continues in a + * controlled manner. + */ + "3: larl %[branch_addr],0\n" + "4:\n" + + " .if (1b - 0b) != (3b - 2b)\n" + " .error \"right and wrong target must have same offset\"\n" + " .endif\n" + : [after_target] "=d" (after_target), + [ret_addr] "=d" (ret_addr), + [after_ex] "=d" (after_ex), + [branch_addr] "=d" (branch_addr) + ); + + report(after_target == branch_addr, "address calculated relative to BRAS"); + report(ret_addr == after_ex, "return address after EX"); + report_prefix_pop(); +} + +/* + * LOAD ADDRESS RELATIVE LONG. + * If it is the target of an execute-type instruction, the address is relative + * to the LARL. + */ +static void test_larl(void) +{ + uint64_t target, addr; + + report_prefix_push("LARL"); + asm volatile ( ".pushsection .text.exrl_targets\n" + "0: larl %[addr],0\n" + " .popsection\n" + + " larl %[target],0b\n" + " exrl 0,0b\n" + : [target] "=d" (target), + [addr] "=d" (addr) + ); + + report(target == addr, "address calculated relative to LARL"); + report_prefix_pop(); +} + +/* LOAD LOGICAL RELATIVE LONG. + * If it is the target of an execute-type instruction, the address is relative + * to the LLGFRL. + */ +static void test_llgfrl(void) +{ + uint64_t target, value; + + report_prefix_push("LLGFRL"); + asm volatile ( ".pushsection .text.exrl_targets\n" + " .balign 4\n" + //operand of llgfrl must be word aligned + "0: llgfrl %[value],0\n" + " .popsection\n" + + " llgfrl %[target],0b\n" + //align (pad with nop), in case the wrong operand is used + " .balignw 4,0x0707\n" + " exrl 0,0b\n" + : [target] "=d" (target), + [value] "=d" (value) + ); + + report(target == value, "loaded correct value"); + report_prefix_pop(); +} + +/* + * COMPARE RELATIVE LONG + * If it is the target of an execute-type instruction, the address is relative + * to the CRL. + */ +static void test_crl(void) +{ + uint32_t program_mask, cc, crl_word; + + report_prefix_push("CRL"); + asm volatile ( ".pushsection .text.exrl_targets\n" + //operand of crl must be word aligned + " .balign 4\n" + "0: crl %[crl_word],0\n" + " .popsection\n" + + " lrl %[crl_word],0b\n" + //align (pad with nop), in case the wrong operand is used + " .balignw 4,0x0707\n" + " exrl 0,0b\n" + " ipm %[program_mask]\n" + : [program_mask] "=d" (program_mask), + [crl_word] "=d" (crl_word) + :: "cc" + ); + + cc = program_mask >> 28; + report(!cc, "operand compared to is relative to CRL"); + report_prefix_pop(); +} + +int main(int argc, char **argv) +{ + report_prefix_push("ex"); + test_basr(); + test_bras(); + test_larl(); + test_llgfrl(); + test_crl(); + report_prefix_pop(); + + return report_summary(); +} diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index d97eb5e..b61faf0 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -215,3 +215,6 @@ file = migration-skey.elf smp = 2 groups = migration extra_params = -append '--parallel' + +[execute] +file = ex.elf diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad7949c..a999f64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -275,6 +275,7 @@ s390x-kvm: - ACCEL=kvm ./run_tests.sh selftest-setup intercept emulator sieve sthyi diag10 diag308 pfmf cmm vector gs iep cpumodel diag288 stsi sclp-1g sclp-3g css skrf sie + execute | tee results.txt - grep -q PASS results.txt && ! grep -q FAIL results.txt only: From patchwork Fri Mar 31 11:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195810 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B5BBC76196 for ; Fri, 31 Mar 2023 11:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbjCaLcR (ORCPT ); Fri, 31 Mar 2023 07:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjCaLcM (ORCPT ); Fri, 31 Mar 2023 07:32:12 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D065F1E706 for ; Fri, 31 Mar 2023 04:31:40 -0700 (PDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32VBTnHd017939; Fri, 31 Mar 2023 11:31:25 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 : content-type : content-transfer-encoding : mime-version; s=pp1; bh=TQj/CLq8Xfqlz6SrmQQ3j+00+jgb2sU6nBcLaWgSyKE=; b=Jl8I7ruvafEfnvOfYC0Fx5x3OSkIGNZjKIKMFz3mG92RSr0HaGgpd4U+Ayr5iBlDqwZB ZDoHTdBMS76jVvaJtmj5qA96UFdsJMTtrxxpvw4+elLgTGDHAt4jZZguFqMN7CWkcb3p C7E+JUREBjolTsuuBmY7Cw083oGPpZviaI7SFEvtVp71PV/5SaqxpqTFnbzfyhfp0mnu YwPjaz1QCHCYOq6EUH1FBwDAlYdOyLSDDnVToDCk1PbeeiDvBXhZGkd9W9HUsGxUoJKO pkVdSoRe5nn/AjPOh9w/Fd+H0vjG+L5ywanBQY1zxRH1nZ5TuvXbe2ezc43AetAr/J8M 0A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnxpt81g2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:25 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBUQGR021177; Fri, 31 Mar 2023 11:31:24 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnxpt8181-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:24 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UNJdIv022923; Fri, 31 Mar 2023 11:31:01 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3phr7fpq9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:01 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUvas28705498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:57 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 902762004E; Fri, 31 Mar 2023 11:30:57 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72E9F20040; Fri, 31 Mar 2023 11:30:56 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:56 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests GIT PULL 12/14] MAINTAINERS: Add Nico as s390x Maintainer and make Thomas reviewer Date: Fri, 31 Mar 2023 13:30:26 +0200 Message-Id: <20230331113028.621828-13-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: rmxeibk1lM6jkRcN-zdVNnUXfNdKOdYF X-Proofpoint-ORIG-GUID: Kc6qfHVsqVX_V-OXpV78hPgVGk7o1oMK X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 phishscore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310094 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank The circle of life continues as we bring in Nico as a s390x maintainer. Thomas moves from the maintainer position to reviewer but he's a general maintainer of the project anyway. Signed-off-by: Janosch Frank Acked-by: Thomas Huth Reviewed-by: Claudio Imbrenda Acked-by: Nico Boehr Link: https://lore.kernel.org/r/20230322113400.1123378-1-frankja@linux.ibm.com Signed-off-by: Nico Boehr --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 649de50..bd1761d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -85,11 +85,12 @@ F: lib/powerpc/ F: lib/ppc64/ S390X -M: Thomas Huth M: Janosch Frank M: Claudio Imbrenda +M: Nico Böhr S: Supported R: David Hildenbrand +R: Thomas Huth L: kvm@vger.kernel.org L: linux-s390@vger.kernel.org F: s390x/ From patchwork Fri Mar 31 11:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195809 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7F45C761AF for ; Fri, 31 Mar 2023 11:32:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231753AbjCaLcP (ORCPT ); Fri, 31 Mar 2023 07:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbjCaLcL (ORCPT ); Fri, 31 Mar 2023 07:32:11 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 117561DFBE for ; Fri, 31 Mar 2023 04:31:40 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32V9Btaj014167; Fri, 31 Mar 2023 11:31:21 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 : content-transfer-encoding : mime-version; s=pp1; bh=0r7aBIDkLQ7TqVUppeuunGn1Rk70pTEuFzrmABzY4fQ=; b=qXqteSt8QLh0CBtX0cv63VMohunw3uOUz569XCFlnS051f7AOZnl8+klez8Ik4/Nkm7D 6buKVWl+ZxitZj9FQ82ysaDXjn0006A4SY0gSlfwHgY0gdhulDFp3qM0qTtXgogJ0tFN YGMzdGcnkgmn38Ne1d72Tuv6ehjIZpxzAeiEmSMmooTaYNgkdoQMAFu7aNhbES4CTmb4 h6tq4G21vBJ3wbBFzLN+SY/uSbd1KNLWqH/oOWxdV1y8JPeFvjacdRwXF40L0UrN2eT7 HtV+w09b9komF+pUQsIRmqccjLbMa8Ecq07L6Sm/RIILPwV/ufy0314x8iT1/+Qpe/MS +A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvnyb8w5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:21 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VBGAxi006381; Fri, 31 Mar 2023 11:31:19 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnvnyb8qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:19 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32V1S9Rd008501; Fri, 31 Mar 2023 11:31:03 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3phr7fpq9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:03 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBUx5Z30016222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:30:59 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFD8E2004B; Fri, 31 Mar 2023 11:30:58 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C980B20040; Fri, 31 Mar 2023 11:30:57 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:57 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com, Nina Schoetterl-Glausch Subject: [kvm-unit-tests GIT PULL 13/14] s390x: spec_ex: Add test for misaligned load Date: Fri, 31 Mar 2023 13:30:27 +0200 Message-Id: <20230331113028.621828-14-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4GkG0iqaSBdjosD1GwLfHFRXc7e_5snA X-Proofpoint-GUID: ikIx9bh6t82tnxrITWZS0VS2VK3dcjHx X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310094 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nina Schoetterl-Glausch The operand of LOAD RELATIVE LONG must be word aligned, otherwise a specification exception occurs. Test that this exception occurs. Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Nico Boehr Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20230301132638.3336040-1-nsg@linux.ibm.com Signed-off-by: Nico Boehr --- s390x/spec_ex.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c index b4b9095..20bd502 100644 --- a/s390x/spec_ex.c +++ b/s390x/spec_ex.c @@ -201,7 +201,7 @@ static int odd_ex_target(void) return 0; } -static int bad_alignment(void) +static int bad_alignment_lqp(void) { uint32_t words[5] __attribute__((aligned(16))); uint32_t (*bad_aligned)[4] = (uint32_t (*)[4])&words[1]; @@ -214,6 +214,22 @@ static int bad_alignment(void) return 0; } +static int bad_alignment_lrl(void) +{ + uint64_t r; + + asm volatile ( ".pushsection .rodata\n" + " .balign 4\n" + " . = . + 2\n" + "0: .fill 4\n" + " .popsection\n" + + " lrl %0,0b\n" + : "=d" (r) + ); + return 0; +} + static int not_even(void) { uint64_t quad[2] __attribute__((aligned(16))) = {0}; @@ -243,7 +259,8 @@ static const struct spec_ex_trigger spec_ex_triggers[] = { { "short_psw_bit_12_is_0", &short_psw_bit_12_is_0, false, &fixup_invalid_psw }, { "psw_odd_address", &psw_odd_address, false, &fixup_invalid_psw }, { "odd_ex_target", &odd_ex_target, true, NULL }, - { "bad_alignment", &bad_alignment, true, NULL }, + { "bad_alignment_lqp", &bad_alignment_lqp, true, NULL }, + { "bad_alignment_lrl", &bad_alignment_lrl, true, NULL }, { "not_even", ¬_even, true, NULL }, { NULL, NULL, false, NULL }, }; From patchwork Fri Mar 31 11:30:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nico Boehr X-Patchwork-Id: 13195804 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73BDDC6FD18 for ; Fri, 31 Mar 2023 11:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231743AbjCaLcI (ORCPT ); Fri, 31 Mar 2023 07:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbjCaLcE (ORCPT ); Fri, 31 Mar 2023 07:32:04 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCFE01EFEF for ; Fri, 31 Mar 2023 04:31:29 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32V9tNaw014622; Fri, 31 Mar 2023 11:31:07 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 : content-transfer-encoding : mime-version; s=pp1; bh=3AMcCdIrjohLjHCBBSvqMu35AOG2/1a/6RSDFdhoE2s=; b=LMSbjRaLcm5eMq0I9GJ7Iv6J+kF4lyieBf90oAuTL3DsoXcCuBnBTxeSdwbWj8qBhptb lRhvCsC66AtvapEZgPCFUsMBvnoJH6F5mRq4KwSSzds/qFW82xe+iLesYOQBjaC3Vwax W00bN4wD060fQbk4VG0PHRk5nEy8NNESgA/eU1A4EJSG8xuRnSjtxMpRv0jLzPLffbIJ 8OqxHjI/7gbamZwNOoXMtsHWG9IYDyNZB9G/grt0fo6zgfV2mEk5GTDsGW+GZZ+PCCfD 00+GEWcLcEYqz0wI7PzQIVwrjkPX3YPbDEe6BbptqPZYuaPQQHP8VSTumSj4WhakkkHq aw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahteeh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:07 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32VAV42u031186; Fri, 31 Mar 2023 11:31:06 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pnwahtee1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:06 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32UAJLNA000399; Fri, 31 Mar 2023 11:31:05 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3phrk6nf8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Mar 2023 11:31:05 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32VBV0qr44106382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Mar 2023 11:31:00 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25EDE2004D; Fri, 31 Mar 2023 11:31:00 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15A8B20040; Fri, 31 Mar 2023 11:30:59 +0000 (GMT) Received: from t14-nrb.ibmuc.com (unknown [9.179.9.190]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 31 Mar 2023 11:30:58 +0000 (GMT) From: Nico Boehr To: thuth@redhat.com, pbonzini@redhat.com, andrew.jones@linux.dev Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests GIT PULL 14/14] s390x: sie: Test whether the epoch extension field is working as expected Date: Fri, 31 Mar 2023 13:30:28 +0200 Message-Id: <20230331113028.621828-15-nrb@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331113028.621828-1-nrb@linux.ibm.com> References: <20230331113028.621828-1-nrb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sYmQ1n-UEHeJhC32GTrnGIffiRlnIdJy X-Proofpoint-GUID: z0NaV0iSOo575c54PrQEwvBVwdAp5qi8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-31_06,2023-03-30_04,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303310091 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Thomas Huth We recently discovered a bug with the time management in nested scenarios which got fixed by kernel commit "KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field". This adds a simple test for this bug so that it is easier to determine whether the host kernel of a machine has already been fixed or not. Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20221208170502.17984-1-thuth@redhat.com Signed-off-by: Nico Boehr --- s390x/sie.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/s390x/sie.c b/s390x/sie.c index 87575b2..cd3cea1 100644 --- a/s390x/sie.c +++ b/s390x/sie.c @@ -58,6 +58,33 @@ static void test_diags(void) } } +static void test_epoch_ext(void) +{ + u32 instr[] = { + 0xb2780000, /* STCKE 0 */ + 0x83000044 /* DIAG 0x44 to intercept */ + }; + + if (!test_facility(139)) { + report_skip("epdx: Multiple Epoch Facility is not available"); + return; + } + + guest[0] = 0x00; + memcpy(guest_instr, instr, sizeof(instr)); + + vm.sblk->gpsw.addr = PAGE_SIZE * 2; + vm.sblk->gpsw.mask = PSW_MASK_64; + + vm.sblk->ecd |= ECD_MEF; + vm.sblk->epdx = 0x47; /* Setting the epoch extension here ... */ + + sie(&vm); + + /* ... should result in the same epoch extension here: */ + report(guest[0] == 0x47, "epdx: different epoch is visible in the guest"); +} + static void setup_guest(void) { setup_vm(); @@ -80,6 +107,7 @@ int main(void) setup_guest(); test_diags(); + test_epoch_ext(); sie_guest_destroy(&vm); done: