From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A76C31F461 for ; Thu, 16 May 2019 08:00:02 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type :content-transfer-encoding; q=dns; s=default; b=JSVX/e9hNoK3A8i1 Uu434/bNAanNhiUwjdoa4UbuwIzfUmm4qsw9LNFCpfoShXhe/Y40lbW0sPPT7PoR 4xxvij5KL2XPJPVC5RRF65d9q2S6xYsJ+BXuwcIZ800yUaj6bc1/t2H2w5/Q+Qke bdIRPYLFBiecC0hU3A6yACEq1PU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type :content-transfer-encoding; s=default; bh=PYggGhGn+H7wYnKmMj2gds fwpuo=; b=HupqprCncyADv09c6Ojx2rMUjbYJgy9Mj4N6jFk6mO1q8IYTKJ5iaw qQzMZoG/kKOHX1FDSHoF2uppx7Oa9zuThSAE3J+RvdozH91W/bNkVzdqh+83wbhr JK5LjEv9Kt7lhNTUQjgtcYWIclPiaUNASfRijSsFa29d468tghVoU= Received: (qmail 41769 invoked by alias); 16 May 2019 07:59:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 41761 invoked by uid 89); 16 May 2019 07:59:59 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qk1-f193.google.com MIME-Version: 1.0 References: <20190510102713.udgjb6ilygibgd5x@sghpc.golosunov.pp.ru> <20190510131938.fonlmcf3mzs6qypr@sghpc.golosunov.pp.ru> In-Reply-To: <20190510131938.fonlmcf3mzs6qypr@sghpc.golosunov.pp.ru> From: Arnd Bergmann Date: Thu, 16 May 2019 09:59:40 +0200 Message-ID: Subject: Re: Update kernel-features.h files for Linux 5.1 To: Stepan Golosunov Cc: Joseph Myers , GNU C Library Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 10, 2019 at 3:19 PM Stepan Golosunov w= rote: > > 10.05.2019 =D0=B2 14:27:13 +0400 Stepan Golosunov =D0=BD=D0=B0=D0=BF=D0= =B8=D1=81=D0=B0=D0=BB(=D0=B0): > > 09.05.2019 =D0=B2 23:00:37 +0000 Joseph Myers =D0=BD=D0=B0=D0=BF=D0=B8= =D1=81=D0=B0=D0=BB: > > > Linux 5.1 adds missing syscalls to the syscall table for many Linux > > > kernel architectures. This patch updates the kernel-features.h > > > headers accordingly. I believe the statfs64 structure used by alpha > > > matches what the new kernel syscalls use, but that should be reviewed > > > carefully. > > > > > > Tested with build-many-glibcs.py. > > > > The newly added direct ipc syscalls are different from the old ones: > > > > 1. They do not accept IPC_64. This means that __IPC_64 should be set > > to zero when new syscalls are used. And new syscalls can not be used > > for compat functions like __old_semctl. Correct, the idea is that we can stop passing that flag on most architectur= es when a C library only supports new kernels. I expect that glibc will start using the direct system calls in 5 to 10 yea= rs, once it stops running on linux-5.0 and earlier. Until then, the easiest way is to keep using the ipc() wrapper. > > (Hmm. Is __old_msgctl already buggy due to its use of __IPC_64 when > > __ASSUME_DIRECT_SYSVIPC_SYSCALLS is defined? Is there any > > architecture with both __ASSUME_DIRECT_SYSVIPC_SYSCALLS and > > __old_msgctl currently?) My spreadsheet [1] tells me that mips-n32, mips-n64, alpha, arm, microblaze and xtensa all provide the direct syscalls traditionally but require passin= g __IPC_64 for historic reasons. Out of these, only arm-oabi (no longer suppo= rted in glibc) also has sys_ipc(). It would have been nice to change that, but it seemed not worth adding anot= her set of IPC syscalls for these. > > 2. semtimedop does not exist on 32-bit ABIs. They have > > semtimedop_time64 instead. Right, we had a long debate over that, and in the end I decided not to add two versions of semtimedop() to keep the ABI more compact. > > (I also think that ipc with IPCOP_semtimedop was accidentally made to > > behave like semtimedop_time64 in 32-bit builds of linux 5.1. But that > > would be a kernel bug.) Can you elaborate? The code I see in mainline is case SEMTIMEDOP: if (IS_ENABLED(CONFIG_64BIT) || !IS_ENABLED(CONFIG_64BIT_TI= ME)) return ksys_semtimedop(first, ptr, second, (const struct __kernel_timespec __user *)fi= fth); else if (IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) return compat_ksys_semtimedop(first, ptr, second, (const struct old_timespec32 __user *)fifth= ); else return -ENOSYS; Since both CONFIG_64BIT_TIME and CONFIG_COMPAT_32BIT_TIME are always set on 32-bit architectures, SEMTIMEDOP passes an old_timespec32 argument here. Am I missing something? > And, after rereading > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /?id=3D0d6040d4681735dfc47565de288525de405a5c99 > > 3. There is no semop. semtimedop(_time64)? should be used instead. Right. Arnd [1] https://docs.google.com/spreadsheets/d/1QxMvW5jpVG2jb4RM9CQQl27-wVpNYOa= -_3K2RVKifb0/edit#gid=3D0