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-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 81CB51F55B for ; Wed, 13 May 2020 15:31:15 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C55D3957061; Wed, 13 May 2020 15:31:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C55D3957061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1589383874; bh=KikVJP1gNwiNGk+7wm+fj1m9lq8+zFJLO3KucATuH7I=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Ftlswe5kLVTXhNiw+jloBSM9smbM+OL17P/FZEw8Q2KiTZdqFCX3XoArXhgOBV2OV feU2gqO2hTLr2O33ShMklIXbsB4cldik4ev5uxhTIT4cnUik7cffbhNkvsh5SsmtbQ Vtupxzr5E/PlkIk7qVd/mHUnAg78Bas5I/rXo4JY= Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by sourceware.org (Postfix) with ESMTPS id 4B03B3851C0F for ; Wed, 13 May 2020 15:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B03B3851C0F IronPort-SDR: QCtVKOYutCsk2wct+r5kf10G6fiy+EBTszXgElcmsoK6EOtCTjnw1fe1L2aFbU/F4C0H++fB/c JLkyIdKaNT2YrlwHUmB6AKmfNbZltX/BLVZi3Hx/DF1ECYKff5twD58/JNklItjlmxzirq5SID L2jSWRfSItRvB0uOUsh2HS2IVon6yDydFDvbY9hw49ZFVxYA6hDA3Zluepe4rrjwKBx/gAKFTC O2L5Gei2xo6CrkuLqdUbN/vaZq7wyod12sAxF2LWP4FgFVFH+eUcOetk7OWv3Ay/MiyzlT5Dr8 qq0= X-IronPort-AV: E=Sophos;i="5.73,388,1583164800"; d="scan'208";a="139022183" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 13 May 2020 23:31:11 +0800 IronPort-SDR: hDbScPFdEjPIPdhZo0zki7CB3RueTMbX1wcYBtlJvXks4kw8MBvw9+cN2O7ZxUrKXQ6V1LUG5Y E+PHophK8gk4Z/+rjySCkD5U/VNexjOGk= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 08:21:24 -0700 IronPort-SDR: EkoZDy3UKaY6uUDgyqxgnlvjukdQehAvOrTgUAZj7I3r7pzqWvy+REG25iKMGgyk5S0gpqcEUv jS3HQ9BCgzOg== WDCIronportException: Internal Received: from usa002611.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.57.103]) by uls-op-cesaip02.wdc.com with ESMTP; 13 May 2020 08:31:10 -0700 To: libc-alpha@sourceware.org Subject: [PATCH v8 0/2] Support semctl_syscall() for __TIMESIZE==64 Date: Wed, 13 May 2020 08:22:47 -0700 Message-Id: <20200513152249.5103-1-alistair.francis@wdc.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: Alistair Francis via Libc-alpha Reply-To: Alistair Francis Cc: stepan@golosunov.pp.ru, Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This series supports the semctl calls on a system with __TIMESIZE==64 and __WORDSIZE==32 while not breaking current architectures. This is a step towards full y2038 support, but does not get us there yet. See: https://sourceware.org/pipermail/libc-alpha/2020-May/113774.html for more details on what is still required. This series 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/SEM_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. v8: - Revert back to v6-ish and only support __TIMESIZE==64 v7: - Re-write based on code from Adhemerval. v6: - Update the 3rd patch to pass a temp buffer to the kernel 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 (2): sysv: linux: Define the __semid_ds32 struct sysv: linux: Pass 64-bit version of semctl syscall .../unix/sysv/linux/hppa/struct__semid_ds32.h | 30 +++++++++++ sysdeps/unix/sysv/linux/ipc_priv.h | 4 ++ .../unix/sysv/linux/mips/struct__semid_ds32.h | 28 +++++++++++ .../sysv/linux/powerpc/struct__semid_ds32.h | 30 +++++++++++ sysdeps/unix/sysv/linux/semctl.c | 50 +++++++++++++++++-- .../sysv/linux/sparc/struct__semid_ds32.h | 30 +++++++++++ sysdeps/unix/sysv/linux/struct__semid_ds32.h | 30 +++++++++++ .../unix/sysv/linux/x86/struct__semid_ds32.h | 30 +++++++++++ 8 files changed, 228 insertions(+), 4 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/hppa/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/mips/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/sparc/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/struct__semid_ds32.h create mode 100644 sysdeps/unix/sysv/linux/x86/struct__semid_ds32.h -- 2.26.2