From patchwork Wed Apr 13 12:36:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1616744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=P0/hQIe3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kdhsz5MSnz9sG5 for ; Wed, 13 Apr 2022 22:36:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 074183857811 for ; Wed, 13 Apr 2022 12:36:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 074183857811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649853396; bh=oVr1iRp2X/B/QQBm+aJhvn02W558oikhRLNx9QZ5+b0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=P0/hQIe3MB+HLKvdUKX1NKhjhYlIFeLtO5iAfCZLaEB4rw0PhT7+huOsXiYpYCWJ4 bk+lupKvFyHV1MqkDmN/tpGjJEwCzQnHBLQF0AVLSRpJItMaZFpkjmUKie9RXNx9WI MXXBL2irUnVIRmUoIfQNI9332LiouczOpIkuzLak= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C6F69385840F for ; Wed, 13 Apr 2022 12:36:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C6F69385840F Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23DCJDvH010451 for ; Wed, 13 Apr 2022 12:36:20 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 3fdxdn8atb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Apr 2022 12:36:20 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23DCGHlV002076 for ; Wed, 13 Apr 2022 12:36:18 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma05fra.de.ibm.com with ESMTP id 3fb1s8nghp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Apr 2022 12:36:18 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23DCaEKd47841640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Apr 2022 12:36:15 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD99DA4055; Wed, 13 Apr 2022 12:36:14 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A6B76A4051; Wed, 13 Apr 2022 12:36:14 +0000 (GMT) Received: from a3545026.lnxne.boe (unknown [9.152.108.100]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 13 Apr 2022 12:36:14 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH] S390: Add new s390 platform z16. Date: Wed, 13 Apr 2022 14:36:09 +0200 Message-Id: <20220413123609.1962983-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 77uDSRToCnne5VOT4I2FRUZs2IHN9yX- X-Proofpoint-GUID: 77uDSRToCnne5VOT4I2FRUZs2IHN9yX- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-13_01,2022-04-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=951 spamscore=0 phishscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204130067 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stefan Liebler via Libc-alpha From: Stefan Liebler Reply-To: Stefan Liebler Cc: Stefan Liebler Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" The new IBM z16 is added to platform string array. The macro _DL_PLATFORMS_COUNT is incremented. _dl_hwcaps_subdir is extended by "z16" if HWCAP_S390_VXRS_PDE2 is set. HWCAP_S390_NNPA is not tested in _dl_hwcaps_subdirs_active as those instructions may be replaced or removed in future. tst-glibc-hwcaps.c is extended in order to test z16 via new marker5. A fatal glibc error is dumped if glibc was build with architecture level set for z16, but run on an older machine. (See dl-hwcap-check.h) --- elf/Makefile | 8 ++++++++ elf/tst-glibc-hwcaps-cache.script | 6 ++++++ sysdeps/s390/dl-procinfo.c | 5 +++-- sysdeps/s390/dl-procinfo.h | 2 +- sysdeps/s390/s390-64/Makefile | 25 ++++++++++++++++++++++-- sysdeps/s390/s390-64/dl-hwcap-check.h | 6 +++++- sysdeps/s390/s390-64/dl-hwcaps-subdirs.c | 11 +++++++++-- sysdeps/s390/s390-64/tst-glibc-hwcaps.c | 6 +++++- 8 files changed, 60 insertions(+), 9 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index c96924e9c2..d30d0ee917 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -617,6 +617,11 @@ modules-names = \ libmarkermod4-2 \ libmarkermod4-3 \ libmarkermod4-4 \ + libmarkermod5-1 \ + libmarkermod5-2 \ + libmarkermod5-3 \ + libmarkermod5-4 \ + libmarkermod5-5 \ ltglobmod1 \ ltglobmod2 \ neededobj1 \ @@ -2501,6 +2506,7 @@ LDFLAGS-libmarkermod1-1.so += -Wl,-soname,libmarkermod1.so LDFLAGS-libmarkermod2-1.so += -Wl,-soname,libmarkermod2.so LDFLAGS-libmarkermod3-1.so += -Wl,-soname,libmarkermod3.so LDFLAGS-libmarkermod4-1.so += -Wl,-soname,libmarkermod4.so +LDFLAGS-libmarkermod5-1.so += -Wl,-soname,libmarkermod5.so $(objpfx)libmarkermod%.os : markermodMARKER-VALUE.c $(compile-command.c) \ -DMARKER=marker$(firstword $(subst -, ,$*)) \ @@ -2513,6 +2519,8 @@ $(objpfx)libmarkermod3.so: $(objpfx)libmarkermod3-1.so cp $< $@ $(objpfx)libmarkermod4.so: $(objpfx)libmarkermod4-1.so cp $< $@ +$(objpfx)libmarkermod5.so: $(objpfx)libmarkermod5-1.so + cp $< $@ # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is # preferred over auto-detected subdirectories. diff --git a/elf/tst-glibc-hwcaps-cache.script b/elf/tst-glibc-hwcaps-cache.script index c3271f61f9..d58fc8c5de 100644 --- a/elf/tst-glibc-hwcaps-cache.script +++ b/elf/tst-glibc-hwcaps-cache.script @@ -4,6 +4,7 @@ cp $B/elf/libmarkermod2-1.so $L/libmarkermod2.so cp $B/elf/libmarkermod3-1.so $L/libmarkermod3.so cp $B/elf/libmarkermod4-1.so $L/libmarkermod4.so +cp $B/elf/libmarkermod5-1.so $L/libmarkermod5.so mkdirp 0770 $L/glibc-hwcaps/power9 cp $B/elf/libmarkermod2-2.so $L/glibc-hwcaps/power9/libmarkermod2.so @@ -20,6 +21,11 @@ mkdirp 0770 $L/glibc-hwcaps/z15 cp $B/elf/libmarkermod4-2.so $L/glibc-hwcaps/z13/libmarkermod4.so cp $B/elf/libmarkermod4-3.so $L/glibc-hwcaps/z14/libmarkermod4.so cp $B/elf/libmarkermod4-4.so $L/glibc-hwcaps/z15/libmarkermod4.so +mkdirp 0770 $L/glibc-hwcaps/z16 +cp $B/elf/libmarkermod5-2.so $L/glibc-hwcaps/z13/libmarkermod5.so +cp $B/elf/libmarkermod5-3.so $L/glibc-hwcaps/z14/libmarkermod5.so +cp $B/elf/libmarkermod5-4.so $L/glibc-hwcaps/z15/libmarkermod5.so +cp $B/elf/libmarkermod5-5.so $L/glibc-hwcaps/z16/libmarkermod5.so mkdirp 0770 $L/glibc-hwcaps/x86-64-v2 cp $B/elf/libmarkermod2-2.so $L/glibc-hwcaps/x86-64-v2/libmarkermod2.so diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c index 2cdb3c8b5e..f142221a17 100644 --- a/sysdeps/s390/dl-procinfo.c +++ b/sysdeps/s390/dl-procinfo.c @@ -63,11 +63,12 @@ PROCINFO_CLASS const char _dl_s390_cap_flags[23][9] #if !defined PROCINFO_DECL && defined SHARED ._dl_s390_platforms #else -PROCINFO_CLASS const char _dl_s390_platforms[10][7] +PROCINFO_CLASS const char _dl_s390_platforms[11][7] #endif #ifndef PROCINFO_DECL = { - "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15" + "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15", + "z16" } #endif #if !defined SHARED || defined PROCINFO_DECL diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h index 03d7e94379..1f4e3875ba 100644 --- a/sysdeps/s390/dl-procinfo.h +++ b/sysdeps/s390/dl-procinfo.h @@ -22,7 +22,7 @@ #define _DL_HWCAP_COUNT 23 -#define _DL_PLATFORMS_COUNT 10 +#define _DL_PLATFORMS_COUNT 11 /* The kernel provides up to 32 capability bits with elf_hwcap. */ #define _DL_FIRST_PLATFORM 32 diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile index e5da26871c..66ed844e68 100644 --- a/sysdeps/s390/s390-64/Makefile +++ b/sysdeps/s390/s390-64/Makefile @@ -7,8 +7,11 @@ CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused CFLAGS-dl-load.c += -Wno-unused CFLAGS-dl-reloc.c += -Wno-unused -$(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \ - $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so +$(objpfx)tst-glibc-hwcaps: \ + $(objpfx)libmarkermod2-1.so \ + $(objpfx)libmarkermod3-1.so \ + $(objpfx)libmarkermod4-1.so \ + $(objpfx)libmarkermod5-1.so $(objpfx)tst-glibc-hwcaps.out: \ $(objpfx)libmarkermod2.so \ $(objpfx)glibc-hwcaps/z13/libmarkermod2.so \ @@ -19,6 +22,11 @@ $(objpfx)tst-glibc-hwcaps.out: \ $(objpfx)glibc-hwcaps/z13/libmarkermod4.so \ $(objpfx)glibc-hwcaps/z14/libmarkermod4.so \ $(objpfx)glibc-hwcaps/z15/libmarkermod4.so \ + $(objpfx)libmarkermod5.so \ + $(objpfx)glibc-hwcaps/z13/libmarkermod5.so \ + $(objpfx)glibc-hwcaps/z14/libmarkermod5.so \ + $(objpfx)glibc-hwcaps/z15/libmarkermod5.so \ + $(objpfx)glibc-hwcaps/z16/libmarkermod5.so $(objpfx)glibc-hwcaps/z13/libmarkermod2.so: $(objpfx)libmarkermod2-2.so $(make-target-directory) @@ -38,6 +46,19 @@ $(objpfx)glibc-hwcaps/z14/libmarkermod4.so: $(objpfx)libmarkermod4-3.so $(objpfx)glibc-hwcaps/z15/libmarkermod4.so: $(objpfx)libmarkermod4-4.so $(make-target-directory) cp $< $@ +$(objpfx)glibc-hwcaps/z13/libmarkermod5.so: $(objpfx)libmarkermod5-2.so + $(make-target-directory) + cp $< $@ +$(objpfx)glibc-hwcaps/z14/libmarkermod5.so: $(objpfx)libmarkermod5-3.so + $(make-target-directory) + cp $< $@ +$(objpfx)glibc-hwcaps/z15/libmarkermod5.so: $(objpfx)libmarkermod5-4.so + $(make-target-directory) + cp $< $@ +$(objpfx)glibc-hwcaps/z16/libmarkermod5.so: $(objpfx)libmarkermod5-5.so + $(make-target-directory) + cp $< $@ + ifeq (no,$(build-hardcoded-path-in-tests)) # This is an ld.so.cache test, and RPATH/RUNPATH in the executable diff --git a/sysdeps/s390/s390-64/dl-hwcap-check.h b/sysdeps/s390/s390-64/dl-hwcap-check.h index f769932325..efe204a3f3 100644 --- a/sysdeps/s390/s390-64/dl-hwcap-check.h +++ b/sysdeps/s390/s390-64/dl-hwcap-check.h @@ -26,7 +26,11 @@ static inline void dl_hwcap_check (void) { #if defined __ARCH__ -# if GCCMACRO__ARCH__ >= 13 +# if GCCMACRO__ARCH__ >= 14 + if (!(GLRO(dl_hwcap) & HWCAP_S390_VXRS_PDE2)) + _dl_fatal_printf ("\ +Fatal glibc error: CPU lacks VXRS_PDE2 support (z16 or later required)\n"); +# elif GCCMACRO__ARCH__ >= 13 if (!(GLRO(dl_hwcap) & HWCAP_S390_VXRS_EXT2)) _dl_fatal_printf ("\ Fatal glibc error: CPU lacks VXRS_EXT2 support (z15 or later required)\n"); diff --git a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c index 9447a6cf4e..39f4948152 100644 --- a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c +++ b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c @@ -19,8 +19,8 @@ #include #include -const char _dl_hwcaps_subdirs[] = "z15:z14:z13"; -enum { subdirs_count = 3 }; /* Number of components in _dl_hwcaps_subdirs. */ +const char _dl_hwcaps_subdirs[] = "z16:z15:z14:z13"; +enum { subdirs_count = 4 }; /* Number of components in _dl_hwcaps_subdirs. */ uint32_t _dl_hwcaps_subdirs_active (void) @@ -50,5 +50,12 @@ _dl_hwcaps_subdirs_active (void) return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active); ++active; + /* z16. + Note: We do not list HWCAP_S390_NNPA here as, according to the Principles of + Operation, those instructions may be replaced or removed in future. */ + if (!(GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE2)) + return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active); + ++active; + return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active); } diff --git a/sysdeps/s390/s390-64/tst-glibc-hwcaps.c b/sysdeps/s390/s390-64/tst-glibc-hwcaps.c index cf3b765b5d..d798e239c8 100644 --- a/sysdeps/s390/s390-64/tst-glibc-hwcaps.c +++ b/sysdeps/s390/s390-64/tst-glibc-hwcaps.c @@ -25,6 +25,7 @@ extern int marker2 (void); extern int marker3 (void); extern int marker4 (void); +extern int marker5 (void); /* Return the arch level, 10 for the baseline libmarkermod*.so's. */ static int @@ -63,9 +64,11 @@ compute_level (void) return 12; if (strcmp (platform, "z15") == 0) return 13; + if (strcmp (platform, "z16") == 0) + return 14; printf ("warning: unrecognized AT_PLATFORM value: %s\n", platform); /* Assume that the new platform supports z15. */ - return 13; + return 14; } static int @@ -76,6 +79,7 @@ do_test (void) TEST_COMPARE (marker2 (), MIN (level - 9, 2)); TEST_COMPARE (marker3 (), MIN (level - 9, 3)); TEST_COMPARE (marker4 (), MIN (level - 9, 4)); + TEST_COMPARE (marker5 (), MIN (level - 9, 5)); return 0; }