From nobody Thu Sep 18 06:58:18 2025 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 76EF1C4332F for ; Fri, 9 Dec 2022 14:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiLIOVK (ORCPT ); Fri, 9 Dec 2022 09:21:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiLIOUe (ORCPT ); Fri, 9 Dec 2022 09:20:34 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A885877229 for ; Fri, 9 Dec 2022 06:20:28 -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 2B9DSfuA015203; Fri, 9 Dec 2022 14:19: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 : mime-version : content-transfer-encoding; s=pp1; bh=KbtA/QSegqSd00MHD8ogZ8QdkXrcydGR1GzD64HyzoA=; b=rKnCob3AcYA4VWcr0jMEFhZBjo3GQX05PPSy1fDDAzVXXym1+aCCQFpHkVZZaRoJlfXn N5HMBfeBsMRJuCO2BrRDyGLi4jvrj0S0rhVIs9Ta9qNtp2VBZviZ+KGAq9gqd1/mBFYK GE1blpLWGTUQHCl0nzxTFf90CYC8TyLTvmV7OamtTM1Zry2eiqyMpKl8CoeSBRInTEg+ Zd4QsHFDgBLFh9LvGnTqbQDvwaIVHBz43HKIUL5HuaVFSNRY9RzISJMb78k9NGLKK5Fa o0MZWUPsqQ3JucQHaeba/45KFrFvxRLk1veXCDtLpLeCXiJQCW0miLxPhuhUfwEL6j1j cw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mc10qrfmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:59 +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 2B9E8jqQ007139; Fri, 9 Dec 2022 14:19:58 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 3mc10qrfm0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.16.1.2) with ESMTP id 2B98fPHI012203; Fri, 9 Dec 2022 14:19:56 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3m9pv9va2g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:56 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B9EJrRc35520970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Dec 2022 14:19:53 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9395320049; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 802F820043; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id 20AEEE04E0; Fri, 9 Dec 2022 15:19:53 +0100 (CET) From: Sven Schnelle To: Willy Tarreau , "Paul E . McKenney" , Josh Triplett Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] nolibc: fix fd_set type Date: Fri, 9 Dec 2022 15:19:35 +0100 Message-Id: <20221209141939.3634586-2-svens@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209141939.3634586-1-svens@linux.ibm.com> References: <20221209141939.3634586-1-svens@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 7Qyq2cx7bpOHLmLwr-KKXQehAwLiAXyF X-Proofpoint-ORIG-GUID: sH1rVFEgkYaza_Lyurx13okq7KQ7_Z39 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_08,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=815 spamscore=0 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090108 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The kernel uses unsigned long for the fd_set bitmap, but nolibc use u32. This works fine on little endian machines, but fails on big endian. Convert to unsigned long to fix this. Signed-off-by: Sven Schnelle Acked-by: Willy Tarreau --- tools/include/nolibc/types.h | 53 ++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h index 959997034e55..300e0ff1cd58 100644 --- a/tools/include/nolibc/types.h +++ b/tools/include/nolibc/types.h @@ -89,39 +89,46 @@ #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 =20 +#define FD_SETIDXMASK (8 * sizeof(unsigned long)) +#define FD_SETBITMASK (8 * sizeof(unsigned long)-1) + /* for select() */ typedef struct { - uint32_t fd32[(FD_SETSIZE + 31) / 32]; + unsigned long fds[(FD_SETSIZE + FD_SETBITMASK) / FD_SETIDXMASK]; } fd_set; =20 -#define FD_CLR(fd, set) do { \ - fd_set *__set =3D (set); \ - int __fd =3D (fd); \ - if (__fd >=3D 0) \ - __set->fd32[__fd / 32] &=3D ~(1U << (__fd & 31)); \ +#define FD_CLR(fd, set) do { \ + fd_set *__set =3D (set); \ + int __fd =3D (fd); \ + if (__fd >=3D 0) \ + __set->fds[__fd / FD_SETIDXMASK] &=3D \ + ~(1U << (__fd & FX_SETBITMASK)); \ } while (0) =20 -#define FD_SET(fd, set) do { \ - fd_set *__set =3D (set); \ - int __fd =3D (fd); \ - if (__fd >=3D 0) \ - __set->fd32[__fd / 32] |=3D 1U << (__fd & 31); \ +#define FD_SET(fd, set) do { \ + fd_set *__set =3D (set); \ + int __fd =3D (fd); \ + if (__fd >=3D 0) \ + __set->fds[__fd / FD_SETIDXMASK] |=3D \ + 1 << (__fd & FD_SETBITMASK); \ } while (0) =20 -#define FD_ISSET(fd, set) ({ = \ - fd_set *__set =3D (set); \ - int __fd =3D (fd); \ - int __r =3D 0; \ - if (__fd >=3D 0) \ - __r =3D !!(__set->fd32[__fd / 32] & 1U << (__fd & 31)); \ - __r; \ +#define FD_ISSET(fd, set) ({ \ + fd_set *__set =3D (set); \ + int __fd =3D (fd); \ + int __r =3D 0; \ + if (__fd >=3D 0) \ + __r =3D !!(__set->fds[__fd / FD_SETIDXMASK] & \ +1U << (__fd & FD_SET_BITMASK)); \ + __r; \ }) =20 -#define FD_ZERO(set) do { \ - fd_set *__set =3D (set); \ - int __idx; \ - for (__idx =3D 0; __idx < (FD_SETSIZE+31) / 32; __idx ++) \ - __set->fd32[__idx] =3D 0; \ +#define FD_ZERO(set) do { \ + fd_set *__set =3D (set); \ + int __idx; \ + int __size =3D (FD_SETSIZE+FD_SETBITMASK) / FD_SETIDXMASK;\ + for (__idx =3D 0; __idx < __size; __idx++) \ + __set->fds[__idx] =3D 0; \ } while (0) =20 /* for poll() */ --=20 2.34.1 From nobody Thu Sep 18 06:58:18 2025 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 0903AC4332F for ; Fri, 9 Dec 2022 14:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbiLIOVE (ORCPT ); Fri, 9 Dec 2022 09:21:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiLIOUd (ORCPT ); Fri, 9 Dec 2022 09:20:33 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E193413D06 for ; Fri, 9 Dec 2022 06:20:27 -0800 (PST) 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 2B9BmKiE018181; Fri, 9 Dec 2022 14:19: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=LkykSfD2VAhiIUO67DT4ELhWwncf8pBJcJay0JhVkzM=; b=UN1JhaK9C2YBTKT0afQu1Gx5uZBlrKd62HLiplyGUudgeeOUTguO5l+pX0wFX3zYvfKd OZYf9+eqt29E7FHxjhF4Z9CIaYZdo2j9ziMumHwDfnwv64ZWEjV998f6wZ5NDd5qoM5Y wPBZPTgDNmxjdmCv/C0SCOhgzcferJVMMxQaoEhLDEOvhFYlT2/YUAzkYBedYJpyV0yS wvFQBocN3uNWFU72BmCXHZRhcz/+qzXLnLuXItN2PZ+6UA9EvFXacbyqgNdo+tt54seb xXyKA5Ge9TsT2JFg9oV5DSj+9w34BlHXTvnXgf5PobXagJDidOz011hGUbUXucQ9PipB oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3mbuw96q7a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +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 2B9DBsNI016517; Fri, 9 Dec 2022 14:19:58 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 3mbuw96q6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:57 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.16.1.2) with ESMTP id 2B98drpe003168; Fri, 9 Dec 2022 14:19:56 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3m9m6y4f9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:56 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B9EJre246989728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Dec 2022 14:19:53 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E38C20040; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D1C62004B; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id 236F2E05A5; Fri, 9 Dec 2022 15:19:53 +0100 (CET) From: Sven Schnelle To: Willy Tarreau , "Paul E . McKenney" , Josh Triplett Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] nolibc: add support for s390 Date: Fri, 9 Dec 2022 15:19:36 +0100 Message-Id: <20221209141939.3634586-3-svens@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209141939.3634586-1-svens@linux.ibm.com> References: <20221209141939.3634586-1-svens@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mXMdv1i3nXVagTk67ABuzMgADFzC5BH8 X-Proofpoint-ORIG-GUID: r-8Usf_-yPH-rmYZPzkkzlQ3pOCrATWq Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_07,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 suspectscore=0 bulkscore=0 mlxscore=0 clxscore=1011 lowpriorityscore=0 adultscore=0 spamscore=0 mlxlogscore=428 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090108 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use arch-x86_64 as a template. Not really different, but we have our own mmap syscall which takes a structure instead of discrete arguments. Signed-off-by: Sven Schnelle Acked-by: Heiko Carstens Acked-by: Willy Tarreau --- tools/include/nolibc/arch-s390.h | 213 +++++++++++++++++++++++++++++++ tools/include/nolibc/arch.h | 2 + tools/include/nolibc/sys.h | 2 + 3 files changed, 217 insertions(+) create mode 100644 tools/include/nolibc/arch-s390.h diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s= 390.h new file mode 100644 index 000000000000..34b744e2f7d6 --- /dev/null +++ b/tools/include/nolibc/arch-s390.h @@ -0,0 +1,213 @@ +/* SPDX-License-Identifier: LGPL-2.1 OR MIT */ +/* + * s390 specific definitions for NOLIBC + */ + +#ifndef _NOLIBC_ARCH_S390_H +#define _NOLIBC_ARCH_S390_H +#include + +/* O_* macros for fcntl/open are architecture-specific */ +#define O_RDONLY 0 +#define O_WRONLY 1 +#define O_RDWR 2 +#define O_CREAT 0x40 +#define O_EXCL 0x80 +#define O_NOCTTY 0x100 +#define O_TRUNC 0x200 +#define O_APPEND 0x400 +#define O_NONBLOCK 0x800 +#define O_DIRECTORY 0x10000 + +/* The struct returned by the stat() syscall, equivalent to stat64(). The + * syscall returns 116 bytes and stops in the middle of __unused. + */ + +struct sys_stat_struct { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_nlink; + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int __pad1; + unsigned long st_rdev; + unsigned long st_size; + unsigned long st_atime; + unsigned long st_atime_nsec; + unsigned long st_mtime; + unsigned long st_mtime_nsec; + unsigned long st_ctime; + unsigned long st_ctime_nsec; + unsigned long st_blksize; + long st_blocks; + unsigned long __unused[3]; +}; + +/* Syscalls for s390: + * - registers are 64-bit + * - syscall number is passed in r1 + * - arguments are in r2-r7 + * - the system call is performed by calling the svc instruction + * - syscall return value is in r2 + * - r1 and r2 are clobbered, others are preserved. + * + * Link s390 ABI: https://github.com/IBM/s390x-abi + * + */ + +#define my_syscall0(num) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _rc __asm__ ("2"); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "=3Dd"(_rc) \ + : "d"(_num) \ + : "memory", "cc" \ + ); \ + _rc; \ +}) + +#define my_syscall1(num, arg1) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +#define my_syscall2(num, arg1, arg2) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + register long _arg2 __asm__ ("3") =3D (long)(arg2); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_arg2), "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +#define my_syscall3(num, arg1, arg2, arg3) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + register long _arg2 __asm__ ("3") =3D (long)(arg2); \ + register long _arg3 __asm__ ("4") =3D (long)(arg3); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_arg2), "d"(_arg3), "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +#define my_syscall4(num, arg1, arg2, arg3, arg4) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + register long _arg2 __asm__ ("3") =3D (long)(arg2); \ + register long _arg3 __asm__ ("4") =3D (long)(arg3); \ + register long _arg4 __asm__ ("5") =3D (long)(arg4); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +#define my_syscall5(num, arg1, arg2, arg3, arg4, arg5) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + register long _arg2 __asm__ ("3") =3D (long)(arg2); \ + register long _arg3 __asm__ ("4") =3D (long)(arg3); \ + register long _arg4 __asm__ ("5") =3D (long)(arg4); \ + register long _arg5 __asm__ ("6") =3D (long)(arg5); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5), \ + "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +#define my_syscall6(num, arg1, arg2, arg3, arg4, arg5, arg6) \ +({ \ + register long _num __asm__ ("1") =3D (num); \ + register long _arg1 __asm__ ("2") =3D (long)(arg1); \ + register long _arg2 __asm__ ("3") =3D (long)(arg2); \ + register long _arg3 __asm__ ("4") =3D (long)(arg3); \ + register long _arg4 __asm__ ("5") =3D (long)(arg4); \ + register long _arg5 __asm__ ("6") =3D (long)(arg5); \ + register long _arg6 __asm__ ("7") =3D (long)(arg6); \ + \ + __asm__ volatile ( \ + "svc 0\n" \ + : "+d"(_arg1) \ + : "d"(_arg2), "d"(_arg3), "d"(_arg4), "d"(_arg5), \ + "d"(_arg6), "d"(_num) \ + : "memory", "cc" \ + ); \ + _arg1; \ +}) + +/* startup code */ +__asm__ (".section .text\n" + ".weak _start\n" + "_start:\n" + "lg %r2,0(%r15)\n" /* argument count */ + "la %r3,8(%r15)\n" /* argument pointers */ + "la %r4,24(%r15)\n" /* environment pointers */ + "lay %r15,-160(%r15)\n" /* allocate new stackframe */ + "xc 0(8,%r15),0(%r15)\n" /* clear backchain */ + "brasl %r14,main\n" /* ret value of main is arg to exit */ + "lghi %r1,1\n" /* __NR_exit */ + "svc 0\n" + ""); + +struct s390_mmap_arg_struct { + unsigned long addr; + unsigned long len; + unsigned long prot; + unsigned long flags; + unsigned long fd; + unsigned long offset; +}; + +static __maybe_unused +void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd, + off_t offset) +{ + struct s390_mmap_arg_struct args =3D { + .addr =3D (unsigned long)addr, + .len =3D (unsigned long)length, + .prot =3D prot, + .flags =3D flags, + .fd =3D fd, + .offset =3D (unsigned long)offset + }; + + return (void *)my_syscall1(__NR_mmap, &args); +} +#define sys_mmap sys_mmap +#endif // _NOLIBC_ARCH_S390_H diff --git a/tools/include/nolibc/arch.h b/tools/include/nolibc/arch.h index 4c6992321b0d..fcded65b98d7 100644 --- a/tools/include/nolibc/arch.h +++ b/tools/include/nolibc/arch.h @@ -27,6 +27,8 @@ #include "arch-mips.h" #elif defined(__riscv) #include "arch-riscv.h" +#elif defined(__s390x__) +#include "arch-s390x.h" #endif =20 #endif /* _NOLIBC_ARCH_H */ diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index ce3ee03aa679..3db1dd8c74ee 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -686,6 +686,7 @@ int mknod(const char *path, mode_t mode, dev_t dev) #define MAP_FAILED ((void *)-1) #endif =20 +#ifndef sys_mmap static __attribute__((unused)) void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) @@ -707,6 +708,7 @@ void *sys_mmap(void *addr, size_t length, int prot, int= flags, int fd, return (void *)my_syscall6(n, addr, length, prot, flags, fd, offset); #endif } +#endif =20 static __attribute__((unused)) void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t o= ffset) --=20 2.34.1 From nobody Thu Sep 18 06:58:18 2025 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 2C097C4332F for ; Fri, 9 Dec 2022 14:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbiLIOU7 (ORCPT ); Fri, 9 Dec 2022 09:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiLIOUd (ORCPT ); Fri, 9 Dec 2022 09:20:33 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D4C64D0 for ; Fri, 9 Dec 2022 06:20:27 -0800 (PST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B9CFHoG013025; Fri, 9 Dec 2022 14:19: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 : mime-version : content-transfer-encoding; s=pp1; bh=NLY2nk/RTgGLXwvWYxIyqfEOsN9qmXgBPV44+fr+u84=; b=UO+rIbBRFCOXdDPGYAWjz/40ZNYRnk51boKZ0xs5uiAlDee6oOZtbL8kQA+IyDGvQrIp m4x5kd6wWr5bd4Km9jQ/2OoeL4Cm0eg6+HNYm5pVv60CLzFY5Fa1kuT8o4uCsMOs1gAT PC0BqNJXK49sBT2PUbWcSaeAWZGtr6CbcRr++mn4j6XAQWb0E2WVAG5N+FwCOH8S123M cIxfVCZS2ojG5uyuJYPfNE00wayswj53h7pueKTMFjwkx/Gfya669yZVhEOjaHoYY1Mg nzR7vR0AYRVHQuG3cJhBt2tf4BiRjG/x3a9Yxwcdie+0XQHByPRKi6gTre1ivpQRRX7t gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mbh9cpjvx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:59 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2B9E717C029129; Fri, 9 Dec 2022 14:19:58 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mbh9cpjv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.16.1.2) with ESMTP id 2B98nSr2004304; Fri, 9 Dec 2022 14:19:56 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3m9m6y4f9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:56 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B9EJrFv35520968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Dec 2022 14:19:53 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70E7E2004D; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 602E920040; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id 25F7DE0614; Fri, 9 Dec 2022 15:19:53 +0100 (CET) From: Sven Schnelle To: Willy Tarreau , "Paul E . McKenney" , Josh Triplett Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] selftests/nolibc: add s390 support Date: Fri, 9 Dec 2022 15:19:37 +0100 Message-Id: <20221209141939.3634586-4-svens@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209141939.3634586-1-svens@linux.ibm.com> References: <20221209141939.3634586-1-svens@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: afVARQSgN9iijJur3VT0nw-G8teCnm7p X-Proofpoint-GUID: 0mHqzOLAkqv3ut9rNcvLu1BR2vNxeBdZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_08,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 adultscore=0 impostorscore=0 clxscore=1015 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090108 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Signed-off-by: Sven Schnelle Acked-by: Heiko Carstens Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selfte= sts/nolibc/Makefile index 69ea659caca9..92d8276bc226 100644 --- a/tools/testing/selftests/nolibc/Makefile +++ b/tools/testing/selftests/nolibc/Makefile @@ -19,6 +19,7 @@ IMAGE_arm64 =3D arch/arm64/boot/Image IMAGE_arm =3D arch/arm/boot/zImage IMAGE_mips =3D vmlinuz IMAGE_riscv =3D arch/riscv/boot/Image +IMAGE_s390 =3D arch/s390/boot/bzImage IMAGE =3D $(IMAGE_$(ARCH)) IMAGE_NAME =3D $(notdir $(IMAGE)) =20 @@ -29,6 +30,7 @@ DEFCONFIG_arm64 =3D defconfig DEFCONFIG_arm =3D multi_v7_defconfig DEFCONFIG_mips =3D malta_defconfig DEFCONFIG_riscv =3D defconfig +DEFCONFIG_s390 =3D defconfig DEFCONFIG =3D $(DEFCONFIG_$(ARCH)) =20 # optional tests to run (default =3D all) @@ -41,6 +43,7 @@ QEMU_ARCH_arm64 =3D aarch64 QEMU_ARCH_arm =3D arm QEMU_ARCH_mips =3D mipsel # works with malta_defconfig QEMU_ARCH_riscv =3D riscv64 +QEMU_ARCH_s390 =3D s390x QEMU_ARCH =3D $(QEMU_ARCH_$(ARCH)) =20 # QEMU_ARGS : some arch-specific args to pass to qemu @@ -50,6 +53,7 @@ QEMU_ARGS_arm64 =3D -M virt -cpu cortex-a53 -append "pa= nic=3D-1 $(TEST:%=3DNOLIBC_TE QEMU_ARGS_arm =3D -M virt -append "panic=3D-1 $(TEST:%=3DNOLIBC_TEST= =3D%)" QEMU_ARGS_mips =3D -M malta -append "panic=3D-1 $(TEST:%=3DNOLIBC_TEST= =3D%)" QEMU_ARGS_riscv =3D -M virt -append "console=3DttyS0 panic=3D-1 $(TEST:%= =3DNOLIBC_TEST=3D%)" +QEMU_ARGS_s390 =3D -M s390-ccw-virtio -m 1G -append "console=3DttyS0 pa= nic=3D-1 $(TEST:%=3DNOLIBC_TEST=3D%)" QEMU_ARGS =3D $(QEMU_ARGS_$(ARCH)) =20 # OUTPUT is only set when run from the main makefile, otherwise --=20 2.34.1 From nobody Thu Sep 18 06:58:18 2025 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 43973C4332F for ; Fri, 9 Dec 2022 14:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbiLIOVQ (ORCPT ); Fri, 9 Dec 2022 09:21:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiLIOUf (ORCPT ); Fri, 9 Dec 2022 09:20:35 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2894712090 for ; Fri, 9 Dec 2022 06:20:29 -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 2B9Dn4N4023341; Fri, 9 Dec 2022 14:19:58 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=3s0sKuYQYSrxGa9epdS6MVxcS8fJENNzbKxhMU2MFhk=; b=Q9HOSLtFbNDYquy2ZvKgtZ/KGRAo2DL6e+28Gf/QCEHEk1SvfVf1ozKNf+OunLWcgr+P sxCxAaKvO1QKV99n4NoV1SWkCKV9SnG34n3vxHa9ufxgwwXAlQy7jDRjVWY9lTSb5Tgh ocz8r8q0dWVDRg/IBjFZSyRKnv++cFMbCO6qafiAiLlaCZYch/6yXXheGHuG4UzOEUpY t8BucLMl0vQK8PXYTmD07B2QQGtnk1AQsFc6noVCnCEH2VLMTJIz27gmeidljJn6LJKx OQ2ufxThWuckozsorQvayiIvHyL1BOmWtIOb7MBW7cuZ5f54pRn6mTPgnlP23Y+sMcJH Ag== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mbxfdktd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +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 2B9EAXCS009266; Fri, 9 Dec 2022 14:19:58 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 3mbxfdktcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +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 2B99Ii9Q022504; Fri, 9 Dec 2022 14:19:56 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3m9kur4eq7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:56 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B9EJrbU44302816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Dec 2022 14:19:53 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DB7F20049; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6CDAA2004B; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id 288E9E06EB; Fri, 9 Dec 2022 15:19:53 +0100 (CET) From: Sven Schnelle To: Willy Tarreau , "Paul E . McKenney" , Josh Triplett Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] rcutorture: add support for s390 Date: Fri, 9 Dec 2022 15:19:38 +0100 Message-Id: <20221209141939.3634586-5-svens@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209141939.3634586-1-svens@linux.ibm.com> References: <20221209141939.3634586-1-svens@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: PtbRnuS8AgHSLKLf5mbL2hH7IpliXBVV X-Proofpoint-ORIG-GUID: d7YUM2uHTWIJsyuWehRxjNhNj4r9-zIj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_07,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 impostorscore=0 suspectscore=0 mlxlogscore=798 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090108 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add the required values to identify_qemu() and identify_bootimage(). Signed-off-by: Sven Schnelle Acked-by: Heiko Carstens --- tools/testing/selftests/rcutorture/bin/functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/te= sting/selftests/rcutorture/bin/functions.sh index 66d0414d8e4b..b52d5069563c 100644 --- a/tools/testing/selftests/rcutorture/bin/functions.sh +++ b/tools/testing/selftests/rcutorture/bin/functions.sh @@ -159,6 +159,9 @@ identify_boot_image () { qemu-system-aarch64) echo arch/arm64/boot/Image ;; + qemu-system-s390x) + echo arch/s390/boot/bzImage + ;; *) echo vmlinux ;; @@ -184,6 +187,9 @@ identify_qemu () { elif echo $u | grep -q aarch64 then echo qemu-system-aarch64 + elif echo $u | grep -q 'IBM S/390' + then + echo qemu-system-s390x elif uname -a | grep -q ppc64 then echo qemu-system-ppc64 --=20 2.34.1 From nobody Thu Sep 18 06:58:18 2025 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 8FCB9C4332F for ; Fri, 9 Dec 2022 14:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbiLIOVN (ORCPT ); Fri, 9 Dec 2022 09:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiLIOUe (ORCPT ); Fri, 9 Dec 2022 09:20:34 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773FF6274 for ; Fri, 9 Dec 2022 06:20:28 -0800 (PST) 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 2B9DdSLD003705; Fri, 9 Dec 2022 14:20:00 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=BIIiIarhrMjfZ53epwzctaykif7mltHYkilT75A5OPY=; b=Li/HoyK/JLvLLAhtavsDzOtlrr2MZqLRAiM2ORUMNZc2egwH0dk9rhSvv+i94vWDTCXW 4zzpvBAl3C2UNZHQNn/xtLJmjR/9Px4NfJzdJXdb11ytwWG3JobenutWUsHXCJ4ZnWhM yPnnF3NuaCJynvqgzeKamGf/ZyCXgjQhVJ8fV/XXj7btLImLZ+WUX/f+xAtC+kE4wzC4 k9u8dBTFZRNR7StVX4cb6/nG+iwrYlqZgsxBxnbC0Yse8HhqxtMDrfI2HvfN+D6jiEUv sBB7RyFnsY5L470caJ6hmBbF37Gzap4C81QdnhIvevPRLHLFkDwwAwtUgskkcGIR/OJC CA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mbxakkw48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:59 +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 2B9EBeFq029267; Fri, 9 Dec 2022 14:19:58 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 3mbxakkw3k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:58 +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 2B99Ii9R022504; Fri, 9 Dec 2022 14:19:56 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3m9kur4eq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Dec 2022 14:19:56 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B9EJrKU45482412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Dec 2022 14:19:53 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B0A192004B; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FA622004E; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Fri, 9 Dec 2022 14:19:53 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 55390) id 2B29EE0732; Fri, 9 Dec 2022 15:19:53 +0100 (CET) From: Sven Schnelle To: Willy Tarreau , "Paul E . McKenney" , Josh Triplett Cc: Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] rcutorture: build initrd for rcutorture with nolibc Date: Fri, 9 Dec 2022 15:19:39 +0100 Message-Id: <20221209141939.3634586-6-svens@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209141939.3634586-1-svens@linux.ibm.com> References: <20221209141939.3634586-1-svens@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Dx3uCqbfEn9HPhla7508HsCkyytWbnGE X-Proofpoint-ORIG-GUID: npxYvDsgI4Y4SwcBGnM_2_uEo9Jsq2oL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_07,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090108 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This reduces the size of init from ~600KB to ~1KB. Signed-off-by: Sven Schnelle Acked-by: Heiko Carstens --- tools/testing/selftests/rcutorture/bin/mkinitrd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh b/tools/tes= ting/selftests/rcutorture/bin/mkinitrd.sh index 70d62fd0d31d..71f0dfbb2a6d 100755 --- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh +++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh @@ -64,7 +64,7 @@ ___EOF___ # build using nolibc on supported archs (smaller executable) and fall # back to regular glibc on other ones. if echo -e "#if __x86_64__||__i386__||__i486__||__i586__||__i686__" \ - "||__ARM_EABI__||__aarch64__\nyes\n#endif" \ + "||__ARM_EABI__||__aarch64__||__s390x__\nyes\n#endif" \ | ${CROSS_COMPILE}gcc -E -nostdlib -xc - \ | grep -q '^yes'; then # architecture supported by nolibc --=20 2.34.1