From patchwork Thu Apr 19 14:37:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133814 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp715427ljf; Thu, 19 Apr 2018 07:40:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EaDY9ulMCatQcnj1wtaBM9n1wrxDrz/eWgx8sMoTeEKSJK/b6cM9IkGoehCV51u1S2bPa X-Received: by 10.101.72.140 with SMTP id n12mr5438484pgs.155.1524148803743; Thu, 19 Apr 2018 07:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148803; cv=none; d=google.com; s=arc-20160816; b=tjPkEAUF1KXnFB78tV0W0qAzuYGW6EWGsbJVI4i+VFu4oK+fMPY6Ui+FklvHvvVz1D MlTSa5vcU441j3XIdfT+2/A+/RtMQUE7IKgD9Bj7EqddpNc7uuq8LHOod+m0tAqCF0di MlvGAeFe6ZFkkO6115fEsvhD6a4Qprl11VPQnu8jnngTQ5yBKIqb7PGo18ErWZcOZcfV Hfnyq8649dJSvN3tlW3BN1naxTBvquk+ocM603UDHdfYqvCr+h8T/6ycsac1IBkbvyVH nc6SJPOeyl0L/01Nn+L9hYlQksfTZjNmR9djvqMSohjrsL0FSj8x3pl9Xbs2WZG7Y2aH tSbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=Zyy+4cXFhgVVK8I1kRuewmcD1U57zCk+1InHA5hMdZ8=; b=gtoragg2/mcmicGYnSfjsNfdsJr0oWit6ilm6olfKkU6ud6Rnp+IfH2EcN8W30W+qO T8AZSDQexWkw7RY8wYiYRkdAtwWcCTjnt1nCb7gcTQpT7VsUsY7wJceS8oV92bBqqxu0 P4OLuvnbJuBHQy2s5VaLBTCgbBt+OuXn2UqLvpnwPghfewFNecUW8O2fK/Dn8MVQqL13 KFtFLlG9aQPrBJplPjdHweQktMs2iAtol7ICmaCxE7trHO+0fFNG6rtaAIhPVOQYiKz1 WRkEZbFyQ2eiwVC9bd+EAlBBy2wUdcKe+FEStgYayGoYWPE1D6Wr58sJ5Wa0+bL8tu5c 2zEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=HEbb9h2a; spf=pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91709-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w9si3336680pfl.268.2018.04.19.07.40.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=HEbb9h2a; spf=pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91709-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=JmB16x7kLJ3mA4rZMSYmPq/oW2pGWF+ MtipCDzM9qBITBGmqMMVQQWmbZE50qkPX3fUeGYrPei/JS9mOHWHicQIXB1fgURE tJzzuuWUsnnwqED+CkMgtBuP51ieOLRQDotxaOdfVXizMXeCYvd1SZYQl3wahtIG FrfVUI9ZcrJ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=FzkR6oWMFDCY967NqihUPxrPaCY=; b=HEbb9 h2aO5PpzFRuRvT/5AzkAv37lPy9wjxpnKRO34yKPQHkXboL1c+H4i1MAePrxuJma G6PEDMgSUAT7RKPIPnt3MSKTs4wfEeY0UCqxQPRfZzZUEQNTxchHMfo8XZ+HHsY7 O3TOKLW4hLGyaUDbN2JuTCBqtDHzjMt6DbnBPg= Received: (qmail 113394 invoked by alias); 19 Apr 2018 14:39:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113237 invoked by uid 89); 19 Apr 2018 14:39:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 08/17] y2038: parisc: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:28 +0200 Message-Id: <20180419143737.606138-9-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:vD4RPaVT6R0=:0O6PVWnhY80zW8xGWOVbjv 6HK08EPQq4k3wxVLiyh5nZHy0mBKzvaj4HEcu60UiHfdOxa1XsMIOuj2p5OdANSlvuW/CV/aX iRKbM5AMqsvBMPsSTeIVyxfSl3dzaUTKNnjHm7T4D67jrCAJeXZN4RmQBrAa3vv7S5etL6v5z NWTGjVLPJK3eUKJNa/EKj1rTjg7gwscmiYjLVjmxRVpHJ0AIthrJDOh4qlkrHZ6LJmH2YVtJh hX33hkMOsWnbgsg612fdcAT+Z6mw4jaZqgkwFCx9/m8KXoLRHED68u2D0A0TZafe02hRakXq1 aVw6t3LHmrqMZb0wgSjsNvARVWqLJh+o7C6TIcOkf2tomhJwv0y+SLMvkrMVsfRuyRQ3E1HEC whv+8CNaN3mn3vndIYq8MN/vVqgnnh7ayl6hbtQU7dx4N3lbT9QW2fGNSqeYGImCUMaTI+PMN g5JtV9LJQCTcnsIn6KOBxKi7bJhfB4zCTM2k4ZCeIQLZ6cSELWm02QY7C00uFjMAePj+mHTuK lUQ0CyGZCr3eL0mrHhd7NC4Z0jS/hPd3d2tY2awaQt01+qid5pfq4BygLU+OSWWZ1aN4VKCf0 0k/zGaQIGxonV4Wh2Zq7hnIqPMjVTBptoLbjkzrcH+Xkh/luLQN6zo1TumCMJC0VJ4A9OgSva XzZhplU3A3Cd0bDgVphQyvy8+dxNfQy61ktpAIgElHvkmXQPjIgMoBg2v+8Sx8/oJin7M9qM2 kPoZa4F8+wG2FBJiI1t+OdckKzBf4THwl+daDA== parisc, 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. Unlike most architectures, parisc actually succeeded in defining this right for big-endian CPUs, but as everyone else got it wrong, we just use the same hack everywhere. 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/parisc/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/parisc/include/uapi/asm/msgbuf.h | 33 ++++++++++++++++----------------- arch/parisc/include/uapi/asm/sembuf.h | 16 ++++++++-------- arch/parisc/include/uapi/asm/shmbuf.h | 19 ++++++++----------- 4 files changed, 48 insertions(+), 52 deletions(-) -- 2.9.0 diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 0cdfec8857bd..ab8a54771507 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h @@ -138,10 +138,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; @@ -149,12 +149,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; @@ -166,12 +166,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/parisc/include/uapi/asm/msgbuf.h b/arch/parisc/include/uapi/asm/msgbuf.h index b48b810e626b..6a2e9ab2ef8d 100644 --- a/arch/parisc/include/uapi/asm/msgbuf.h +++ b/arch/parisc/include/uapi/asm/msgbuf.h @@ -10,31 +10,30 @@ * between kernel and user space. * * 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 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t msg_stime; /* last msgsnd time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad3; -#endif __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; +#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 */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused1; + unsigned long __unused2; }; #endif /* _PARISC_MSGBUF_H */ diff --git a/arch/parisc/include/uapi/asm/sembuf.h b/arch/parisc/include/uapi/asm/sembuf.h index 746c5d86a9b1..3c31163b1241 100644 --- a/arch/parisc/include/uapi/asm/sembuf.h +++ b/arch/parisc/include/uapi/asm/sembuf.h @@ -10,21 +10,21 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ -#if __BITS_PER_LONG != 64 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t sem_otime; /* last semop time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ +#else + 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 __unused1; unsigned long __unused2; }; diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h index cd4dbce55d0b..c89b3dd8db21 100644 --- a/arch/parisc/include/uapi/asm/shmbuf.h +++ b/arch/parisc/include/uapi/asm/shmbuf.h @@ -10,25 +10,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 */ -#if __BITS_PER_LONG != 64 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t shm_atime; /* last attach time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t shm_dtime; /* last detach time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad3; -#endif __kernel_time_t shm_ctime; /* last change time */ -#if __BITS_PER_LONG != 64 +#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 int __pad4; #endif __kernel_size_t shm_segsz; /* size of segment (bytes) */