From patchwork Thu Apr 12 14:20:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133288 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1737259ljb; Thu, 12 Apr 2018 07:21:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx49bMCK3yy5uyoZeGFxuaFe9SCSkHZfduO3BDXSHOsXfmJ/iJqcHmTAi1zSa/E1dRClszM8U X-Received: by 2002:a17:902:7e02:: with SMTP id b2-v6mr1268233plm.230.1523542867993; Thu, 12 Apr 2018 07:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542867; cv=none; d=google.com; s=arc-20160816; b=t5aksGmSwekcN41c7ywt7nSRG29rdxVGOzWcamALNKtXUGSy9nu1ajfAA7DLrcBvzI K7adURA18dM7O9PYpWxcA29xU5c0rwUQWEOgVu4IBy2Z6Vo/7I4kOBc2+fMBWtmTFq18 U4wLhD11OxyN/63M1/lQkc6oGAM6hoxH4kRx5stV0M/7M0vT5SHZ+krY0Z5fAqOC43PX Ginfrbd48toI/ysIkrfjWVgjAFo2HuIAB2uNTjmWpD8LssVZYRHGVxAFL28Os4blAQGa +MA1MG2jIFKKmRpZ1iPHSBUtvp1LwdX537gmXoD0hrH1OzpSe8R+6EaQdkUlpPCUWIpl eOnQ== 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=6upVCu9yFox5CSufYXF2ncASC8vqtHcarpafPbVt0ck=; b=IaLc8ssvZRscs6XtuNsKUWhEJCKaDpHlWEDTq09MYmNZ5N3h5F62LA5iJFYuagi9dS NRzZCXDliicaPn9Z6tV5iFCGefTu/5SgRnrztXz4lfBA6Sh3T6MgFPyfBtwFPX2Bt4cP vWfnU95xmhOdEhbiKGZm+rXOHj87+IcdIx35O3asJ7Gy8jrwNG8kp0leO3dmnZUpcIoL EwE/wnRGuN/IZwLe7+YG/yPhyXbeQQKAh0NpBWF2o164Z4X+IvBm1nhYB95JPNNs/kVM u1OAFiauCLJ3VGG8Z3Rn5V87iPTMcMrtp/koGIVVaVq/Mlu6zsxQN0UgpQshoqgedr6W sktQ== 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 z22si2310447pgv.684.2018.04.12.07.21.07; Thu, 12 Apr 2018 07:21:07 -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 S1753402AbeDLOVE (ORCPT + 29 others); Thu, 12 Apr 2018 10:21:04 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:51783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752931AbeDLOUg (ORCPT ); Thu, 12 Apr 2018 10:20:36 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MEEDQ-1fHbR40rpA-00FTEw; Thu, 12 Apr 2018 16:20:34 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 08/13] y2038: parisc: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:19 +0200 Message-Id: <20180412142024.853892-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180412142024.853892-1-arnd@arndb.de> References: <20180412142024.853892-1-arnd@arndb.de> X-Provags-ID: V03:K1:SHS+gxmvKO8vy4nd4fFo1/9FwslYqDHEP9puxU0bc3asH3R8Bij 7Sbc9ZsEptZJuSbGm9u3yVW+5o4qwuyElHOYNbiBYWhDdBq7aB/qbtMBp5pHkHnBtp3lUoc da19wxw4jktxSLzdBUULJkqqZftJnZ3agXjoFAFmAW9BJiB0TvHZmtE1H3/DfUFK4PB1rg2 igKAIklXtWseipWqGRHaQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:8PljpVIL97M=:l5wWMR6zlAvYGDh4FfCZVy j9hYeDinMqVPekhKE6DiCKzECDrIq7+pmOWvS71pNbwt5cE19hdE/D/YhpDYpWEL/TK8TKuj9 /80YK/q05kjgpovWhjF/shhLpfRiU6pWMmUIIPMnC6EK6embBTDVc/IbzQWS82iTa8MF8O3ag jOqphDTse1DqSGs7d7CowxP72fIB/XjpSleJEZNnUZnQQ56qQoc7hqbXUNey6EewcnDbwhuBK V9XsRfkzNxPy9VgkQ3+Ww4Jm37GSdUY6OcMtg5rMMNWA4g6jwR1AXpjWska9WkydE5jDs6Id2 KWqd7WO3C2SJGsJCbLL34ppesD7wz5sTC1Qu3J7b0RIL3AcQGAIsiFMx6AFCuWZpBRqHtLSZt qoeRUxsV5RpXbD6fsuceTtPcg4LhQLbKJ9dqsjUGZrw5MvxmLUY/U6LTskm3aztQ7nnQsk6tR Iu/nUuGCxwuiCtjvu6EZL6goXwMOdG+0eb29dVZKo8+wRWm54h7arPILEbF5IiYusjPEj/JbT Pt5tDbVFjx2RWJ0fz153d+0LcgHbKR1WawVhvwVi1x8UZuKLBe1HGu9Z9vU/Q/+z1sXYfxVZ4 STRaaBlw8wevfA3pldFb0FtBydv4rCeoTuR59zOUqJUvVIRCOEJupvlsTYjD3NBMha7Jolw+A ZDJWej5Nm6HB4fF3vmgl9PaiTdL81K4byGXimZy3Z1Lj0mjA6ZnpFHTISuI6Vv5mh/ePMhkxy XfzBVc1n0wK98pUdFaxoa4AYZGb4M1NVAwx3nw== 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 6f256e7b95e3..e9b391ea1dfc 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) */