From patchwork Wed Apr 1 16:53:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38701 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by sourceware.org (Postfix) with ESMTPS id C8F06385DC3E for ; Wed, 1 Apr 2020 17:02:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C8F06385DC3E IronPort-SDR: ERYAhwYgOcN8KnUWXDQ8A7bv45pABeabxa9tNsuH2UOg5lTXnZB4SuPSTU6NAXzIjy22pA5w9b xdy13+cVhukhnODq4GrHhcRWbZBBy/eMhqtbvuZmeJk5UDifZ2J2g/Gxb31GIPVKbRQlAM5eqo tiuCOJ0jYfRhqs4Q9BmluaCmo8zc/PL15CfUvXAlf3Yy/kG7++u8R+aeajHDHCrNc0WMJcPro0 hCSmunTOIFj25lj7puIvV+LCFRrwNvv5R5V70GZ/XTP0nM94B2yAcsWYMm77+a7e7SUxdwbwGK JKM= X-IronPort-AV: E=Sophos;i="5.72,332,1580745600"; d="scan'208";a="236579003" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Apr 2020 01:01:23 +0800 IronPort-SDR: yhDDNYCl6udmo87wGePQfQJxuUp/IRnDd25Sm+5V/l4niPepLTyHjQHMITn6HZIiHEX19olqwI cT3CdbzuIWmYs71Xeqkn1dumNFlt6KCAvDI37vMmwSTIZiVWwI3lv8fLpV/2Af/O6fPc1l/2R/ hbvs5gzwtRKEPFDr4JFVYwdx/4AugcxDvFeOWfyax8d+wAWm7cpOv5Qo+bbivsDYXg1W6Fr0dZ 7beqBg4V8/Hpg3rFvU7BOVdr9OFyfUR/ZOshljgXbKucMSAL0WtT5bqY5+vO4JyCjN2K4ZOWS3 7LpJwAIn2PRzDPESxfNFGlEw Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 09:52:29 -0700 IronPort-SDR: O6Apezl7xvjoQgAbNtYEm7FGJorBk/+HqtyVzJoMLMNgRV2qZefyFo/e9T9JWrJpVTDZxICXZV h+k4bVgytNG95iP7wP9hx80LIkDN5jSdiDpV2LosNUtecAhBa1HZDP4OD3QNqbBz2MKATDNFP1 eB74cN26ac6IVksJJ8aRCvsRrOpbLUK3L7Dr8ZWlitY5rL0rX/UbRSVYWM1suOciY913DRlBYV gYvGPdJGAhPoPLh7LSYR22mWgQqNkSAaVgGnghJ9sVK58v7KwHPVP9N/rV/HuW1KABYxHwmv6O LhI= WDCIronportException: Internal Received: from cnf006887.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.55.14]) by uls-op-cesaip01.wdc.com with ESMTP; 01 Apr 2020 10:01:02 -0700 From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis Subject: [PATCH v5 0/3] Support y2038 semctl_syscall() Date: Wed, 1 Apr 2020 09:53:05 -0700 Message-Id: <20200401165308.1913271-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Spam-Status: No, score=-17.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 01 Apr 2020 17:02:49 -0000 This series does three things: 1. Creates a bits/semid_ds_t.h file (in every arch) that specifies struct semid_ds so we no longer have to use macros defined in sem-pad.h. 2. Removes the sem-pad.h file as it is no longer needed. 3. Adds a new __semid_ds32 that is passed to the kernel (as part of a union) when running on 32-bit systems. If we are doing an IPC_STAT command then the 32-bit sem_{c,o}time{_high} values are combined to create a 64-bit value. The semctl_syscall() function passes a union semun to the kernel. The union includes struct semid_ds as a member. On 32-bit architectures the Linux kernel provides a *_high version of the 32-bit sem_otime and sem_ctime values. These can be combined to get a 64-bit version of the time. This patch adjusts the struct semid_ds to support the *_high versions of sem_otime and sem_ctime. For 32-bit systems with a 64-bit time_t this can be used to get a 64-bit time from the two 32-bit values. This series was tested by running: ./scripts/build-many-glibcs.py ... compilers ./scripts/build-many-glibcs.py ... glibcs on my x86_64 machine. I also ran make check on RV32 and I only see a total of 9 test failures. v5: - Address v4 review comments - Set the semid_ds struct from a temp struct v4: - Remove the __IPC_TIME64 macro - It was only used once and doesn't work if __IPC_64 is 0 (which is usually is) - Address failures pointed out by Vineet Gupta Alistair Francis (3): bits/sem.h: Split out struct semid_ds semctl: Remove the sem-pad.h file sysv: linux: Pass 64-bit version of semctl syscall sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/bits/sem-pad.h | 33 ------------- sysdeps/unix/sysv/linux/bits/sem.h | 26 +---------- .../sysv/linux/bits/types/struct_semid_ds.h | 46 +++++++++++++++++++ .../linux/hppa/bits/types/struct_semid_ds.h | 46 +++++++++++++++++++ .../unix/sysv/linux/hppa/struct__semid_ds32.h | 32 +++++++++++++ .../bits/types/struct_semid_ds.h} | 20 +++++--- .../{bits/sem-pad.h => struct__semid_ds32.h} | 20 +++++--- .../unix/sysv/linux/powerpc/bits/sem-pad.h | 26 ----------- .../powerpc/bits/types/struct_semid_ds.h | 46 +++++++++++++++++++ .../sysv/linux/powerpc/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/semctl.c | 30 ++++++++++-- .../linux/sparc/bits/types/struct_semid_ds.h | 46 +++++++++++++++++++ .../sysv/linux/sparc/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/struct__semid_ds32.h | 32 +++++++++++++ sysdeps/unix/sysv/linux/x86/bits/sem-pad.h | 24 ---------- .../bits/types/struct_semid_ds.h} | 22 ++++++--- .../unix/sysv/linux/x86/struct__semid_ds32.h | 32 +++++++++++++ 18 files changed, 415 insertions(+), 133 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/hppa/struct__semid_ds32.h rename sysdeps/unix/sysv/linux/{sparc/bits/sem-pad.h => mips/bits/types/struct_semid_ds.h} (56%) rename sysdeps/unix/sysv/linux/mips/{bits/sem-pad.h => struct__semid_ds32.h} (52%) delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/types/struct_semid_ds.h create mode 100644 sysdeps/unix/sysv/linux/sparc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/struct__semid_ds32.h delete mode 100644 sysdeps/unix/sysv/linux/x86/bits/sem-pad.h rename sysdeps/unix/sysv/linux/{hppa/bits/sem-pad.h => x86/bits/types/struct_semid_ds.h} (52%) create mode 100644 sysdeps/unix/sysv/linux/x86/struct__semid_ds32.h