From patchwork Wed Apr 25 13:22: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: 134302 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp863868lji; Wed, 25 Apr 2018 06:24:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48jGvTmqD97aR+MukiOnUA3FcXal6pbIRTrIF19Q7IJ8FpjeS2+cKz1vtbn7XIBiwBhGZsp X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr23072852plj.150.1524662691636; Wed, 25 Apr 2018 06:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662691; cv=none; d=google.com; s=arc-20160816; b=GuqubPFkwHllECefhWlrzDaMuaPcwmuHatYEgLzp222N4ENYSV81tDgDPWEUMWD++9 pDwwjzkI+zwtMulghTmGCo7Btb+YfyJh9DEFGVMIRrAblcucLlEfPNyDb99oa/xgWEUV jdUh1A/KYOkClH0riJyDcsv5ZbOM9a8cGIDZ1agjIKnht0n7PjB+xhuOeS9sQFhSv5n5 wmF5PDPPWCZl3CfdOIjIGGRzp0m/WRtrXvMUdXXEEXOZzD2H4EVBcrWgPwM2HI57yI0Q Rc/sxZ29lhUkcUvgQ1rzxFVi1KOaqkh4vXeXnNWcTCfQXYVrWc/rojvqtrCD/w3h7FY1 xBKQ== 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=Zyy+4cXFhgVVK8I1kRuewmcD1U57zCk+1InHA5hMdZ8=; b=JLQefd+Ml1JqhbElS6almjqD4gE9Cj1HU/Ce+Ori1g202GCJaN3AOCmhyYsWTrC+55 nz93+WZoOSMydljcRoPPqnGzUu6M+N2Nt+2z/5ldyH6WrLjf0NB8kYaD0DkZHQ9CxZCf fZ3B3mn8wtnEbvRY5DLZ9dnXCaWlmW7XqqMN3JifcdcoXR1t1NxBSHwPXI38e8GGoyQx IocEDZn1vKStRJts/GOl4XXPXxu96itzKgM/hi9DfbT0EUj5kTzgblWcD724maJJ5q0V Jy5c+18gMqKCcYW3qMUSyEWh4OZnXgOqUJF/ipPjjc60qMdZ4frt3zzKTYI6Sr2/4vnp 0Rfg== 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 f30-v6si4473231plj.600.2018.04.25.06.24.51; Wed, 25 Apr 2018 06:24:51 -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 S1754168AbeDYNYt (ORCPT + 29 others); Wed, 25 Apr 2018 09:24:49 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:58715 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919AbeDYNXA (ORCPT ); Wed, 25 Apr 2018 09:23:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJU0R-1fEMWX37Gd-00341k; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 08/16] y2038: parisc: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:34 +0200 Message-Id: <20180425132242.1500539-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:lp5CK0JSLcpF9RtdK01TLgFsRd03M3K6QW7KO3EmMn4kdnOCWjE eza3NoWuZ6SBQuVgYdNLuyV65UECdJJ9KE56347ZKbIX4ux8GVvCmYxBRTfIBdK9b5rVs0I 4681DHLdRYZdjdE7k912/8TJeSvrILPDoCnQPGMppTRm9ZIF1zi987AUCI7GFt1Sl676/cz Lt2nc5tzgHwebyr+pNNaw== X-UI-Out-Filterresults: notjunk:1; V01:K0:HNujq9WsDwU=:T0f67Jqobbz7r4ro0yOxV4 wk8szbD2HNhGA3hoXo1IN62bmHUgkpwGXSCg7HI7WNiiQNh3kFqn2+mDopcxasF6Mp/054Xwq cX9zl0WLvL1Q2lI8Aniy5nCb8awvtQJpG3R5Gwunhh0OArGVYl68gy+KejAZ0tcQO42D7Y/0c 01jEomLBtYgq5Q01cLc/eZMmvOpNh/ub/7QN64i7CQKPO/iTs6/sWayk48qtqQdrCm9HJLM/7 9fynSWqK1yNr2mVUf1A2/7HtjrfyNI+rCd+vBz/lbZCp0y2SgO0daDPnGA+7J6R/Gop3bDu7e pC5WI4G4I6+iVh0zk61yc8ue8XQNjs/FfSjZQLIrMGgKsrEyl0nnmcH+Eo+hwyW4+QeIEcES7 wAExmsQFRshUHvFZVuae7kXvrUgK4xmdwANVxmbmTlWPiRS30G95LGVDi6keE3kb/Ni//myX4 9zh8P51DiIwsXp2OHlIgdcG6bqP943x1G9QIFuh7qTETTIPGKQyYiR70tafRN0Hn5rm3XNs3g mhhxvJMw7G7Yhji7JdYo3vrVrHj7G6/GNNVAkTZctkJZjc3K1TkauxNlQm3gGDe7ZqMbxrUH7 srdhB5JuB4rli4114Ev05WBQPNlulC6oWIzbliZHE4qgzKkvWBBaFMab3nLtngkJ/OPEZYXvn MMjyQF0lWHMwNH7pPTXtuC6gh679Oh6+WaTwzo/IzGtmbSJF5kHR4x+dFQECAhC4L1VveLp6S /ZBDXcsIKgRRMACZkzG68Nmocwr0FwBRz2pEWA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) */