From patchwork Thu Apr 19 14:37:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133821 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp882237edd; Thu, 19 Apr 2018 07:40:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48XiZAnYpXAaf+Y2vOJEafbsD1NBV05/7LSVnvqnKBuTfT7I1svRRsf7kCNXp9nMoErBln9 X-Received: by 2002:a17:902:7c0e:: with SMTP id x14-v6mr6560645pll.392.1524148848274; Thu, 19 Apr 2018 07:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148848; cv=none; d=google.com; s=arc-20160816; b=pYeYV2xzlvuYB1A0VIy3UhvTWk5s1rdKurFcl5oYxOpjKjL56QjGX6f4PCK2lc39i1 gs91X9D0/WUEv2YlbpIKjLPw9lgIpx0nqgQotJCPGN3sim6TRjeZqtkPPdcNoImUcig6 33EXtGppLxl4TwsTOE5pUIs7Exq4afvnrOAwW2N67R7R/I1K9OAIdpBxhxjdIOH6yOR0 Z4pqDCb+/tDt6vNdtGec2v3oMeI4hY+sr8f8vatIvtAodvtgcCbE1vxJai9xfYmuVsOK O7AaDg2CagT2O22Kz60aF85sTyqqo5DMJgtZPGfw2r/oTv+WTZ4n/FSdSnv+4IsZM67d d7Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=LlxXVqrPMDk/4DepHDOBPJL20zY2awhXcz0luhv7A1c=; b=JnDxtfXBUn3KVv/Lyhoem21V4s54Gvt0DW3eTIIXP7GHbuIN5fvaaSCCK2EnzFeXM+ FeDIRIenAfzU8US9+zcroJo1spEXOlaxMsahyddxkWlP3AvcPz1SbJgwF9r9oble/ZKd TsetFHx6ClRt6H0SHTklqjvZunMcDKYx07uIQm2CXg7LVzPbs6K5/rbmuFPVWy7hChvw sHTmiDJiF4QqRkNnLlLKfCFbqXb813+Bzig/z2P4CcXU9NR2loXYQwSeCW2CCL7VvSv+ 7exeeSqmT6RR23sN02DIU/28xCd0OKgFL/F2pZltdf/IB0lgUiGv+JNWpAJviA16/Wel 0a4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9-v6si3669908plk.294.2018.04.19.07.40.48; Thu, 19 Apr 2018 07:40:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753503AbeDSOi7 (ORCPT + 29 others); Thu, 19 Apr 2018 10:38:59 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:46855 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287AbeDSOiw (ORCPT ); Thu, 19 Apr 2018 10:38:52 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MDgWE-1fD0AE2Zuo-00H7Jv; Thu, 19 Apr 2018 16:37:48 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 01/17] y2038: asm-generic: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:21 +0200 Message-Id: <20180419143737.606138-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:4xrHhOyONM1SnmBBiZZBn0APMxEIEhx+LVcWRJQt3EynvbndZbu VoTF7eU1WYMeEVku+X1x4Ei59LCYcejFN+wsErGymyEg6/UXriB9xf+2QohCuwjj1B9iVXT XUF1bifhVrEdYUlXhR9AwSTeEo/yvte+S6H//XZNmBqm44lEsx5Vg0w3ITXdh36QhogKpZj EGhaSVXJJeFCLJML/FSAw== X-UI-Out-Filterresults: notjunk:1; V01:K0:o/U3HjYUbjg=:BYXFOB+tOwYJRCHYWLv/hV z3jY7I/RvQykLGWQgsrckLNeqa27VqrPTt6tJDckPkJAhhsfBHzCLHi3woigmMkFcZ5o3Lnjn QAaBYhLcGo8xB3kAAjzbat0e2tt+VAcXPx4JuPu3rPqX9aoEKNns61G/rDVwb74+NQuIoJqFe uA9vC2xZQY7x8wrqDxNO8k6D0zMF8rPqztZ/Unn5ikilMCX0NU3YFt+1lyWzi8rLhx8YGF+GH HZIUwtKRX8CP7otx/jy6oylVAE+FHyWm7fj1QHnn+rb5Os6PO0PsXrZihWKVpAc2WurzIRU4Y oFTXgqhBxOnDiyUDDK8eRvQW0LswEl2THEVCRPgHH7rFy0Oo9AvZDJSncoOyiA3fvMIONJNy4 Ei2s0I+zXkmZKSj8rUU9Zu35e4kYPNINZRZLUN8uz0HUvS23lgL6b5hM0gWZgcyGS3nTGTxQg My18eFqo2MWAiDZ6Qw4Lcsra0Db05zf7I3gcgAaO3s/o58t5siERfNV1sY51MLXLbwmA+AhUm hIThMZoVs9Djl9GQHkojI4TVpayPk9h/xso+JTmzRUvNRSI4zW16PvkM8Aj2VyT/j/fv9WvgL 09XIxpbqU+hTnLf/NRjJ+jUmXI6VkdCyizBAMX4vukNFzArBMiF33EkXlrzBcQKdcfyAYS9En bTNNVd7olgCErO2f+CbFSSo8gDOHoHsmx70+9T7g8kQw9XPDwd/N6hWGN6U9SYzrXKx+VxbFz biKQuqKIepOBHAkbFiwADd27N6MxecU/nBQNRg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most architectures now use the asm-generic copy of the sysvipc data structures (msqid64_ds, semid64_ds, shmid64_ds), which use 32-bit __kernel_time_t on 32-bit architectures but have padding behind them to allow extending the type to 64-bit. Unfortunately, that fails on all big-endian architectures, which have the padding on the wrong side. As so many of them get it wrong, we decided to not bother even trying to fix it up when we introduced the asm-generic copy. Instead we always use the padding word now to provide the upper 32 bits of the seconds value, regardless of the endianess. A libc implementation on a typical big-endian system can deal with this by providing its own copy of the structure definition to user space, and swapping the two 32-bit words before returning from the semctl/shmctl/msgctl system calls. ARM64 and s/390 are architectures that use these generic headers and also provide support for compat mode on 64-bit kernels, so we adapt their copies here as well. Signed-off-by: Arnd Bergmann --- include/uapi/asm-generic/msgbuf.h | 17 ++++++++--------- include/uapi/asm-generic/sembuf.h | 26 ++++++++++++++++---------- include/uapi/asm-generic/shmbuf.h | 17 ++++++++--------- 3 files changed, 32 insertions(+), 28 deletions(-) -- 2.9.0 diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h index fb306ebdb36f..d2169cae93b8 100644 --- a/include/uapi/asm-generic/msgbuf.h +++ b/include/uapi/asm-generic/msgbuf.h @@ -18,23 +18,22 @@ * On big-endian systems, the padding is in the wrong place. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct msqid64_ds { struct ipc64_perm msg_perm; +#if __BITS_PER_LONG == 64 __kernel_time_t msg_stime; /* last msgsnd time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused1; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused2; -#endif __kernel_time_t msg_ctime; /* last change time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused3; +#else + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_stime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_rtime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_ctime_high; #endif __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */ __kernel_ulong_t msg_qnum; /* number of messages in queue */ diff --git a/include/uapi/asm-generic/sembuf.h b/include/uapi/asm-generic/sembuf.h index cbf9cfe977d6..0bae010f1b64 100644 --- a/include/uapi/asm-generic/sembuf.h +++ b/include/uapi/asm-generic/sembuf.h @@ -13,23 +13,29 @@ * everyone just ended up making identical copies without specific * optimizations, so we may just as well all use the same one. * - * 64 bit architectures typically define a 64 bit __kernel_time_t, + * 64 bit architectures use a 64-bit __kernel_time_t here, while + * 32 bit architectures have a pair of unsigned long values. * so they do not need the first two padding words. - * On big-endian systems, the padding is in the wrong place. * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values + * On big-endian systems, the padding is in the wrong place for + * historic reasons, so user space has to reconstruct a time_t + * value using + * + * user_semid_ds.sem_otime = kernel_semid64_ds.sem_otime + + * ((long long)kernel_semid64_ds.sem_otime_high << 32) + * + * Pad space is left for 2 miscellaneous 32-bit values */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ +#if __BITS_PER_LONG == 64 __kernel_time_t sem_otime; /* last semop time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused1; -#endif __kernel_time_t sem_ctime; /* last change time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused2; +#else + unsigned long sem_otime; /* last semop time */ + unsigned long sem_otime_high; + unsigned long sem_ctime; /* last change time */ + unsigned long sem_ctime_high; #endif unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused3; diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h index 2b6c3bb97f97..602f1b5b462b 100644 --- a/include/uapi/asm-generic/shmbuf.h +++ b/include/uapi/asm-generic/shmbuf.h @@ -19,24 +19,23 @@ * * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ +#if __BITS_PER_LONG == 64 __kernel_time_t shm_atime; /* last attach time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused1; -#endif __kernel_time_t shm_dtime; /* last detach time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused2; -#endif __kernel_time_t shm_ctime; /* last change time */ -#if __BITS_PER_LONG != 64 - unsigned long __unused3; +#else + unsigned long shm_atime; /* last attach time */ + unsigned long shm_atime_high; + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_dtime_high; + unsigned long shm_ctime; /* last change time */ + unsigned long shm_ctime_high; #endif __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ From patchwork Thu Apr 19 14:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133809 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714798ljf; Thu, 19 Apr 2018 07:39:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48MlXBN4iA1oSx1B2dxq/iKFEoEnv70zwnvPEKO5fBeaOjKbtVu6FsocpM6H7Xcm8Untlui X-Received: by 10.99.178.12 with SMTP id x12mr5490254pge.316.1524148763334; Thu, 19 Apr 2018 07:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148763; cv=none; d=google.com; s=arc-20160816; b=wu0migdUlsLhIRjnRGuBYn1MFZgRDwabrSj8IYpU+nPfRJ6FWerumDDOobx2Qn1N8E yDV8YMOAUoBiHG/rSMDXAgBW3BjloOg3rn8QeFGq2KLTT74cfT8s3cfF44ZycctZyx+A uXH2CffsP5AprK9BvrMdj1XZLFuayP6RBcEJh0xa4Ha0Js7BNAW3x6YNgI278pefCwDa NFSY8fHURE11HPnuI7y/iNEo8Rsl2dXizDMI+WNQ5AqbhPMdS+qJDc5UFQ1On7aPqbJS q3DSqWW3u91WzG1SlpWiC3uG1Rlp4BcOr9jMF7QJCOUrvW5j3ihe5lWU2GP6vEpJL/Op tQ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XtM7rZEhfNXfxy5aDuJ0byj9FqIRVtPU5RADUe6Z8Qs=; b=bDKljPtCLg33YKbcocMJmCx4CGF/rtCpStzVMElJCjxit75EZ+t+/7KzpkXotsyoI8 MX6odRveFTaitjwIdsED6lRu43PgsNOPrHfWzwXCXw3ODXUc91z/r5AfbTytsuzUVc2I uiWy4H2c82nJNO3Mt5ZozFmnf67qMgZMYNOvNxU4WIj9ROo4ezzJLojXoJ9M94+DFM/3 oYvonn2znf5nsbdO5UHDmOszDu48LdmCaecJAd20YG60nuyT22VveFeyPq54pwKK5gzj 9DslaErzRaL/4gWQlfqX/hTPaOv5R9sciSA10lvmOVm18UuIrjQnYQGp9jcProXk6Ku/ jEwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si3252363pfm.62.2018.04.19.07.39.17; Thu, 19 Apr 2018 07:39:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbeDSOjO (ORCPT + 29 others); Thu, 19 Apr 2018 10:39:14 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:60509 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbeDSOjK (ORCPT ); Thu, 19 Apr 2018 10:39:10 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MSak0-1f1VjF1iyq-00RWdZ; Thu, 19 Apr 2018 16:37:49 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 02/17] y2038: alpha: Remove unneeded ipc uapi header files Date: Thu, 19 Apr 2018 16:37:22 +0200 Message-Id: <20180419143737.606138-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:GJvU2GYz6J3khxgI87odc47RVbI/DmH/l0oNg9ieS6Rp+Cej7kA Ry/0g+wcPyG7UdO8NfYEWbFqg4CvwW9e3fFG6zdxPyuIEEvv4SZ+paliYATGwdRE8RJi3NN rqkDlFgFkTX8IqD3gRldLs8PHDXzTgkWVKmfocXsXoh2A4ElPmFDGLuo79tN0wBnXNhb6ah mvp7WWScQ0BSt7x5v8wig== X-UI-Out-Filterresults: notjunk:1; V01:K0:sordSBH9nY0=:pAyb50zZ4YGhv+LBLSR5qz ttBE6I24AJl200y4dZMydeLJ8XU/UTytrzyGQ7MMWNjXert6SxeiQUfJfKDn9kr1knys+v1AR Zrbes7eqMcJGgBO8418CuMUbcMyAxp8ZZoq0PQRG+dQHSbYz0FYBA+Ey4r/qtZyMvzbt15rdM 3OngiFiSZAK9CawWxmzx0AUTM0ED7myyOGRckVi5yD0SVm402JvvoeQq2zWGzumlhQuMGdA6m E5mYoWc2Yju3KPVKaIwHwFfMmlGP2aa0hZgFLeh6AZUf6QTHVCiW5g3m898IxwRmw8upWM0am F7MLXYK0uniNyaYPXtVwsagJH+GdWMSjLYvmnrBp/6vmPgNc+muwYRH35jDWki5KeqKXepVA1 zqPrqNjXvmpsZaBDLgS2UfDsGvf6dEO97lEx6ue3J0ddcHB04GqKh0mTTNAmzv4lfJx15bWxH 74JugZxX4I2P662oqLy3BlBTzqkDjsqx9ZILIJleRHhpn1AT7HtZhe4yGkziIzt3hiswyQrkU 9f05kB6nz7zxPdVg4jZd3gTfua6gQPNBed4ihRzLYS2kTV4t/hIqOeHUSm9mTddIromj9E3vj Or6rSFi7eQ5zSspZjtcU6vMF+knzyn7Kwtu7r2RVmYjUPGKZ7AGD1MvoLPqM4bBoDCsUYHfOF cviK+T9gJoBHCGIb2y2oHnVz2rFw5Y97NySms2117EMa+7rZuyFjz8ouKiSO03xacqJyBxVRX ukVrNBJqMF3UlOiittRapfSYig0o3KhRCIKPjA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The alpha ipcbuf/msgbuf/sembuf/shmbuf header files are all identical to the version from asm-generic. This patch removes the files and replaces them with 'generic-y' statements as part of the y2038 series. Since there is no 32-bit syscall support for alpha, we don't need the other changes, but it's good to have clean this up anyway. Signed-off-by: Arnd Bergmann --- arch/alpha/include/uapi/asm/Kbuild | 4 ++++ arch/alpha/include/uapi/asm/ipcbuf.h | 2 -- arch/alpha/include/uapi/asm/msgbuf.h | 28 -------------------------- arch/alpha/include/uapi/asm/sembuf.h | 23 --------------------- arch/alpha/include/uapi/asm/shmbuf.h | 39 ------------------------------------ 5 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 arch/alpha/include/uapi/asm/ipcbuf.h delete mode 100644 arch/alpha/include/uapi/asm/msgbuf.h delete mode 100644 arch/alpha/include/uapi/asm/sembuf.h delete mode 100644 arch/alpha/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild index 9afaba5e5503..1a5b75310cf4 100644 --- a/arch/alpha/include/uapi/asm/Kbuild +++ b/arch/alpha/include/uapi/asm/Kbuild @@ -2,4 +2,8 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += bpf_perf_event.h +generic-y += ipcbuf.h +generic-y += msgbuf.h generic-y += poll.h +generic-y += sembuf.h +generic-y += shmbuf.h diff --git a/arch/alpha/include/uapi/asm/ipcbuf.h b/arch/alpha/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/alpha/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/alpha/include/uapi/asm/msgbuf.h b/arch/alpha/include/uapi/asm/msgbuf.h deleted file mode 100644 index 8c5d4d8c1b16..000000000000 --- a/arch/alpha/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_MSGBUF_H -#define _ALPHA_MSGBUF_H - -/* - * The msqid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - __kernel_time_t msg_rtime; /* last msgrcv time */ - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ALPHA_MSGBUF_H */ diff --git a/arch/alpha/include/uapi/asm/sembuf.h b/arch/alpha/include/uapi/asm/sembuf.h deleted file mode 100644 index f28ffa668b2f..000000000000 --- a/arch/alpha/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_SEMBUF_H -#define _ALPHA_SEMBUF_H - -/* - * The semid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ALPHA_SEMBUF_H */ diff --git a/arch/alpha/include/uapi/asm/shmbuf.h b/arch/alpha/include/uapi/asm/shmbuf.h deleted file mode 100644 index 7e041ca2eb40..000000000000 --- a/arch/alpha/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_SHMBUF_H -#define _ALPHA_SHMBUF_H - -/* - * The shmid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused1; - unsigned long __unused2; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ALPHA_SHMBUF_H */ From patchwork Thu Apr 19 14:37:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133806 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714190ljf; Thu, 19 Apr 2018 07:38:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx498p9XB5jRmziiZeZ+IwuzeKFH28Y6t7BYanbjJjasvwlj+9XCLA9HJau8nAcoyzs3Ps02j X-Received: by 10.99.110.198 with SMTP id j189mr5268053pgc.86.1524148723916; Thu, 19 Apr 2018 07:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148723; cv=none; d=google.com; s=arc-20160816; b=z8n4/63n6GY7qB4FGlOepq6j4azo3FiAmhXXBGxyri/bxhWu3NiGxuWKX0cheoSKMC 4D1cHJFWeePGvEPCI0HEIgnLtnP9Qn+tF+YYs8vIBefIs7owwW5A5m6R3jQbdSAB/VTb EF+oZyVUQfmJWHSmPVoR9HR20x39IqY2cy6PMlPq7zhIB9V8g429MkGO6jK/3qJreQWp 4iDubc64vpfxM213augrhMM4cIN35Wkp5t/b+wP56O4TM/72WJYng9HA0hf0kqfQ2mWy zglV0ETHLEx3Iadaw00vwBkQSbK2JdwqT+E4gk4PwMnnXEFewoeq5DMNBKpTvyD1wjRO w1Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=scVQmMPibmaUCjrnlkAhD+FtGGnY/E4Zdr7onZX+a7k=; b=AvkSxvsGumRJuv9iGM8eWC7nG35tXrk0Ruum3PNxrwzmVFzWbjzJeGWffIcsZIX9aR N3RIVicKTzyR6JQnU7ic99YDGD50Jz5ZXytJGlxhkplFwR13t4s8Oz4mQ+8VSA9r/72D 2R+WJShDrTlD50a9uQfEsnN4UQUlk6EcQNMAfzf8AObwc9K6zEzErEf8C82P4Djoqvcf QjaSy+K2ysinEy8Ckytzd6ARYwvMzSTyBdqKMmm0OxXdKd+EtBSPT5497Ne5Vz2v+0LO 0L6rIZzKyH1Mupo1DywwqV/KGdkjf4tPxiXKvWFZt7pnLTeLIlZ5CHaSKJzM9t2CiNf7 Pu7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p26-v6si3623491pli.35.2018.04.19.07.38.43; Thu, 19 Apr 2018 07:38:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753002AbeDSOil (ORCPT + 29 others); Thu, 19 Apr 2018 10:38:41 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:58611 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780AbeDSOii (ORCPT ); Thu, 19 Apr 2018 10:38:38 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LlnHM-1eZpsM14EK-00ZTEP; Thu, 19 Apr 2018 16:37:50 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 03/17] y2038: ia64: Remove unneeded ipc uapi header files Date: Thu, 19 Apr 2018 16:37:23 +0200 Message-Id: <20180419143737.606138-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:togmoBqsxPzWYZRjoFWcVxWB8zwSf3VacbiJCfeT+d9Xss8JIqC m3aeZZa0gbY0vMTtvPR4rnllAegCZwvIUHmT9vMCfYDPM1zAYXzdWjQ3cNrgaNt7u8pb9Yn aaCdkCi5bFn9vquqUqWIrakTxl6upoal9CgusA39F6HVsC8PFtv42Pn1+lENE9+zhDg/XJ4 94YNXC7q9hLFtHG0Nz18w== X-UI-Out-Filterresults: notjunk:1; V01:K0:a8+4xEiDwvg=:qIGdbUviRp1TU+YUq9AKT+ tc2Ne6l4NINpyVOjpERT/tgXHdXoOhP3+ywX1Q7LayHPe90nyKIfUKkL2wwgV2W9BOorwfWa6 mh31AWD1s2zD29r6tD9gEJDPawrzuUseV6tWxh9eKs1R+m5nMugscwcX3YWVMMwwPPj++iIo3 3XmjjRpWl6FNKsiaZBmD3D6I5Vh54jC0UgCono+nuSmtXw60A2zP9tCwCt3F7lyK4Q7319vlC jWbFqdLuMzRX5uJctQhrgn2wegDWlAw4Kb/sElqOjk57juFbLsg/6eqN2/aCCRmOGPSROFed8 dyKrWjGFB168w64Pk7J9U74Lcabt9qPZGBhN/Gsr5wcuDjyRgWudhvzBsIGzgJG4KMAHAdzjR a4TCHPJEYEXtMYCZ0RYoeq/x6V5R7YnhcR9Lgm+ENdVFY3xExE8PDa76ALBMRWV+Gn6RyHibb 0psdK9JkPoxuUWeZWrHIObifKxECZD8nTeCzTH+hhgkkE9VloTHYBdBLVRmw10hK4JpuV63bD NwwSJPAyMSVtw7z/EBFWqaEfqLsk6Ls/2NDQ2EXb0YR6EfNZV9G8jHXH5/Wwus4lHHeJKYSx1 rZ6Lby13uB5IeAEasa8GakGgVok7mE/oSAAmmYk1iWeB26xB6XXSLtvcu5M5hhgsejwvSPO/i prwZ7t9GzBtvrsOPZalLGe2DSaEKFeA76AoCh0TfmmHi4PtrjNhnYyQR+7V32bRvaQrBTQUbh Vt7ZfZtu0FhKOVmFzQ+XbRevvfH4he2yVPW7qQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ia64 ipcbuf/msgbuf/sembuf/shmbuf header files are all identical to the version from asm-generic. This patch removes the files and replaces them with 'generic-y' statements as part of the y2038 changes. While ia64 no longer has a compat mode and doesn't need the file any more, it seem nicer to clean this up anyway. Signed-off-by: Arnd Bergmann --- arch/ia64/include/uapi/asm/Kbuild | 4 ++++ arch/ia64/include/uapi/asm/ipcbuf.h | 2 -- arch/ia64/include/uapi/asm/msgbuf.h | 28 -------------------------- arch/ia64/include/uapi/asm/sembuf.h | 23 ---------------------- arch/ia64/include/uapi/asm/shmbuf.h | 39 ------------------------------------- 5 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 arch/ia64/include/uapi/asm/ipcbuf.h delete mode 100644 arch/ia64/include/uapi/asm/msgbuf.h delete mode 100644 arch/ia64/include/uapi/asm/sembuf.h delete mode 100644 arch/ia64/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild index c0527cfc48f0..3982e673e967 100644 --- a/arch/ia64/include/uapi/asm/Kbuild +++ b/arch/ia64/include/uapi/asm/Kbuild @@ -2,5 +2,9 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += bpf_perf_event.h +generic-y += ipcbuf.h generic-y += kvm_para.h +generic-y += msgbuf.h generic-y += poll.h +generic-y += sembuf.h +generic-y += shmbuf.h diff --git a/arch/ia64/include/uapi/asm/ipcbuf.h b/arch/ia64/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/ia64/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/ia64/include/uapi/asm/msgbuf.h b/arch/ia64/include/uapi/asm/msgbuf.h deleted file mode 100644 index aa25df92d9dc..000000000000 --- a/arch/ia64/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_MSGBUF_H -#define _ASM_IA64_MSGBUF_H - -/* - * The msqid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - __kernel_time_t msg_rtime; /* last msgrcv time */ - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ASM_IA64_MSGBUF_H */ diff --git a/arch/ia64/include/uapi/asm/sembuf.h b/arch/ia64/include/uapi/asm/sembuf.h deleted file mode 100644 index 6ed058760afc..000000000000 --- a/arch/ia64/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_SEMBUF_H -#define _ASM_IA64_SEMBUF_H - -/* - * The semid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ASM_IA64_SEMBUF_H */ diff --git a/arch/ia64/include/uapi/asm/shmbuf.h b/arch/ia64/include/uapi/asm/shmbuf.h deleted file mode 100644 index 6ef57cb70dee..000000000000 --- a/arch/ia64/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_SHMBUF_H -#define _ASM_IA64_SHMBUF_H - -/* - * The shmid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused1; - unsigned long __unused2; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_IA64_SHMBUF_H */ From patchwork Thu Apr 19 14:37:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133808 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714594ljf; Thu, 19 Apr 2018 07:39:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx487zQTbdsblj5Jmfkc1dBdhTXQyhT2TTflBZN2nkWQi79fA4v2RZPd7Ll3J0wFz8XIYnG0G X-Received: by 2002:a17:902:362:: with SMTP id 89-v6mr6555258pld.270.1524148750173; Thu, 19 Apr 2018 07:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148750; cv=none; d=google.com; s=arc-20160816; b=h0HHERjPHSgTcZ+njqtROpaBAqTICtT9daxLqSTP4mZ4CEpO/nTk/cBrUiTV80JDfS g+FeUiFCnmCFiNaGZVm6r64lhEtLkNsoIMBHSmZ916YGpoXznAry77Fz8B20TQbQwTIT Q1S74F3HOecWGuICvn6GTmOnnQs8IxWRitJDu2WahXdEk0nXMO2c5Mt5hCyEnqAqnWdI YjOYyd3Cl16lEqTaeR3oDj4oTvZNCsL0y3Ic8uM9dUQzrPH+qjmMhZb1snNnJW2ZGLU/ NsmtyucjBFFqvGUsIEs4THgVmwdmBwUrn9yYYnRvVjV/PA+HPFQLL94pK4MONaSEnBHw J+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=FrJlXdbBSOBOPVP+ss+6R3FFoyGHjbxMkFl3d7fS9XM=; b=HpwQ8umPMnT6mlwqfsZ5sCzo5DqozUY5NU4Zptzo0glRQLYOoC6A9V4CAY3ZysQOKc kZsHgfzAeVe09LI2ZyXryV8CJRSKrGzuKgdd/OjdhLKHGrlDegmtKYxX4EO5hYPe9U7p OfJjk17seOqW6vADiOnB10d5VE7zPcrSUZQ8b/otev+U/wo7DXmrseE4PyzcaMMPmQhB NsbIyuJQ14yf77SKVTatqn6Y4P1o8MBk/qopbxv7ZZun9/AswfTYwQaGfRh044YS7w64 f32v1dRVo2acWkNf1fkHm53rAo/elZtPGcc/1gE8EX39lD/IJCaoYflylcx5z9BfwULW zfxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si3252363pfm.62.2018.04.19.07.39.09; Thu, 19 Apr 2018 07:39:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753526AbeDSOjB (ORCPT + 29 others); Thu, 19 Apr 2018 10:39:01 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:40917 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753162AbeDSOi5 (ORCPT ); Thu, 19 Apr 2018 10:38:57 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lxwsm-1eNnBU2zTA-015FAT; Thu, 19 Apr 2018 16:37:52 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 06/17] y2038: mips: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:26 +0200 Message-Id: <20180419143737.606138-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:w7eh+1LtL3zSwZjrO6FGNHteF3uN6eTLWo15awA9MfW1f7yI2cL QMSjvI3KIfx++4sLSCMun8PTcbpBYX7nudXVqyLqB7Ql0abB7lTQcOvjHVtRG9xCk1c3Bv1 Jc5Cnx62P62kmsvocYgyU9MDZ2WzuT41AMYgaFjzDmP2R0bvVdd7zPAyzb5fhuQ+3ENH4AV /z3FWIAUFt7jwFMiu9VdQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:wpZr/bw2BAM=:FFZcU9qYbzVrz3odtn+Ybn SF/2bsUFWxrbsNS1UXftqCMq493M6D4WWFcRVc46s/+vc7F/qvRjLhSJ6k/tWAfWmsDCjWcV1 Dvuz6VXQ/JJ3to8J3yknipSsNPXZV2D0LnaEHl2VvjvBdCArEEuu0LTOBkXyZoUAP1OFmZi+f 7mErUJwJt0RH2e+VaLGSbuPjNQLgKhq5xPqEd34nrAKOd8LQxAdodlrFXb6cRatV76iE6Y3cc TiNx6UKbwh/aotL36NAr1LawoSZdf28+tcabZ2Q9S4dgJ6BFrNjkicnWcwoUIUVc9T3wT7yd+ aKz+UTO8bGEzfOUxxUIps9ub0ljc07JIoBXTAJSe51FaxtcY1s7bREAzjp8AShYsiFu7d8RRz 9RMmJUI/U6gatcLSbKyr6Ia5/gFpjh9kMRMRzBEwS+qVpH1H4f8CcWsYb1QUM0jOBhUuohKDT dav7bX8HVmXs+x5xY5tCJU4KHJf52rvtIfbXCzB9RfRMCt3BIKBqaGHBHYuP+uLr3N/65SUL2 h5IKYIa+mL2CDYtOBEUNUFSZuWGeBMRzBMNodDTBVnaiJw1ATcpcD0ZoJt08vmt/33riWS+r3 SSO0YUBuv1uC3zrGxjnF+y0oyuxxdonVc2rmIHGCGamt2QCm3sXCNWtV+c1hRWUUwoL5EqgNy jn4Kz0h1XTjUGj1WW0B9AVA0gB2Po1ThN2KUM/TkaIcOHUXRq1Bkzxiw+SpF6x34MTYLxYfY4 HLKD1a9hWk/9KLfG32ThrB2u5h6ifE2v/NeXfA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MIPS is the weirdest case for sysvipc, because each of the three data structures is done differently: * msqid64_ds has padding in the right place so we could in theory extend this one to just have 64-bit values instead of time_t. As this does not work for most of the other combinations, we just handle it in the common manner though. * semid64_ds has no padding for 64-bit time_t, but has two reserved 'long' fields, which are sufficient to extend the sem_otime and sem_ctime fields to 64 bit. In order to do this, the libc implementation will have to copy the data into another structure that has the fields in a different order. MIPS is the only architecture with this problem, so this is best done in MIPS specific libc code. * shmid64_ds is slightly worse than that, because it has three time_t fields but only two unused 32-bit words. As a workaround, we extend each field only by 16 bits, ending up with 48-bit timestamps that user space again has to work around by itself. The compat versions of the data structures are changed in the same way. Signed-off-by: Arnd Bergmann --- arch/mips/include/asm/compat.h | 40 ++++++++++++++------------ arch/mips/include/uapi/asm/msgbuf.h | 57 ++++++++++++++++++++++++------------- arch/mips/include/uapi/asm/sembuf.h | 15 ++++++++-- arch/mips/include/uapi/asm/shmbuf.h | 23 +++++++++++++-- 4 files changed, 94 insertions(+), 41 deletions(-) -- 2.9.0 diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 3e548ee99a2f..78675f19440f 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h @@ -37,9 +37,11 @@ typedef struct { typedef s32 compat_timer_t; typedef s32 compat_key_t; +typedef s16 compat_short_t; typedef s32 compat_int_t; typedef s32 compat_long_t; typedef s64 compat_s64; +typedef u16 compat_ushort_t; typedef u32 compat_uint_t; typedef u32 compat_ulong_t; typedef u64 compat_u64; @@ -157,35 +159,35 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - compat_time_t sem_otime; - compat_time_t sem_ctime; + compat_ulong_t sem_otime; + compat_ulong_t sem_ctime; compat_ulong_t sem_nsems; - compat_ulong_t __unused1; - compat_ulong_t __unused2; + compat_ulong_t sem_otime_high; + compat_ulong_t sem_ctime_high; }; struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused1; + compat_ulong_t msg_stime_high; #endif - compat_time_t msg_stime; + compat_ulong_t msg_stime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused1; + compat_ulong_t msg_stime_high; #endif #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused2; + compat_ulong_t msg_rtime_high; #endif - compat_time_t msg_rtime; + compat_ulong_t msg_rtime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused2; + compat_ulong_t msg_rtime_high; #endif #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused3; + compat_ulong_t msg_ctime_high; #endif - compat_time_t msg_ctime; + compat_ulong_t msg_ctime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused3; + compat_ulong_t msg_ctime_high; #endif compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; @@ -199,14 +201,16 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; compat_size_t shm_segsz; - compat_time_t shm_atime; - compat_time_t shm_dtime; - compat_time_t shm_ctime; + compat_ulong_t shm_atime; + compat_ulong_t shm_dtime; + compat_ulong_t shm_ctime; compat_pid_t shm_cpid; compat_pid_t shm_lpid; compat_ulong_t shm_nattch; - compat_ulong_t __unused1; - compat_ulong_t __unused2; + compat_ushort_t shm_atime_high; + compat_ushort_t shm_dtime_high; + compat_ushort_t shm_ctime_high; + compat_ushort_t __unused2; }; /* MIPS has unusual order of fields in stack_t */ diff --git a/arch/mips/include/uapi/asm/msgbuf.h b/arch/mips/include/uapi/asm/msgbuf.h index eb4d0f9d7364..46aa15b13e4e 100644 --- a/arch/mips/include/uapi/asm/msgbuf.h +++ b/arch/mips/include/uapi/asm/msgbuf.h @@ -9,33 +9,15 @@ * between kernel and user space. * * Pad space is left for: - * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem * - 2 miscellaneous unsigned long values */ +#if defined(__mips64) struct msqid64_ds { struct ipc64_perm msg_perm; -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused1; -#endif __kernel_time_t msg_stime; /* last msgsnd time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused1; -#endif -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused2; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused2; -#endif -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused3; -#endif __kernel_time_t msg_ctime; /* last change time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused3; -#endif unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ unsigned long msg_qbytes; /* max number of bytes on queue */ @@ -44,5 +26,42 @@ struct msqid64_ds { unsigned long __unused4; unsigned long __unused5; }; +#elif defined (__MIPSEB__) +struct msqid64_ds { + struct ipc64_perm msg_perm; + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused4; + unsigned long __unused5; +}; +#elif defined (__MIPSEL__) +struct msqid64_ds { + struct ipc64_perm msg_perm; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_stime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_rtime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_ctime_high; + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused4; + unsigned long __unused5; +}; +#else +#warning no endianess set +#endif #endif /* _ASM_MSGBUF_H */ diff --git a/arch/mips/include/uapi/asm/sembuf.h b/arch/mips/include/uapi/asm/sembuf.h index 2c0f507ab7d1..60c89e6cb25b 100644 --- a/arch/mips/include/uapi/asm/sembuf.h +++ b/arch/mips/include/uapi/asm/sembuf.h @@ -7,10 +7,11 @@ * Note extra padding because this structure is passed back and forth * between kernel and user space. * - * Pad space is left for: - * - 2 miscellaneous 64-bit values + * Pad space is left for 2 miscellaneous 64-bit values on mips64, + * but used for the upper 32 bit of the time values on mips32. */ +#ifdef __mips64 struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ __kernel_time_t sem_otime; /* last semop time */ @@ -19,5 +20,15 @@ struct semid64_ds { unsigned long __unused1; unsigned long __unused2; }; +#else +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime; /* last change time */ + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long sem_otime_high; + unsigned long sem_ctime_high; +}; +#endif #endif /* _ASM_SEMBUF_H */ diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h index 379e6bca518b..9b9bba3401f2 100644 --- a/arch/mips/include/uapi/asm/shmbuf.h +++ b/arch/mips/include/uapi/asm/shmbuf.h @@ -7,10 +7,13 @@ * Note extra padding because this structure is passed back and forth * between kernel and user space. * - * Pad space is left for: - * - 2 miscellaneous 32-bit rsp. 64-bit values + * As MIPS was lacking proper padding after shm_?time, we use 48 bits + * of the padding at the end to store a few additional bits of the time. + * libc implementations need to take care to convert this into a proper + * data structure when moving to 64-bit time_t. */ +#ifdef __mips64 struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ @@ -23,6 +26,22 @@ struct shmid64_ds { unsigned long __unused1; unsigned long __unused2; }; +#else +struct shmid64_ds { + struct ipc64_perm shm_perm; /* operation perms */ + size_t shm_segsz; /* size of segment (bytes) */ + unsigned long shm_atime; /* last attach time */ + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_ctime; /* last change time */ + __kernel_pid_t shm_cpid; /* pid of creator */ + __kernel_pid_t shm_lpid; /* pid of last operator */ + unsigned long shm_nattch; /* no. of current attaches */ + unsigned short shm_atime_high; + unsigned short shm_dtime_high; + unsigned short shm_ctime_high; + unsigned short __unused1; +}; +#endif struct shminfo64 { unsigned long shmmax; From patchwork Thu Apr 19 14:37:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133815 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp881658edd; Thu, 19 Apr 2018 07:40:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx49BZmCB+bcBO9+qPdFVBISx1qeS77IDXhBq0TXy8P5eLbimbdNuMIpngoqrEXbmGVrcJIGe X-Received: by 10.98.220.78 with SMTP id t75mr5445599pfg.139.1524148814122; Thu, 19 Apr 2018 07:40:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148814; cv=none; d=google.com; s=arc-20160816; b=NjOvFPWSlBu+Qrf/8ohpY/e0sVJOlblcKFBaWxYE4en4IDLXw5LngnW4qKikpDMLnn lBrfsAVwCEoq5+/pxbDfNQ50l4PCLAjzIdrk1hT6J0HYH8cHIMO4vzgGS666V5UIj+8x BSWheo/kAcCD/E83N3U76QLVjrZMeQWFqQS0sAfFOzHAym5hhVY6TI1FSVxro2TcuS3L tjn/0cNZ0aQU4RHwfZCS9ELr5GkBo8CPLekd80kMDN27S7Yi8hnEjwvTAQsZx22wWNAv +GGme0YfRxaw0cUs4Yjzokk6YKEsLbm848d6OEpI0U4A9c42+xeBj+c3REiHRg3k/8Z+ 6O7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=hvATQR0ZrNPd7AeCP+oGY8WKaIOjWlIsVyUk7xk6D9w=; b=fVGxhtDe9wFcmoBBvMWj+NJXfpa72D+uq408lHCs6vVKL0iPwKpZc6S3aZV3yr8xbQ DXJ/nhtWyU5ZF+Ipq2Mf8i/aqbEZ7ak1mCrWqRWjryd24D8t6cuWYTtCdZcQihN2fd0C wZ0TLKbiOVNwtJGsgeEd/Z1xp5c+6QsCOWwDFD0qOkDH9o62tUzDSnF3WtteHg02AGIj sVnNgCJ9MPmQC3iOT7n7hYVghX1kmJnmtM7N+bKEjT9kOmVPmfcfQUjyzYdha3+qMzHa iEyWiXFIUXO9LshM2lO6Oun+ifMLkW7j3H5yb+GICMkgTMeXJuBm6wWIb78feDIQe3kM lUZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25si2323202pgu.219.2018.04.19.07.40.13; Thu, 19 Apr 2018 07:40:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbeDSOkM (ORCPT + 29 others); Thu, 19 Apr 2018 10:40:12 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:33619 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753162AbeDSOjN (ORCPT ); Thu, 19 Apr 2018 10:39:13 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LfRd3-1ecHfM2PYf-00p5MG; Thu, 19 Apr 2018 16:37:53 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 07/17] y2038: x86: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:27 +0200 Message-Id: <20180419143737.606138-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:kr5T3sYJMDxHLG6BCKgJMRLERUUnififeq+jqPm5HLCsBc3KKjJ LdmMBTyXs2Bch1x1+jTRkJgMg1oo6rer0Ofx3S09R6VjFPrBfZBVNn4bDXZJ9ZprRWsSrtL vmdN8MhR2khm3/N02qcosa3Eaqk02jJ/qbRE66FEPXOg3jLbiAtjgpdiZmyX4dQu5pXcxp+ zIq/c2Mgaknxi6xJpdciA== X-UI-Out-Filterresults: notjunk:1; V01:K0:GbQub4+8MnE=:y+JOVso3O/uAXnAGYxBtA5 HfAisuk1Y/lSUt0cybR2y3nSmZ4gVeW+f8FymwqiLAe92V1iF/c2eWYVq4sTZWM3Ab5j8afpw Xq/6yfKiZs7f8LWQnN87iHqxiREK0LclrBEfdKK+yf8BnOSTXUoWemzDz8QQI2q3YPpX51Are 3FMnWoNg+x63SCmDReXomvoHSNywfQC4Zdk8oN1nAh5b63Y7gZGBOv9mpg6ntlbDIcmi42qqA 1AQt5jpv/GFQd4k6OxSko8IL5ZugTJIWWpaP7givaIZIz6t1wsR14kuHnenaFKEqyjkOUsBrc n8ovl7Z8+QkV/4LCkYBl/BSdP5BEWWhPisw7lRo39s5UxeDtLIvJ2i92Lgqj2LBGOfKvuhFBb 9GzLIVQdXW/j7E7S146jAH9q6jHb8dvDuZ40DK3LG4H3Df+oNzB/cGcZQvyAc75S6iY6OWoLp vmMFAqCXP73DH+AgwHJ5JftQTUVmx/UALouNlWuwV1AHxqB+uyBIjaa0hdRMBxQvee/gJ4qQc Y/Oe9ZTjOpi7Xk1pCskgIaJyID4DLw0tWfsMSjaPpG162OcemGp+kCGh9DvAnPGzfH8/kpDUI I/BX5me2eywHqv0Z+YsmjU23fYzh42ovAIBdmHX3fP9ldmFfwlowcXn47TYcuvSjCSCgDBOjo dAb5LhSck1KqK+uinAPJhjxOpx8vKMaAVI4aZNrYpBmhRxpTbSLI7CGlwYU5RACeM/AW8nzOK cOFj3sMWWTAfDbeezHDxLS2BHne+YWwfiylVOA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This extends the x86 copy of the sysvipc data structures to deal with 32-bit user space that has 64-bit time_t and wants to see timestamps beyond 2038. Fortunately, x86 has padding for this purpose in all the data structures, so we can just add extra fields. With msgid64_ds and shmid64_ds, the data structure is identical to the asm-generic version, which we have already extended. For some reason however, the 64-bit version of semid64_ds ended up with extra padding, so I'm implementing the same approach as the asm-generic version here, by using separate fields for the upper and lower halves of the two timestamps. Signed-off-by: Arnd Bergmann --- arch/x86/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/x86/include/uapi/asm/Kbuild | 5 ++++- arch/x86/include/uapi/asm/msgbuf.h | 1 - arch/x86/include/uapi/asm/sembuf.h | 11 ++++++++++- arch/x86/include/uapi/asm/shmbuf.h | 1 - 5 files changed, 30 insertions(+), 20 deletions(-) delete mode 100644 arch/x86/include/uapi/asm/msgbuf.h delete mode 100644 arch/x86/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index 7cd314b71c51..fb97cf7c4137 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h @@ -134,10 +134,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - compat_time_t sem_otime; - compat_ulong_t __unused1; - compat_time_t sem_ctime; - compat_ulong_t __unused2; + compat_ulong_t sem_otime; + compat_ulong_t sem_otime_high; + compat_ulong_t sem_ctime; + compat_ulong_t sem_ctime_high; compat_ulong_t sem_nsems; compat_ulong_t __unused3; compat_ulong_t __unused4; @@ -145,12 +145,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - compat_time_t msg_stime; - compat_ulong_t __unused1; - compat_time_t msg_rtime; - compat_ulong_t __unused2; - compat_time_t msg_ctime; - compat_ulong_t __unused3; + compat_ulong_t msg_stime; + compat_ulong_t msg_stime_high; + compat_ulong_t msg_rtime; + compat_ulong_t msg_rtime_high; + compat_ulong_t msg_ctime; + compat_ulong_t msg_ctime_high; compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; compat_ulong_t msg_qbytes; @@ -163,12 +163,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; compat_size_t shm_segsz; - compat_time_t shm_atime; - compat_ulong_t __unused1; - compat_time_t shm_dtime; - compat_ulong_t __unused2; - compat_time_t shm_ctime; - compat_ulong_t __unused3; + compat_ulong_t shm_atime; + compat_ulong_t shm_atime_high; + compat_ulong_t shm_dtime; + compat_ulong_t shm_dtime_high; + compat_ulong_t shm_ctime; + compat_ulong_t shm_ctime_high; compat_pid_t shm_cpid; compat_pid_t shm_lpid; compat_ulong_t shm_nattch; diff --git a/arch/x86/include/uapi/asm/Kbuild b/arch/x86/include/uapi/asm/Kbuild index 322681622d1e..d1d883e304f7 100644 --- a/arch/x86/include/uapi/asm/Kbuild +++ b/arch/x86/include/uapi/asm/Kbuild @@ -2,7 +2,10 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += bpf_perf_event.h +generic-y += msgbuf.h +generic-y += poll.h +generic-y += shmbuf.h + generated-y += unistd_32.h generated-y += unistd_64.h generated-y += unistd_x32.h -generic-y += poll.h diff --git a/arch/x86/include/uapi/asm/msgbuf.h b/arch/x86/include/uapi/asm/msgbuf.h deleted file mode 100644 index 809134c644a6..000000000000 --- a/arch/x86/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/arch/x86/include/uapi/asm/sembuf.h b/arch/x86/include/uapi/asm/sembuf.h index cabd7476bd6c..89de6cd9f0a7 100644 --- a/arch/x86/include/uapi/asm/sembuf.h +++ b/arch/x86/include/uapi/asm/sembuf.h @@ -8,15 +8,24 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values + * + * x86_64 and x32 incorrectly added padding here, so the structures + * are still incompatible with the padding on x86. */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ +#ifdef __i386__ + unsigned long sem_otime; /* last semop time */ + unsigned long sem_otime_high; + unsigned long sem_ctime; /* last change time */ + unsigned long sem_ctime_high; +#else __kernel_time_t sem_otime; /* last semop time */ __kernel_ulong_t __unused1; __kernel_time_t sem_ctime; /* last change time */ __kernel_ulong_t __unused2; +#endif __kernel_ulong_t sem_nsems; /* no. of semaphores in array */ __kernel_ulong_t __unused3; __kernel_ulong_t __unused4; diff --git a/arch/x86/include/uapi/asm/shmbuf.h b/arch/x86/include/uapi/asm/shmbuf.h deleted file mode 100644 index 83c05fc2de38..000000000000 --- a/arch/x86/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1 +0,0 @@ -#include From patchwork Thu Apr 19 14:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133812 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp715060ljf; Thu, 19 Apr 2018 07:39:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx49d/Miq9N8tUFiquvOO3iNgiL7lbgARrKInbMKY7MuNPqJpj1+Zn0mdkiYayjivrt8lfWzg X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr6327044plb.226.1524148780502; Thu, 19 Apr 2018 07:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148780; cv=none; d=google.com; s=arc-20160816; b=oL6VgZ79vC6NofUp2AxqSx7kIjjg5Do3JRNEbiy9NMmj7hKkJCVDSVf+nou2gShuLS k64YgkXcYDgM1MUIeAindg5TbIoxXHCsa6Vatx0BOQ7RnGAbcZiBtaIf/30qy7zqdSi3 poo179BINX5hhA3TixJFD3ZfLj1AO8uV/Y1zZnzBYs2BWvZEjT88F3Bj08qKpDe7CZju bnHLy+42BooMF/b4j4ugthuXp/dM/YVUzgIngzI9U8XrbsN/0qKNasnR9t3dOMol3Lo0 5Eii3LMEhDvBOkGajLeTAeBRYIXCwzaJXbE9sHFSyWXhbLvgsnH6j3kNQqzGwr7Yrseu Yndw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Wg9nx2Y4STPDXVNbfVvjsEPGIiZUgNxg/aEdD3j8C7w=; b=CBL404RL4J3iA1GzV4RiwQ7l9/oHEPguI9tfdlFr/OXqABSkNpiErUBK7fI041uBj5 xCB1IB9sAc1R90JlzFpXCrEyjH+oGo3xu6hYc61yL31qpX3NvnfrHZaDn8qwNhaqHTIR vRRKzx7ZUhhKguecZWTLkrcTO8BZ7EixxFCxoQh6TI2mTnD6QCDTaDhESpdeGgLB5T2t L7lMY5Lp1k4plwvzzxA02aw6pn8nmRlqH5UHnbeWMjAM/I+uA6nRCFhNuqQchN8ycPEy 20RkuD2MA7ry1jrjJgJ1hijE0ifD0Nw0fD7GLyNIqk/KhBnPNnRO2VMH9J1cgXkUIL3S Fplg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si3611326plk.397.2018.04.19.07.39.40; Thu, 19 Apr 2018 07:39:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673AbeDSOjh (ORCPT + 29 others); Thu, 19 Apr 2018 10:39:37 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50171 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753575AbeDSOjW (ORCPT ); Thu, 19 Apr 2018 10:39:22 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LrsLe-1eQWCo03SQ-013bHD; Thu, 19 Apr 2018 16:37:56 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 10/17] y2038: powerpc: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:30 +0200 Message-Id: <20180419143737.606138-11-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:RCd5sWbjjJLXnkZMtAoyJ7y6nM6w16+IHNA/SHAoP8x60OtCrTu xYFyOL2cctNKPSsJ8+XehyGvZPwhGChyhaG42mejxHzZ7wQIsPQlBHYy+tjfj//5BKnTfw8 c278yelwa7Kw0L0KGB3DSeI8npmUvt+YbhkskWKB8QOdYYFzL12DeEO4l1ORZxP8X+ASpAN RwRe6y47/RGushgpBSa1Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:B6FxIiDaqlM=:VUZGWFRlSa4W6ocQ75t4iQ e7eZ0H2yFtpKT/Hei9Z/XXGMzg8BdMKRE3qOc160oCcx6HKvgXffELdPmEZHyptm5VR3Qpc9x 5X5H/mE316Qn7VJe6fVAwTzt7OvEx5ZAIQaecMyw3S0SLE1fTHa8OqvlcSUUMB4l966PGutpQ vklonlggKU2uv1IdxG0sePYqkVB4bkmIZ7e/gUN3Dqg12RJcmAkDrqj2VQfpHTz976S499zI6 8zOtarGa2yM4RbKfzc8UPTt0TN96v7aN7prKTII7g1Wmr5zfKDtV5cIrWe8oi45iAZrGpTdgO mhLH5uLEpkXjU8NFRnWS4iSYaSf+h347t9iiSoZEZ9HV9uqWROOfWg39XmqBB7Pl+PQIFglJS p8ZUbFxSSwqjTo4ROK6tbMhTwVKgchC3ugzrh8PaUExk+LhaReoYW/AjzKYbPHJ6XHFt38+x+ M8HcliNtW60eRPgJiRmQKm5HzLzbxKI7vrSaDYlflrsHv8zjsDD6wxp3Il+iyDi3T7i8dn+G0 p94W1U92xw0yFbUmdQv3sjb33kZ9Ba/gbAhQCK7dxIniDyp6E0A0n3Nq0MnjrWUtrZmoVSg8W Aoxa2WnvY/uU/wgbmdNWcfASCqgsMg4IS5UxE8QaZSc+6mqDORWqxaVHeQZFP6qK4NEidQXrX Fs0vNJtvOo+0S1uESzlMTAfovL228Z7E9/QRhlarn2ok1MqelqE1cgQ2PUfDZvHpAnGeS7jmk iRn9GrDYuVhYupMujd+JGspAP617wW8JgSSCeg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org powerpc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. powerpc has the same definition as parisc and sparc, but now also supports little-endian mode, which is now wrong because the padding is made for big-endian user space. This takes just take the same approach here that we have for the asm-generic headers and adds separate 32-bit fields for the upper halves of the timestamps, to let libc deal with the mess in user space. Signed-off-by: Arnd Bergmann --- arch/powerpc/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/powerpc/include/uapi/asm/msgbuf.h | 18 +++++++++--------- arch/powerpc/include/uapi/asm/sembuf.h | 14 +++++++------- arch/powerpc/include/uapi/asm/shmbuf.h | 19 ++++++++----------- 4 files changed, 40 insertions(+), 43 deletions(-) -- 2.9.0 diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index b4773c81f7d5..85c8af2bb272 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h @@ -162,10 +162,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - unsigned int __unused1; - compat_time_t sem_otime; - unsigned int __unused2; - compat_time_t sem_ctime; + unsigned int sem_otime_high; + unsigned int sem_otime; + unsigned int sem_ctime_high; + unsigned int sem_ctime; compat_ulong_t sem_nsems; compat_ulong_t __unused3; compat_ulong_t __unused4; @@ -173,12 +173,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - unsigned int __unused1; - compat_time_t msg_stime; - unsigned int __unused2; - compat_time_t msg_rtime; - unsigned int __unused3; - compat_time_t msg_ctime; + unsigned int msg_stime_high; + unsigned int msg_stime; + unsigned int msg_rtime_high; + unsigned int msg_rtime; + unsigned int msg_ctime_high; + unsigned int msg_ctime; compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; compat_ulong_t msg_qbytes; @@ -190,12 +190,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; - unsigned int __unused1; - compat_time_t shm_atime; - unsigned int __unused2; - compat_time_t shm_dtime; - unsigned int __unused3; - compat_time_t shm_ctime; + unsigned int shm_atime_high; + unsigned int shm_atime; + unsigned int shm_dtime_high; + unsigned int shm_dtime; + unsigned int shm_ctime_high; + unsigned int shm_ctime; unsigned int __unused4; compat_size_t shm_segsz; compat_pid_t shm_cpid; diff --git a/arch/powerpc/include/uapi/asm/msgbuf.h b/arch/powerpc/include/uapi/asm/msgbuf.h index 65beb0942500..2b1b37797a47 100644 --- a/arch/powerpc/include/uapi/asm/msgbuf.h +++ b/arch/powerpc/include/uapi/asm/msgbuf.h @@ -10,18 +10,18 @@ struct msqid64_ds { struct ipc64_perm msg_perm; -#ifndef __powerpc64__ - unsigned int __unused1; -#endif +#ifdef __powerpc64__ __kernel_time_t msg_stime; /* last msgsnd time */ -#ifndef __powerpc64__ - unsigned int __unused2; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#ifndef __powerpc64__ - unsigned int __unused3; -#endif __kernel_time_t msg_ctime; /* last change time */ +#else + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ +#endif unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ unsigned long msg_qbytes; /* max number of bytes on queue */ diff --git a/arch/powerpc/include/uapi/asm/sembuf.h b/arch/powerpc/include/uapi/asm/sembuf.h index 8f393d60f02d..3f60946f77e3 100644 --- a/arch/powerpc/include/uapi/asm/sembuf.h +++ b/arch/powerpc/include/uapi/asm/sembuf.h @@ -15,20 +15,20 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values + * - 2 miscellaneous 32/64-bit values */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ #ifndef __powerpc64__ - unsigned long __unused1; -#endif + unsigned long sem_otime_high; + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime_high; + unsigned long sem_ctime; /* last change time */ +#else __kernel_time_t sem_otime; /* last semop time */ -#ifndef __powerpc64__ - unsigned long __unused2; -#endif __kernel_time_t sem_ctime; /* last change time */ +#endif unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused3; unsigned long __unused4; diff --git a/arch/powerpc/include/uapi/asm/shmbuf.h b/arch/powerpc/include/uapi/asm/shmbuf.h index deb1c3e503d3..b591c4d7e4c5 100644 --- a/arch/powerpc/include/uapi/asm/shmbuf.h +++ b/arch/powerpc/include/uapi/asm/shmbuf.h @@ -16,25 +16,22 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ -#ifndef __powerpc64__ - unsigned long __unused1; -#endif +#ifdef __powerpc64__ __kernel_time_t shm_atime; /* last attach time */ -#ifndef __powerpc64__ - unsigned long __unused2; -#endif __kernel_time_t shm_dtime; /* last detach time */ -#ifndef __powerpc64__ - unsigned long __unused3; -#endif __kernel_time_t shm_ctime; /* last change time */ -#ifndef __powerpc64__ +#else + unsigned long shm_atime_high; + unsigned long shm_atime; /* last attach time */ + unsigned long shm_dtime_high; + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_ctime_high; + unsigned long shm_ctime; /* last change time */ unsigned long __unused4; #endif size_t shm_segsz; /* size of segment (bytes) */ From patchwork Thu Apr 19 14:37:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133807 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714444ljf; Thu, 19 Apr 2018 07:38:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/k9XzJSG7wxhYvuTb89vPwDijhkgtHAy1hL58w7kj15j/RmMYLdybpxhqsVgF+zt8+vk1H X-Received: by 10.99.110.5 with SMTP id j5mr5500364pgc.246.1524148739250; Thu, 19 Apr 2018 07:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148739; cv=none; d=google.com; s=arc-20160816; b=xcXaUl77leNWfYwHkiW7dFpI3j7AbhVpiBMnnsFtulJ2A3Dgj1CeasM2Iua3bNQK8i CJqksIUQW9gqF4hNDRLA6WxcVR/UqFVlSD3QG2gG2XyCPLhmFHge24rH5YVSQYbdNAdg zB91hVRrNytfj7MfkCK5yJAWwuf/W0T0i507OOdTULQK9ZXYGBmOPNaMIBRUDf7NrpD5 kKHhTawcvFSWhmB3Xnph9EK1cV7u1RIFYz88OdMO4uZeBavATu8mhOu/esd8/5kdffUA QTNEExgrQLQaLOZ930+kNTnWWQO0wc0awqGeOz4uP1vQKE2koGoi2sqweFbQbJCzTgeg IXzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=tDLLq1rZ8gjNjajzQVh83qrIv0Gx3AhXHDdxzmCdFao=; b=VEyP/aXStAOrcNT/fdvT9VCnoA07mgcxxAvu8pVhEUDz3rP/Kde54FRozhTmTFzuhi Jc8w97x52Oc7bx9qYLucjuQXSf2jfXMT3MN/bToHAOdzOc2rqbo9YjhwNsvm0EzNo8wh VQVzMWbqayAuARYxej6nfmm1x6S27vDCtjhs8Sds8HMGHDPkkEaN0gENW4ilWVv5JBpm 6W7kEm6wVYkKEji618N+rc0M7AjqMEq1CO707KIgJ774MRyVPtA/HCzSGuKFj6uUNBif Yf059OJaXYuUnFqyplPeRvV35YdYVDS2ZVY7ouXKihlkm1DnBwIG8ICWYe+RszD1wFHh p0Jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6-v6si208518pln.382.2018.04.19.07.38.58; Thu, 19 Apr 2018 07:38:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbeDSOiw (ORCPT + 29 others); Thu, 19 Apr 2018 10:38:52 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57809 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753041AbeDSOis (ORCPT ); Thu, 19 Apr 2018 10:38:48 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LiCmZ-1ef2ox3UUF-00nRT0; Thu, 19 Apr 2018 16:37:57 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 11/17] y2038: xtensa: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:31 +0200 Message-Id: <20180419143737.606138-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:RczaO3VV23TE3Izuu2/VkNiF2tyQuFwKmqpdc/YL8CBp5WcSs8f S7w4zRSC7dL3lOomrg8jY5w0v3IxpvqSS7Lbfqff8ue6sJ/ZQatDJuSF2MRU1tYwXvOdNJS aHON6cCFUfZD+yjgNUM7nvDusVz7cDIPr1KhPsst8TU6KCPWrxo2GlNgYH8c27mmdwF1AVj 3eubHpola/+KJpp6otljg== X-UI-Out-Filterresults: notjunk:1; V01:K0:sGqednWy7yc=:hPjUxreVN+jMxHrmqkVeme CBkfadJTJCYmgZqAhzXYUDp39EG8pIX2OFLJx3XjruGECnE4tkmSJVhAeqwM2VNIioh75Po5s qeYKHwwAeSlJwzVvzghXAkUnMVvBLu/3lSYCClj031U3/Heja6iU54ufXNcH6G/2iwnTA12Cy bXxw1IaIjNJaccdpwF6wZIxRS4VloIznwkKKBEYVLY2+qftf+uIRMz9MoyrgpM/AdpB6DVKuX rbw91LOaOyKg7J7ndthqhraWjV4FSfMGxAWbG0kOZrbBlXEORFEj7BHPzLeg+N61tzIoOVsCB xH/qQstreXvkAg2sMYA2lmXMadM9Y1TBVO2wsQ4mSX5vVncwSn4+MhyCAiwaS/5k8wK+16nYK Em3eNe0AXH52kDvb6Mt2YlSmz5OSL9JMW41rc4vii92nQudH32JWgRZFqRLwwl5UPgCkOKxeq 7riz0YcV/+DvL1hVfjSSNl9WJEPzFmr5jaQ3R3d9l4Oepi6JNl2g+sxt6lbSFRuTAKCmo2Cc2 0h9eHMnNgkXZi/TEYQoJd9woSsHjiwXN1HEXslFy/In0ifQYPFHXyRgbPaU0TQS4ljeT5J57G eds8PbX1Ck+s5CT+/9D/OjwjYxlpTUOF5vAOTT5hQpdyCqWk+EoLP7tVgZ5hTVL2HlYNbDkx2 dhMBK1XXpGuirQJfPrnT69luslGgheJ0sjrfRLh0TrtbYkbZGRL+1bPyyiVTds+LjqcHeWzhc TVrrrT91LDj0VLpMlScZXyKM6CRtZPdXg1lBLQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org xtensa, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. xtensa tries hard to define the structures so they work in both big-endian and little-endian systems with padding on the right side. However, they only succeeded for for two of the three structures, and their struct shmid64_ds ended up being defined in two identical copies, and the big-endian one is wrong. This takes just take the same approach here that we have for the asm-generic headers and adds separate 32-bit fields for the upper halves of the timestamps, to let libc deal with the mess in user space. Signed-off-by: Arnd Bergmann --- arch/xtensa/include/uapi/asm/msgbuf.h | 25 ++++++++++++----------- arch/xtensa/include/uapi/asm/sembuf.h | 17 ++++++++-------- arch/xtensa/include/uapi/asm/shmbuf.h | 37 ++++++++--------------------------- 3 files changed, 28 insertions(+), 51 deletions(-) -- 2.9.0 diff --git a/arch/xtensa/include/uapi/asm/msgbuf.h b/arch/xtensa/include/uapi/asm/msgbuf.h index 36e2e103ca38..d6915e9f071c 100644 --- a/arch/xtensa/include/uapi/asm/msgbuf.h +++ b/arch/xtensa/include/uapi/asm/msgbuf.h @@ -7,7 +7,6 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values * * This file is subject to the terms and conditions of the GNU General @@ -21,19 +20,19 @@ struct msqid64_ds { struct ipc64_perm msg_perm; #ifdef __XTENSA_EB__ - unsigned int __unused1; - __kernel_time_t msg_stime; /* last msgsnd time */ - unsigned int __unused2; - __kernel_time_t msg_rtime; /* last msgrcv time */ - unsigned int __unused3; - __kernel_time_t msg_ctime; /* last change time */ + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ #elif defined(__XTENSA_EL__) - __kernel_time_t msg_stime; /* last msgsnd time */ - unsigned int __unused1; - __kernel_time_t msg_rtime; /* last msgrcv time */ - unsigned int __unused2; - __kernel_time_t msg_ctime; /* last change time */ - unsigned int __unused3; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_stime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_rtime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_ctime_high; #else # error processor byte order undefined! #endif diff --git a/arch/xtensa/include/uapi/asm/sembuf.h b/arch/xtensa/include/uapi/asm/sembuf.h index f61b6331a10c..09f348d643f1 100644 --- a/arch/xtensa/include/uapi/asm/sembuf.h +++ b/arch/xtensa/include/uapi/asm/sembuf.h @@ -14,7 +14,6 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values * */ @@ -27,15 +26,15 @@ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ #ifdef __XTENSA_EL__ - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused1; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long __unused2; + unsigned long sem_otime; /* last semop time */ + unsigned long sem_otime_high; + unsigned long sem_ctime; /* last change time */ + unsigned long sem_ctime_high; #else - unsigned long __unused1; - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused2; - __kernel_time_t sem_ctime; /* last change time */ + unsigned long sem_otime_high; + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime_high; + unsigned long sem_ctime; /* last change time */ #endif unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused3; diff --git a/arch/xtensa/include/uapi/asm/shmbuf.h b/arch/xtensa/include/uapi/asm/shmbuf.h index 26550bdc8430..554a57a6a90f 100644 --- a/arch/xtensa/include/uapi/asm/shmbuf.h +++ b/arch/xtensa/include/uapi/asm/shmbuf.h @@ -4,10 +4,10 @@ * * The shmid64_ds structure for Xtensa architecture. * Note extra padding because this structure is passed back and forth - * between kernel and user space. + * between kernel and user space, but the padding is on the wrong + * side for big-endian xtensa, for historic reasons. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values * * This file is subject to the terms and conditions of the GNU General Public @@ -20,42 +20,21 @@ #ifndef _XTENSA_SHMBUF_H #define _XTENSA_SHMBUF_H -#if defined (__XTENSA_EL__) struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - unsigned long __unused1; - __kernel_time_t shm_dtime; /* last detach time */ - unsigned long __unused2; - __kernel_time_t shm_ctime; /* last change time */ - unsigned long __unused3; + unsigned long shm_atime; /* last attach time */ + unsigned long shm_atime_high; + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_dtime_high; + unsigned long shm_ctime; /* last change time */ + unsigned long shm_ctime_high; __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ unsigned long shm_nattch; /* no. of current attaches */ unsigned long __unused4; unsigned long __unused5; }; -#elif defined (__XTENSA_EB__) -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - unsigned long __unused1; - __kernel_time_t shm_dtime; /* last detach time */ - unsigned long __unused2; - __kernel_time_t shm_ctime; /* last change time */ - unsigned long __unused3; - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused4; - unsigned long __unused5; -}; -#else -# error endian order not defined -#endif - struct shminfo64 { unsigned long shmmax; From patchwork Thu Apr 19 14:37:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133811 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714866ljf; Thu, 19 Apr 2018 07:39:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+NUkLrBlYTfhjYGUeAK7unAJotXUTIi0L8f/5TMGVX8XMTEZIEXUhAdLww5CT6cN22IeX2 X-Received: by 2002:a17:902:362:: with SMTP id 89-v6mr6556095pld.270.1524148767416; Thu, 19 Apr 2018 07:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148767; cv=none; d=google.com; s=arc-20160816; b=MyxYLZ9c38weByiwvwoSzFev26Dzc0UbiHdk/ca7RXZnrHQhelC6WBEY5RO9vL5ID+ sqquL0Rjsl2uFyE6ryWNTuIRcLnEN4SNyUWQ2qKrzyt7N4AouXEsVTUsNxgF38XWSNaD uj7VryTkPRvpop9UhulGkTKHNJki7s5V4rGb41eh1KthK2eTvbYZkhBePYh6eQFcXmNG Gn59T+p3qxwM99y2DTU1pWa1DSPzzAGZ/ZHeUH88apqS/10FdnR2UZ/ylIwSvXv3762O qhxUG1JL+jckwzm09TcyQf6drKXq1VuMhtAIaBxOGAKupVP6qm02s5cXKV1u1b8yJsoy 6zCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=O5FDEUvv+T9xGV1OaSiciU6iSJkdzsowujXxm6xlkpI=; b=GJo1kKOMMN8AJ4N+n1ZglnxELifYE3nSCuxXbdk4rN7AOS6xNt9dliKvwP8OrDN6sf H+G8ltg3xOgbjMF3nEWqB5dVKuvW4JB98AoVI4WisTTiIEbR+wpz+tlrWaAFryZvHcSY GZ/KJ0DgxhKYu+S4M+/pz1VuVgtbsK12J0WAuYwfei+U+xasqMxTqTu1If78F+Vspr6G kQmk5Y2N6/IHpkUSwdyNBVsMq6z9ZkGSbiZO6L1gCKasbbVeMqrmdTp4A3CD3Oa8Wf9o otJmhKqP/CyQT+2ts3k0LL4mjjG881fMTFySjP9Yjt77rV+R6p2NLRNWZPB1hiWk0B1c gRHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1si3252363pfm.62.2018.04.19.07.39.27; Thu, 19 Apr 2018 07:39:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753615AbeDSOjZ (ORCPT + 29 others); Thu, 19 Apr 2018 10:39:25 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:54897 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570AbeDSOjU (ORCPT ); Thu, 19 Apr 2018 10:39:20 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M2dqH-1eJgR81PpF-00sN80; Thu, 19 Apr 2018 16:37:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 14/17] y2038: ipc: Use __kernel_timespec Date: Thu, 19 Apr 2018 16:37:34 +0200 Message-Id: <20180419143737.606138-15-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:ZKYAuxGMajmvaIzfwCYhsflzK2XPcYERcA468TieefZU0vLGepf 2Wkz/HafOKlcUAFLzYD6udPmDsM4igRQ/uZeeH4BUCYDLRKQrHXMrNXHy81qCzVtqu8vyib Ej60fgyqLctnHauTwS87L0KUPZ0gsh/r+GKkP4ajkDdAwnGI2bENXQy0ps800t8LhB1TklK +2gYPRu7eB9PsIa0tiEZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:l+iPWJPC3Ww=:pRP4OdoG+L/xHdLq5sx8nH ZEjmszxrElDS4mrhmDfVuwsWQQIcmXTxMPYYJPBfywlkPTOYDOkBVvUid83ExOG1NpoInac9+ NtnVPiNQdiU7fvJF4Bu/aRCqCJRcPjqPNpFpVQyYxb/UlYSPv7xKcz86uSBGbjUsErUzaAuox ETVykYxFODKrZ/JGrlu7009d58rwCKzqYh/popmsB3odf/J6+JFpGIanjwdMxvkbBX8Dd7rc8 7TiXdK5LhYgp9iKvzwAylR5h8EE5AfQH3V5VBMXdVYN/uW8KpG6ccWvyO+gzs1nlTa40Dv8MO BHUUxDny8CwA+BNw8Ayi+T40Ggj19duYs/p9DE3rakubI5NgETmKB772YZAoogzo6HoIh5jkU rNBbirHafjlRZhzKyik607r2/XaFxVeHqn+D7Ph02hqPZX4EiNAYsDt7B80zrOOJ/q8C0MDbs vZycorTJplY1842oJYoEPJCDfPgPOsMcNiINo0lcmV/IYgnaKIkaDvT/MYcIFd4s3k9fhn0g9 SJSXKjp1om6EvM11S9zOfU1BFbRjCNDaDCfEisWPkQr/cM9oFmnYho3Ug/KCfUstMgnVfAK0P 1xzCQEFOWa5MvXDU2YofbMMUZtGN/MlrXWZaQOWNtzthMgx+rk9FNHPIvzEKNss8QxgufJwuJ cnfKGd632K9MeC8AFcDTKypzd2LavyAtd7ZQP3YyC8D1F7nyEaRrSOMz0enMG1TDWCWuOEgJ7 Wx//PEk5yXaiY/kbl8qxtMqKCS+jk852IQHwWg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a preparatation for changing over __kernel_timespec to 64-bit times, which involves assigning new system call numbers for mq_timedsend(), mq_timedreceive() and semtimedop() for compatibility with future y2038 proof user space. The existing ABIs will remain available through compat code. Signed-off-by: Arnd Bergmann --- include/linux/syscalls.h | 6 +++--- ipc/mqueue.c | 6 +++--- ipc/sem.c | 4 ++-- ipc/util.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index c9a2a2601852..b92cb79d38c3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -680,8 +680,8 @@ asmlinkage long sys_sysinfo(struct sysinfo __user *info); /* ipc/mqueue.c */ asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr); asmlinkage long sys_mq_unlink(const char __user *name); -asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); -asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); +asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec __user *abs_timeout); +asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct __kernel_timespec __user *abs_timeout); asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); @@ -698,7 +698,7 @@ asmlinkage long sys_semget(key_t key, int nsems, int semflg); asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg); asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops, unsigned nsops, - const struct timespec __user *timeout); + const struct __kernel_timespec __user *timeout); asmlinkage long sys_semop(int semid, struct sembuf __user *sops, unsigned nsops); diff --git a/ipc/mqueue.c b/ipc/mqueue.c index a808f29d4c5a..9610afcfa2e5 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -691,7 +691,7 @@ static void __do_notify(struct mqueue_inode_info *info) wake_up(&info->wait_q); } -static int prepare_timeout(const struct timespec __user *u_abs_timeout, +static int prepare_timeout(const struct __kernel_timespec __user *u_abs_timeout, struct timespec64 *ts) { if (get_timespec64(ts, u_abs_timeout)) @@ -1128,7 +1128,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, size_t, msg_len, unsigned int, msg_prio, - const struct timespec __user *, u_abs_timeout) + const struct __kernel_timespec __user *, u_abs_timeout) { struct timespec64 ts, *p = NULL; if (u_abs_timeout) { @@ -1142,7 +1142,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, size_t, msg_len, unsigned int __user *, u_msg_prio, - const struct timespec __user *, u_abs_timeout) + const struct __kernel_timespec __user *, u_abs_timeout) { struct timespec64 ts, *p = NULL; if (u_abs_timeout) { diff --git a/ipc/sem.c b/ipc/sem.c index 8935cd8cf166..b951e25ba2db 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -2176,7 +2176,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, } long ksys_semtimedop(int semid, struct sembuf __user *tsops, - unsigned int nsops, const struct timespec __user *timeout) + unsigned int nsops, const struct __kernel_timespec __user *timeout) { if (timeout) { struct timespec64 ts; @@ -2188,7 +2188,7 @@ long ksys_semtimedop(int semid, struct sembuf __user *tsops, } SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, - unsigned int, nsops, const struct timespec __user *, timeout) + unsigned int, nsops, const struct __kernel_timespec __user *, timeout) { return ksys_semtimedop(semid, tsops, nsops, timeout); } diff --git a/ipc/util.h b/ipc/util.h index acc5159e96d0..975c6de2df9d 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -251,7 +251,7 @@ static inline int compat_ipc_parse_version(int *cmd) /* for __ARCH_WANT_SYS_IPC */ long ksys_semtimedop(int semid, struct sembuf __user *tsops, unsigned int nsops, - const struct timespec __user *timeout); + const struct __kernel_timespec __user *timeout); long ksys_semget(key_t key, int nsems, int semflg); long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg); long ksys_msgget(key_t key, int msgflg);