From patchwork Tue Mar 7 09:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163051 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 0FF1DC678D5 for ; Tue, 7 Mar 2023 09:11:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230244AbjCGJLZ (ORCPT ); Tue, 7 Mar 2023 04:11:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbjCGJLR (ORCPT ); Tue, 7 Mar 2023 04:11:17 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E0152927 for ; Tue, 7 Mar 2023 01:11:10 -0800 (PST) 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 327718Ip032457 for ; Tue, 7 Mar 2023 09:11:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=xd/ezf7YBKfH/srY4BN1tO1Kr3Tkgb5krvJYuokCDnA=; b=Zw8QkstJqE7fNuBjmHEUonoGA2mk/Gw4coXmpAMEw0Wuv7PWsvyak6skBb8qVS4pIje6 ZTDW8J2I1xevj2CRx7Bw4K/BXFREB/DNowF6U9fosWH+uHfmn6dGKiDG4MIK8FcNofNN 72S2TeE1s14d4dDy54ZWciVj7PJQBU5XyUqUKtZr/9l7NEkJziFDzF54YhAPOEjOiFyh IaZ9J6BTVX+g6xTmeIujUle+pgoA1VdCDwEUlSpi1XV70Q4bDTBSADNNyHeg+HEtpgrz H++FoDZgsOi+ds9ta4X4IVV91oy6jMNZBEb8RTN0/CpCCLhIasBL/vLKHib8TSjwighW pg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3p4wsx20ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:09 +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 3276dfAb001483 for ; Tue, 7 Mar 2023 09:11:08 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3p4wsx20gp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:08 +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 326Ncjcv001857; Tue, 7 Mar 2023 09:11:07 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3p4192b4cn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:06 +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 3279B3AI17367626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:03 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A24C20043; Tue, 7 Mar 2023 09:11:03 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDF1720040; Tue, 7 Mar 2023 09:11:02 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:02 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 1/7] .gitignore: ignore `s390x/comm.key` file Date: Tue, 7 Mar 2023 10:10:45 +0100 Message-Id: <20230307091051.13945-2-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0h2zMqmp-gcGbgZOAxlAVXYp1bXQeK7G X-Proofpoint-GUID: k7fiOTdJgkWIhrVAXFd8mesrqbI11nXU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_02,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Ignore the Secure Execution Customer Communication Key file. Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 33529b65a7e3..601822d67325 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 Tue Mar 7 09:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163050 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 184B2C678DB for ; Tue, 7 Mar 2023 09:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230256AbjCGJLY (ORCPT ); Tue, 7 Mar 2023 04:11:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbjCGJLR (ORCPT ); Tue, 7 Mar 2023 04:11:17 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE9115167 for ; Tue, 7 Mar 2023 01:11:10 -0800 (PST) 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 3278qE0c001527 for ; Tue, 7 Mar 2023 09:11:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=gIVH8+Yqe1lNmrtjIq0FQEstA4pMEK4au/ZpVOgetEU=; b=cDYQM27EwM653jMlk29KHUmaioWmRPa8U20PSX3u0nsCojRdkndD1YHdAAbp53EsoFdW iJpy6CP6Pqtk/6/9XZY4q8dVJNbI1RCV4UnYbb6mvw0lFkQiqzW0jt5nVgdMqQ+UVB4E eI2q/GOxGTiyGSaLri7JVmI66wnuDyRtEgA6G2+v3eX4ElJB9PX0Kd23WRZ8zcbtw+Op XoyXOYwVCsDwsdEXRGkd6IVcrY6koiAdfRUbI314AhWz8HVTx+igdE2Ac4Me+UuENFNm 9sns6AZXxzIyWZ8dpSpx8sQQP6sxyxA1MHVHWjImUg2MYOiv1a6Jms75/cfGTz7KyPNc bQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p500e9hca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:10 +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 32790EOY018130 for ; Tue, 7 Mar 2023 09:11:09 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 3p500e9hbq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:09 +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 3272D97H005943; Tue, 7 Mar 2023 09:11:07 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3p418cv021-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:07 +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 3279B4Ck32112928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:04 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 119D320043; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7578820040; Tue, 7 Mar 2023 09:11:03 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:03 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 2/7] s390x/Makefile: simplify `%.hdr` target rules Date: Tue, 7 Mar 2023 10:10:46 +0100 Message-Id: <20230307091051.13945-3-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: svxJtdywJWQJzfY3jsuAv1MW-dDvwCq5 X-Proofpoint-GUID: P4sgtYQRrvdzpS3CplhTBGBe_djDsmQU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_03,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=951 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- s390x/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 97a616111680..660ff06f1e7c 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 Tue Mar 7 09:10:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163052 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 757E6C678DB for ; Tue, 7 Mar 2023 09:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbjCGJL0 (ORCPT ); Tue, 7 Mar 2023 04:11:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbjCGJLR (ORCPT ); Tue, 7 Mar 2023 04:11:17 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A35BA5293C for ; Tue, 7 Mar 2023 01:11:11 -0800 (PST) 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 3278cvmd013885 for ; Tue, 7 Mar 2023 09:11:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=te7ZoAMNDV6GdrYAYgNR5XPHL3eTlx6QHNXNXxpONSs=; b=HUvRMchjJjjG/DQkIQ+J4F5LOOk1YTBqvejUCkvcqanbNH0vLBXcw9SCcNMMQfw+exVR q1Ys7k6jB7kiHvlDmGjFWGoLIWv03aPKmhluz1m2AWNUSv+mSq2GBLwm/v0TV+wRjAvT SNVStWzP70zKoZa6/Ed1XBoCRw3DG8dFkJHba2t3sIyQ1rvMd8a9sGxz8YMRKaya8tVw ENg/8Htdrehp2W5BRr4KktJyPAkHv9Q8GQxQ3rAtgJLO7RFnom9gCP6+kKWunjTsSw5N 1E7I5Gm4Wgh4TrzLdORdLb9ABpkOyMhwRsMQme0hdhggqjLN1ANzjmWlDWMupvIGwgo2 zw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p4uafdb0q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:11 +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 3277TGWW006945 for ; Tue, 7 Mar 2023 09:11:10 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p4uafdays-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:10 +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 3270gNPY006889; Tue, 7 Mar 2023 09:11:08 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma02fra.de.ibm.com (PPS) with ESMTPS id 3p419kb4hh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:08 +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 3279B4W632112930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:04 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1EC120043; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E4C820040; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 3/7] s390x/Makefile: fix `*.gbin` target dependencies Date: Tue, 7 Mar 2023 10:10:47 +0100 Message-Id: <20230307091051.13945-4-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: aFFXeTh2b5KrdmNyBRv_bEvm2TsC3-5k X-Proofpoint-ORIG-GUID: wrhfskKxBNHC0dUvA1Y8SopeYDnvxa2_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_03,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxscore=0 impostorscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- s390x/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/s390x/Makefile b/s390x/Makefile index 660ff06f1e7c..71e6563bbb61 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 Tue Mar 7 09:10:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163049 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 94093C678D4 for ; Tue, 7 Mar 2023 09:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbjCGJLW (ORCPT ); Tue, 7 Mar 2023 04:11:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjCGJLR (ORCPT ); Tue, 7 Mar 2023 04:11:17 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54FF580CC for ; Tue, 7 Mar 2023 01:11:12 -0800 (PST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32795KWm028395 for ; Tue, 7 Mar 2023 09:11:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=nDGdhpkD2Itw8LdcZD2t7Jt0OBtHc0Ng740I1CeEQwc=; b=Md5UqVyuOJlmhw7sUMVwKeDjS6D0nK3AzgDRxXsm96PMwJxHU3ZsD/FTzzG7URBHizFb LPWYbvnIhBWoqdXTkP0HrFKR+zVdLEkHpNg+NaONjWeaFpHcv4dbvKF6Ay8rLZNr1MIO I1Mg4NrgBIJvcjlASQAva2cSfjPhseU16agtFaAAy1Czz/4sfYzyc0qddukLXBTsd0p9 tpE26YPO5EOLHCeh8og7WZoG14isexTp8hfCqzkHfjU/nSqqG+01hFFD9EIysFt8Qkgn UYd+CW3NnIri5qSZQl3/8Vul82EUiiJjM8gw8BdJC7KEBMNO6jjL3T+i5VEORK093wxf CA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p5p4x2du9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:12 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3279BBor018713 for ; Tue, 7 Mar 2023 09:11:11 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 3p5p4x2dtq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:11 +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 326N60WE001897; Tue, 7 Mar 2023 09:11:09 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3p4192b4cp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:09 +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 3279B5IY42467598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:05 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AE0120043; Tue, 7 Mar 2023 09:11:05 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE4B920040; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:04 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 4/7] s390x/Makefile: refactor CPPFLAGS Date: Tue, 7 Mar 2023 10:10:48 +0100 Message-Id: <20230307091051.13945-5-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Cji0ue7XS87Dm1WIzQLuqA1_DFZLLQ_E X-Proofpoint-GUID: 6uREDzfl1QOjwLxPupCdykEtQVHNWuXG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_03,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=890 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This change makes it easier to reuse them. While at it, remove `lib` include path since it seems to be unused. Signed-off-by: Marc Hartmayer Reviewed-by: Janosch Frank --- s390x/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/s390x/Makefile b/s390x/Makefile index 71e6563bbb61..8719f0c837cf 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -63,9 +63,12 @@ test_cases: $(tests) test_cases_binary: $(tests_binary) test_cases_pv: $(tests_pv_binary) +INCLUDE_PATHS = $(SRCDIR)/lib $(SRCDIR)/lib/s390x +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 Tue Mar 7 09:10:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163053 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 898DAC678D4 for ; Tue, 7 Mar 2023 09:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbjCGJL1 (ORCPT ); Tue, 7 Mar 2023 04:11:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbjCGJLS (ORCPT ); Tue, 7 Mar 2023 04:11:18 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1858B6BDDA for ; Tue, 7 Mar 2023 01:11:13 -0800 (PST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3277mg2d028272 for ; Tue, 7 Mar 2023 09:11:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ehVjHwWHu4TI259rf9hJ2RAjmZTOtumd2vykenTy5LI=; b=faUGh7WP1Gp9h8DmqSVvCr2lNX7lqrc34tPQRsEc55TX+eVn/eqnf5H9EkZmFXW7u/5c 9jxOPbhXtjFZdNRwgrbfvfsMDIi7kQSoo3EHyynyTs7i/bVCOJQOGmCuMdO4G99CyjMn vD0LK+fbCCRrUjfxqpl1v84xySIDOVmtT1gxR5qxLlOUALT4pxtshQEEnuk1GTQfuOgv YHDSMGPQKavdk2FJvypGF6H+CThCBuOnDHGU9kVHQbFFijB/Syh5YxYD+5EJI0MZ+15Q QxN/sorjSQXgfToIcUobky98/xXtHLiuCYru7tguK4a4XRFHJVhxQXcVjMbAx79saINT fg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p5p4x2duf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:12 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3278uqDq022901 for ; Tue, 7 Mar 2023 09:11:12 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 3p5p4x2dtu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:11 +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 3271GjZp005750; Tue, 7 Mar 2023 09:11:09 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3p41brc0j4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:09 +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 3279B6R366584918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:06 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3129120043; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 98F9E20040; Tue, 7 Mar 2023 09:11:05 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:05 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 5/7] s390x: use preprocessor for linker script generation Date: Tue, 7 Mar 2023 10:10:49 +0100 Message-Id: <20230307091051.13945-6-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: moqtJ1BrnHCafHwVKJD088NeqOqdikLy X-Proofpoint-GUID: qoWGBD6riozwDfW8kYAv7fe_LwUssmMW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_03,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 impostorscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=742 priorityscore=1501 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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: Claudio Imbrenda Reviewed-by: Nina Schoetterl-Glausch --- .gitignore | 1 + 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 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/.gitignore b/.gitignore index 601822d67325..29f352c5ceb6 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ cscope.* /s390x/comm.key /s390x/snippets/*/*.hdr /s390x/snippets/*/*.*obj +/s390x/**/*.lds diff --git a/s390x/Makefile b/s390x/Makefile index 8719f0c837cf..e13a04eecb3e 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -76,7 +76,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 @@ -159,6 +159,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 @@ -211,7 +214,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 From patchwork Tue Mar 7 09:10:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163054 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 EC889C678DB for ; Tue, 7 Mar 2023 09:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbjCGJL3 (ORCPT ); Tue, 7 Mar 2023 04:11:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbjCGJLV (ORCPT ); Tue, 7 Mar 2023 04:11:21 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC40052934 for ; Tue, 7 Mar 2023 01:11:13 -0800 (PST) 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 3277gOP5030658 for ; Tue, 7 Mar 2023 09:11:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=XxKPJTd2L5GIjADK1WRww3bpPjxJLjQIBvYps2w4IQo=; b=S19os1ldyxu6Gm3s9LmdFVJiezA34YRKb9p6IiCnsxpCpxQYql5rNGVkPPQVMci1pweT TlLhUr0VqS6c2/+vDXH8re8gEKS7o6AnpNVwdwP+p0ft8ULWH26ogL5M+Moce3gGb9nz wnzOYAOKWF1sqjJTxUf/GH874qPAWIsV0dM4UurFbrf0yTEC+dpRP9OUcZdzNdi+Noyw sUm5TFRy90fubjAGZ7pIeRHr4F2/ELwgtrKWBojMRMpn8xUOysfuD8AVeUAEyYBGpLSM 2BNqZ0txvwspOBrV/rAZSuKjY14vRzp0qd3+Iq3aNtlR3s+lbBBvif019OJKLwpwSg93 MA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p513ff2jw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:12 +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 3279BCKI022949 for ; Tue, 7 Mar 2023 09:11:12 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 3p513ff2j6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:12 +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 326MkTum001841; Tue, 7 Mar 2023 09:11:10 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3p4192b4cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:10 +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 3279B60G983710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:07 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D4BB220043; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4C0EF20040; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 6/7] s390x: define a macro for the stack frame size Date: Tue, 7 Mar 2023 10:10:50 +0100 Message-Id: <20230307091051.13945-7-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Mlg2uiSoigOlGhqjxGyoevKH_kas20-X X-Proofpoint-GUID: RUIslHlhCH266Su5DEcGzO5UWAuGoMuY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_02,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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: Claudio Imbrenda Reviewed-by: Nina Schoetterl-Glausch --- lib/s390x/asm-offsets.c | 1 + s390x/Makefile | 2 +- s390x/cstart64.S | 2 +- s390x/flat.lds.S | 4 +++- s390x/gs.c | 38 +++++++++++++++++++++---------------- s390x/macros.S | 4 ++-- s390x/snippets/c/flat.lds.S | 6 ++++-- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c index f612f3277a95..188dd2e51181 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/Makefile b/s390x/Makefile index e13a04eecb3e..fc8201f7762b 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -160,7 +160,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/s390x/cstart64.S b/s390x/cstart64.S index 6f83da2a6c0a..468ace3ea4df 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 952f6cd457ed..0cb7e383cc76 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/gs.c b/s390x/gs.c index 4993eb8f43a9..9ae893eaf89a 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) { diff --git a/s390x/macros.S b/s390x/macros.S index 13cff299488f..e2a56a366c70 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 9e5eb66bec23..468b5f1eebe8 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 : { From patchwork Tue Mar 7 09:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Hartmayer X-Patchwork-Id: 13163055 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 0E21DC678D4 for ; Tue, 7 Mar 2023 09:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbjCGJLa (ORCPT ); Tue, 7 Mar 2023 04:11:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbjCGJLW (ORCPT ); Tue, 7 Mar 2023 04:11:22 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36AF5291D for ; Tue, 7 Mar 2023 01:11:14 -0800 (PST) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32771e0g011444 for ; Tue, 7 Mar 2023 09:11:13 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=p0OgmB5fDUpyV46KmMqzsQjK1QXFPsuaf4U5e9BSEf4=; b=Yo7BZVAc+fgjkuIaRElPwGb1J7V3Z/sYAWNsueUr2uicgHsdKMFNtKT1RVq4oWLpcfDd l1eaeFjhw6Ymtb7xh6NIDU8FQ2b01LaUT5ewsWh/K4IWPKXCmc3+qwD0DmRDuN0Tl6VG GD7JH7jKyUOUYoA5SSuy5M3DW2Tmy6SeQuhcbQlDLRZI5IRmXLeUQzdeHZUqCmWc8Hed Ao4Gu98HwKDND8rzCuapM0/UoBAUn019xEXaYs1YbVzsAC26fkeU5k0U2TuHm3l2e7MW J+qj2/vhc4MCzJ8PfK1K8vTeqXIkNPhPhBBOok3MXBYuiW43PIIr/tDKTpdoURqFuIAK 0w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3p50n4yrex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 07 Mar 2023 09:11:13 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3278tfLQ030788 for ; Tue, 7 Mar 2023 09:11:13 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 3p50n4yre9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:13 +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 3272B3S6007338; Tue, 7 Mar 2023 09:11:11 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3p4188c0jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 Mar 2023 09:11:10 +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 3279B7s764422376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Mar 2023 09:11:07 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9AD5820043; Tue, 7 Mar 2023 09:11:07 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F016620040; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) Received: from li-1de7cd4c-3205-11b2-a85c-d27f97db1fe1.ibm.com.com (unknown [9.171.61.17]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 7 Mar 2023 09:11:06 +0000 (GMT) From: Marc Hartmayer To: Cc: Janosch Frank , David Hildenbrand , Claudio Imbrenda , Nina Schoetterl-Glausch , Nico Boehr , Thomas Huth Subject: [kvm-unit-tests PATCH v3 7/7] lib/linux/const.h: test for `__ASSEMBLER__` as well Date: Tue, 7 Mar 2023 10:10:51 +0100 Message-Id: <20230307091051.13945-8-mhartmay@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307091051.13945-1-mhartmay@linux.ibm.com> References: <20230307091051.13945-1-mhartmay@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: FoThNxSzd8VkVLVNdL7jgwg0IZAq7b8r X-Proofpoint-GUID: wJDUgNbEpySlJ0_aF0bLFr8Q8sOxAaXW X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-07_02,2023-03-06_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 mlxlogscore=946 bulkscore=0 phishscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303070082 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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 c872bfd25e13..be114dc4a553 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