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=-2.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MIME_CHARSET_FARAWAY,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 38CC31F45F for ; Fri, 10 May 2019 16:40:28 +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:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=hjSBGQVE2316Jx3S m8GFJw5TWpJ8wyjNT0pl1SN0vZxMFqJGYtiVnmbg/oKFZBmybQNABDpGepjNDP9v D/9kcdSblZMrnYpQAKuOXtM5odsIVjegbSK5+Ti/Zvd41cLKZFNPW76B5cjlrHGy /pViNNk+sW3Ots6fK6ROfLE1elE= 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:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=SwPGhlWh6cPBgx0ZgeYr+T CYL5Q=; b=LJiwvR5b7wZODs3Eqe7UAkv7zhL8wmDodxoT4VhqNYY+eT57hLo517 B2RHdISiNbYOQGRH8sTa8rm6KzDrvmZ959/6cla8ioY+6T02xi3ibsXtoM1d03/v oQWDhi78RcGvsm3SjmIBwL0/OuB7lnDS3zUcw4eydi2WcCO45CIgA= Received: (qmail 10093 invoked by alias); 10 May 2019 16:40:26 -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 10077 invoked by uid 89); 10 May 2019 16:40:25 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-ua1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Df3bat/abZTkDQnkNNXlsD7WRiG2ZJKo4BRhy8LuUBQ=; b=e0SzJn6346d3aRLkIsXG8vr9Xh6S0girpi6rBiu9FmI3GYN4tNkKH4dExJvFz1puul vJHvbtT7tOrjdyd/B2bPpjIBZ1eimscF9pQERJ4QSS/CUZFBChqiMbuJ9QYx59B5o8ng TxXHNubJaDkkjCQhgbR3iDNpdQFPxNejFy5wXTTqYbdCs0v9C4RjR5bKJCLFvzpzR5Ug F6OD6umBDS1WSQIXO+DxLBi2LBgUiihDRpxc/EH1qt5Fz5yr67U6o3T9W9hgpCuS8rV9 KG0PBgca6nHOZ0ACeRc0R1D18YSatWRaNrCFdVwef+u9eHahJ9QfqMvbdtx9CFsxpNdt /D+g== Subject: Re: Update kernel-features.h files for Linux 5.1 To: Stepan Golosunov Cc: libc-alpha@sourceware.org References: <20190510102713.udgjb6ilygibgd5x@sghpc.golosunov.pp.ru> <77b2e1fd-7f91-5de3-6e33-e72f00f93544@linaro.org> <20190510161524.vlsox333fwqgwg35@sghpc.golosunov.pp.ru> From: Adhemerval Zanella Openpgp: preference=signencrypt Message-ID: <132d0cbd-e9c5-186a-d011-87b61936a166@linaro.org> Date: Fri, 10 May 2019 13:40:19 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190510161524.vlsox333fwqgwg35@sghpc.golosunov.pp.ru> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit On 10/05/2019 13:15, Stepan Golosunov wrote: > 10.05.2019 Χ 12:11:22 -0300 Adhemerval Zanella ΞΑΠΙΣΑΜ: >> On 10/05/2019 12:07, Adhemerval Zanella wrote: >>> On 10/05/2019 07:27, Stepan Golosunov wrote: >>>> 09.05.2019 Χ 23:00:37 +0000 Joseph Myers ΞΑΠΙΣΑΜ: >>>>> 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. >>> >>> So it seems we will need to conditionally set __IPC_64 based on kernel >>> version. It also seems that our default value on generic ipc_priv.h >>> is not really expressing the kernel ABI. >>> >>>> >>>> (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?) >>> >>> The architectures that exports msgctl@GLIBC_2.0 as compat symbol are >>> alpha, i686, m68k, mips-o32, powerpc32, s390-32, and sparc32. And >>> from these one alpha currently is the only architecture that defines >>> __ASSUME_DIRECT_SYSVIPC_SYSCALLS. So it is buggy for alpha currently >>> and it would be for the aforementioned architectures once they >>> start to use wire-up syscall. >>> >>> >>>> >>>> 2. semtimedop does not exist on 32-bit ABIs. They have >>>> semtimedop_time64 instead. >>>> (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.) >>> >>> So it seems we would need to either add an __ASSUME specific for semtimedop >>> to just enable wire-up calls if time64 is defined or add another pre-processor >>> check to see if __NR_semtimeop is defined as well. >>> >>> >>> To summarize, I think we need too: >>> >>> 1. Fix Linux msgctl compat function to remove __IPC64. >>> >>> 2. Move __IPC64 to kernel-feature.h and define it based on kernel version >>> along with __ASSUME_DIRECT_SYSVIPC_SYSCALLS. >>> >>> 3. Only use wire-up semtimeop iff __NR_semtimedop is also defined. >>> >> >> It seems semop would also need be handled this way. > > 5. Ensure __old_msgctl, __old_semctl and __old_shmctl do not use > direct syscalls when __IPC64 is zero. Indeed, alpha cases prevents us to just use __NR_ipc in this case.