From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 67948383B6F7 for ; Tue, 6 Dec 2022 16:23:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 67948383B6F7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670343837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5zby/J+fkgyE2EsVbtTkyzLdfw7aKTRZ1rlRtdkDW1M=; b=NSNd5OsITDOX6PMw1Z3Pwv/UB+eIdpGVSMqNVco2hL30ypJDtmmH/0+bPN8DS4som6iBKU 7QKbBMulWZkiZg5a6boCFTVYyRXY02ZGLQPp1t4ogYFXHB3ANSKIW1EFq0KLztUGS0BA2r pN7M9Y+JQ8T8v2RSzxeFQnb3wVN+KeA= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-176-wuEJuD99OJKBXHA2b6hzGg-1; Tue, 06 Dec 2022 11:23:51 -0500 X-MC-Unique: wuEJuD99OJKBXHA2b6hzGg-1 Received: by mail-il1-f197.google.com with SMTP id x9-20020a056e021ca900b003037ca1af0cso582818ill.16 for ; Tue, 06 Dec 2022 08:23:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5zby/J+fkgyE2EsVbtTkyzLdfw7aKTRZ1rlRtdkDW1M=; b=5W7G3Pt4QLEFCqTFTwUww3/JLN7AMaSxfw3Vx9EcJo2r3uYwTAmNFoXtgCRM4DuLP4 uyWUYPbUi+tQ/1AfpSq7nsUrg/nwuZNXolOcuoosLxQ/psawoGIYvWy07Voj4wtKYG3P KQZjTRmw3/H6bkNAU39g7lyvJ+KiQhbR8NhsJ4UAPm9Drn4cCEdIsdA9QPZgbmfHB+BL TjjsNp/nA3nBAvtewsuA211qJjch7u99wIT0Fne5KI5R9cmr6bu8iqihltvCc9iMEhdj su+Y1BpEQho9NFLtfp45kJ1fEjfEdbDGH9qk3cO5Fva5GU/IbolctybeuHXKuJUQWHV8 wWcg== X-Gm-Message-State: ANoB5plZkpw5cKSiqkGTYV71tsTeymEdCj0WM0h9uGiZg4GkKIiYeMLC fUvEEuSvBs256tQu46aOarf3BHPGUMV/aTt70/cJmhjl6rq51cNDk0E98C+magwlJ6grDyNJYBH FefaLngO20WqB5WBKUabO X-Received: by 2002:a05:6638:418f:b0:387:9f70:be42 with SMTP id az15-20020a056638418f00b003879f70be42mr27204018jab.295.1670343830133; Tue, 06 Dec 2022 08:23:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fSnVN+ZXbEMgCdE/EfPx6twbViGBaeXx8X6FJPUZRQ7X7UkQ/78sWSirkTpIZEn1ADSOjQw== X-Received: by 2002:a05:6638:418f:b0:387:9f70:be42 with SMTP id az15-20020a056638418f00b003879f70be42mr27204013jab.295.1670343829898; Tue, 06 Dec 2022 08:23:49 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id h26-20020a056e021d9a00b0030347a87f16sm3775262ila.1.2022.12.06.08.23.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 08:23:49 -0800 (PST) Message-ID: <8db12f40-6dc7-0e6a-aa68-6d19e435b3e5@redhat.com> Date: Tue, 6 Dec 2022 11:23:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 24/30] Linux: Assume and consolidate shutdown wire-up syscall To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-25-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221019221433.1082017-25-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > And disable if kernel does not support it. > > Checked on x86_64-linux-gnu and i686-linux-gnu. LGTM. No regressions on x86_64 and i686. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > sysdeps/unix/sysv/linux/generic/syscalls.list | 4 ---- > sysdeps/unix/sysv/linux/i386/kernel-features.h | 7 ++----- > sysdeps/unix/sysv/linux/kernel-features.h | 1 + > sysdeps/unix/sysv/linux/m68k/kernel-features.h | 7 ++----- > sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 - > sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - > sysdeps/unix/sysv/linux/s390/kernel-features.h | 7 ++----- > sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - > sysdeps/unix/sysv/linux/shutdown.c | 7 +------ > sysdeps/unix/sysv/linux/sparc/kernel-features.h | 2 -- > 10 files changed, 8 insertions(+), 30 deletions(-) > delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list > > diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list > deleted file mode 100644 > index b000ca3c7c..0000000000 > --- a/sysdeps/unix/sysv/linux/generic/syscalls.list > +++ /dev/null > @@ -1,4 +0,0 @@ > -# File name Caller Syscall name # args Strong name Weak names > - > -# Socket APIs > -shutdown - shutdown i:ii __shutdown shutdown OK. Remove shutdown syscall wrapper and removes last entry in syscalls.list. > diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h > index 423edc9017..e726fc657a 100644 > --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h > @@ -17,15 +17,11 @@ > License along with the GNU C Library; if not, see > . */ > > -/* Direct socketcalls available with kernel 4.3. */ > -#if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_SHUTDOWN_SYSCALL 1 > -#endif > - OK. > #include_next > > #undef __ASSUME_ACCEPT_SYSCALL > > +/* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION < 0x040300 > # undef __ASSUME_ACCEPT4_SYSCALL > # undef __ASSUME_SENDMSG_SYSCALL > @@ -41,6 +37,7 @@ > # undef __ASSUME_LISTEN_SYSCALL > # undef __ASSUME_GETSOCKNAME_SYSCALL > # undef __ASSUME_GETPEERNAME_SYSCALL > +# undef __ASSUME_SHUTDOWN_SYSCALL > #endif > > /* i686 only supports ipc syscall before 5.1. */ > diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h > index c751530cd3..23586c88d3 100644 > --- a/sysdeps/unix/sysv/linux/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/kernel-features.h > @@ -85,6 +85,7 @@ > #define __ASSUME_LISTEN_SYSCALL 1 > #define __ASSUME_GETSOCKNAME_SYSCALL 1 > #define __ASSUME_GETPEERNAME_SYSCALL 1 > +#define __ASSUME_SHUTDOWN_SYSCALL 1 > > /* Support for SysV IPC through wired syscalls. All supported architectures > either support ipc syscall and/or all the ipc correspondent syscalls. */ > diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h > index a7b3458a21..1ad1193afb 100644 > --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h > @@ -17,15 +17,11 @@ > License along with the GNU C Library. If not, see > . */ > > -/* Direct socketcalls available with kernel 4.3. */ > -#if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_SHUTDOWN_SYSCALL 1 > -#endif > - > #include_next > > #undef __ASSUME_ACCEPT_SYSCALL > > +/* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION < 0x040300 > # undef __ASSUME_ACCEPT4_SYSCALL > # undef __ASSUME_RECVMMSG_SYSCALL > @@ -43,6 +39,7 @@ > # undef __ASSUME_LISTEN_SYSCALL > # undef __ASSUME_GETSOCKNAME_SYSCALL > # undef __ASSUME_GETPEERNAME_SYSCALL > +# undef __ASSUME_SHUTDOWN_SYSCALL > #endif > > /* No support for PI futexes or robust mutexes before 3.10 for m68k. */ > diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h > index 328529434d..72496aa922 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h > @@ -21,7 +21,6 @@ > #define __ASSUME_CONNECT_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 > -#define __ASSUME_SHUTDOWN_SYSCALL 1 > > #include_next > > diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > index 7fae7ca429..e2dc7a15a3 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h > @@ -21,7 +21,6 @@ > #define __ASSUME_CONNECT_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 > -#define __ASSUME_SHUTDOWN_SYSCALL 1 > > /* Define this if your 32-bit syscall API requires 64-bit register > pairs to start with an even-number register. */ > diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h > index e797b71052..b39e4736b3 100644 > --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h > @@ -17,15 +17,11 @@ > License along with the GNU C Library; if not, see > . */ > > -/* Direct socketcalls available with kernel 4.3. */ > -#if __LINUX_KERNEL_VERSION >= 0x040300 > -# define __ASSUME_SHUTDOWN_SYSCALL 1 > -#endif > - > #include_next > > #undef __ASSUME_ACCEPT_SYSCALL > > +/* Direct socketcalls available with kernel 4.3. */ > #if __LINUX_KERNEL_VERSION < 0x040300 > # undef __ASSUME_ACCEPT4_SYSCALL > # undef __ASSUME_RECVMMSG_SYSCALL > @@ -43,6 +39,7 @@ > # undef __ASSUME_LISTEN_SYSCALL > # undef __ASSUME_GETSOCKNAME_SYSCALL > # undef __ASSUME_GETPEERNAME_SYSCALL > +# undef __ASSUME_SHUTDOWN_SYSCALL > #endif > > /* s390 only supports ipc syscall before 5.1. */ > diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h > index 3a0b4e6198..ae1387e7d7 100644 > --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h > @@ -26,7 +26,6 @@ > #define __ASSUME_CONNECT_SYSCALL 1 > #define __ASSUME_SEND_SYSCALL 1 > #define __ASSUME_RECV_SYSCALL 1 > -#define __ASSUME_SHUTDOWN_SYSCALL 1 > > #include_next > > diff --git a/sysdeps/unix/sysv/linux/shutdown.c b/sysdeps/unix/sysv/linux/shutdown.c > index 26772c9b28..4cee357b9b 100644 > --- a/sysdeps/unix/sysv/linux/shutdown.c > +++ b/sysdeps/unix/sysv/linux/shutdown.c > @@ -15,19 +15,14 @@ > License along with the GNU C Library; if not, see > . */ > > -#include > -#include > #include > - > #include > -#include > -#include > > int > __shutdown (int fd, int how) > { > #ifdef __ASSUME_SHUTDOWN_SYSCALL > - return INLINE_SYSCALL (shutdown, 2, fd, how); > + return INLINE_SYSCALL_CALL (shutdown, fd, how); OK. > #else > return SOCKETCALL (shutdown, fd, how); > #endif > diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h > index 7070aaa1ae..12e98a9f95 100644 > --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h > +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h > @@ -40,8 +40,6 @@ > # undef __ASSUME_SENDTO_SYSCALL > # undef __ASSUME_GETSOCKOPT_SYSCALL > # undef __ASSUME_SETSOCKOPT_SYSCALL > -#else > -# define __ASSUME_SHUTDOWN_SYSCALL 1 > #endif > > /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ -- Cheers, Carlos.