From patchwork Thu Mar 26 16:37:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38630 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by sourceware.org (Postfix) with ESMTPS id 19404385E023 for ; Thu, 26 Mar 2020 16:45:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 19404385E023 IronPort-SDR: jNKK90flNeq5t+BF9Mmr+DgJVMhdCOiW47xfVxObO3Rbm3OzFq2WQTb1rHKyC78dZoZ6M5HGLJ WWkmI8ccewmIKsvoEH82D4ZEGjb3cDJwH2w5MyDJsTVtvh4UNODsYqw+3WGXMT79pwIKZIuNyr 2i3XyYCKj36ChRDMKhsPH8IGS2wPttHq3zaXlBzCI0ZilSLCzQBUziCNqBaY9Kj8uviM4vTFLH 4wCB/2hPlUYyfLBpGLORkV+peQw1IHVzeQ2VSnA+pdWP+do1kyFXvtSHhXVTvvHYQrR0vT9KkR 84M= X-IronPort-AV: E=Sophos;i="5.72,309,1580745600"; d="scan'208";a="134027526" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 27 Mar 2020 00:45:02 +0800 IronPort-SDR: ptBWmFBOEJBBn0lQaBww8eB8K+Mgx+lXyWSK7duDdPRBGcowgIY41ZIkBP0fwu+E1HoGbyD5m5 QUt2YYUUeuhlmDiOmvS5fb4TQ6ByLj/6Cc/TSqAvMOitYNtViT3rSJq4QZo0Zw2Bd0oQqDHsh0 D0mCSffakZdAJgrkLNljLsteiHtck4etMcqgz8GtDPI93U8ultgwn2MGH/pKea+LpRFUN2cXjE pUzmlRfJCbyZ/8pI5IYU/nIPQOTZbLpkQh5kX0Yr8l4JtfQDX/PDQP6RO4coIB8CmdUFP/ItEb xLeCeeeOFDUEo2ksab03CGnI Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 09:36:04 -0700 IronPort-SDR: oY7NVrSkq/amFt0esMF3MJpk5DqssLYc3joIMeRzj/h8Y2QkBeue9mL9Dun2ucpnzhVH29zCxk OtgV/q8VSlXvyvY/lco2Po7FkasdGeuMZ5IyFB/uJheMKkk5pRkoeA4w4epKyVvJvbDykjMj/O 7xCpOIYY+AnqnoI4lke33hH/Bz7bRg0uj5gQ8o2n/ImTA4FutiT70g9yVPZVroOl6lPauHPhjq XGPqj3Npw3SFkdG28hSvRVz63h7DYMJ/buTgTwzDUpkhbucPrQgR3+PQBFtLaU3yPP+dJJA9iv I/Y= WDCIronportException: Internal Received: from lpt-shen-j.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.54.198]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Mar 2020 09:45:01 -0700 From: Alistair Francis To: libc-alpha@sourceware.org Cc: Vineet.Gupta1@synopsys.com, alistair23@gmail.com, Alistair Francis Subject: [PATCH v4 0/3] Support y2038 semctl_syscall() Date: Thu, 26 Mar 2020 09:37:21 -0700 Message-Id: <20200326163724.377351-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Spam-Status: No, score=-15.2 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: Thu, 26 Mar 2020 16:45:04 -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. 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 +------- sysdeps/unix/sysv/linux/bits/semid_ds_t.h | 61 +++++++++++++++++++ sysdeps/unix/sysv/linux/hppa/bits/sem-pad.h | 26 -------- .../unix/sysv/linux/hppa/bits/semid_ds_t.h | 61 +++++++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/sem-pad.h | 24 -------- .../unix/sysv/linux/mips/bits/semid_ds_t.h | 45 ++++++++++++++ .../unix/sysv/linux/powerpc/bits/sem-pad.h | 26 -------- .../unix/sysv/linux/powerpc/bits/semid_ds_t.h | 61 +++++++++++++++++++ sysdeps/unix/sysv/linux/semctl.c | 24 ++++++-- sysdeps/unix/sysv/linux/sparc/bits/sem-pad.h | 26 -------- .../unix/sysv/linux/sparc/bits/semid_ds_t.h | 61 +++++++++++++++++++ sysdeps/unix/sysv/linux/x86/bits/sem-pad.h | 24 -------- sysdeps/unix/sysv/linux/x86/bits/semid_ds_t.h | 49 +++++++++++++++ 15 files changed, 362 insertions(+), 188 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/bits/semid_ds_t.h delete mode 100644 sysdeps/unix/sysv/linux/hppa/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/hppa/bits/semid_ds_t.h delete mode 100644 sysdeps/unix/sysv/linux/mips/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/semid_ds_t.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/semid_ds_t.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/semid_ds_t.h delete mode 100644 sysdeps/unix/sysv/linux/x86/bits/sem-pad.h create mode 100644 sysdeps/unix/sysv/linux/x86/bits/semid_ds_t.h