From patchwork Thu Apr 12 14:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133285 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1737045ljb; Thu, 12 Apr 2018 07:20:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/i6hXNIfV4qwL5OqC59wUi6gR+XMJKD+nO91gy7cx5Q25CrGkTSzrTmxHSyDKoze02uRQN X-Received: by 10.99.173.67 with SMTP id y3mr889152pgo.109.1523542854700; Thu, 12 Apr 2018 07:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542854; cv=none; d=google.com; s=arc-20160816; b=Gqkz1yy03J4gf/ctSTjtYM/AHyIaij5teo0kU4ooFb50DpMHgxG0AOHCqx/Ez+TeaS imNRcDtMO2uZ/iS6Po7yWAfqMjMzAEKRHzUCoF8+eqHyT5P9hk/6rgdICJjQD6/EhGAd gx5TfJB1B4BrUdVmu2akQhj/jXoaIS+G0xYkeTm3QsOEt6BgQ2OZPws/v+8djzBti2Ss JTI71OsPIbdNHlQoGxkOzync0ieNO+o4xgdp4/J54UmVAfO2dIAIBNWMDjpNky+CX+YN ei8gDUCZcjrE6W3roqFRkbQk1L+Eg9Zyn37vFMhhrFlQqF32vSqLd/upbSbcmhYEDwyG HxDA== 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=hqUCesCXj9MWWrvEEZK3D5OeanxsnOniP4q6GCU2mi9X+Im/8ayCvX7E9QoSw4EY7a C7FredjYz3SfUc2ZwtdiUSOtxauPL2v7ct8pO7xSvNL77vkairtIfoN/AugymcxFbUvq gVEsNTmK2QvzCcX9cKd081ovWWRP0rCyg3upzI1Xol0qXuXDD1lKrUaDEu49ZlHTBAKB NsfXJamMORfztknHZVa0fQw+YgxO0MQgbgOk6qJDvU3pAkJjJd3SV3FOkcUfZ3qShalx AJ890pROirIDvBOkM/1o3cWvS8F4wDyuOy2h9RayNcN1zImqFj0O10xktOnv8rKFEBEb rgIA== 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 s8-v6si3716221plk.550.2018.04.12.07.20.54; Thu, 12 Apr 2018 07:20:54 -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 S1753058AbeDLOUh (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:37 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:35163 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752721AbeDLOUe (ORCPT ); Thu, 12 Apr 2018 10:20:34 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LlnHM-1eXZNw2fKK-00ZSz4; Thu, 12 Apr 2018 16:20:32 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 01/13] y2038: asm-generic: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:12 +0200 Message-Id: <20180412142024.853892-2-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:NKuutRqI7p067JW9fwCYbYyyW5hB2v4KVD1KMZ03pNBoh8uamoZ oKp7k9gCNOABF52XfSSrde5pwVMKeB+KzMJRy3Ms28hKu8oYwFXBVJWv23JHcu2ROlApjIx d/fTyFVeAONjo+WVMtoYiwsjxyYmTMX1TE0TFbyD5Nhynl6I+x2/xpJkMnrF2Dp71w6Y3e2 7psoxVSL71ggwRa+Y5tWw== X-UI-Out-Filterresults: notjunk:1; V01:K0:yLQPo0kZ66Q=:546iYtnoa36G6ymDpAudWk m/+c5+0umWeO73tabDghNOlzoAZBw59aahCWmbzLwzKeZimmPcu2K2ooh3snRXndC/seiIRhm /R9B06OxYD3Re5xAjT1xidC1IlOy6MKVNX38oMCIAaZS168IYXTW4WLJ7T5QHiTZ7yTEJWdwB 8HWwxV1Y/qofYTLK+8rn2ZfWvBpSBC+aTs1D2xuErwE6n8+cS3fRk0vsH8Jar9OMzQWrmD5WW xkg5tMm9pmH6p4r3ja/MMZu45xppHsIhF0Qm6PFTOt9Q/SxDsEiQp5jS7cdG4sni07SaLSR2e Zsrg+Bpcgc/nJmStwooaUEcsqtvo/FII3ho/fQ76iK+yt1nnUen0SqtFAHn07yaWTy1t1qx83 UAa4G45Cq26nlu9L2Ltw252PooerJkBAGSSs8CiI9stQGjH1lwQFpZ8WEyTEEUIVtsOa+KHui t+xO6eQIFnJJZiM1m5Trq6HFod75I3S+xRaiPnJkOZvOdMxBzILK0/UB0uGGzN3hFcsBj1jxU Af8Q3ZN14UyWPFuWyfRNg80+joV+pfKs/Cy0kvMe/y9wB8d3uvkgIKPRrCAQVVl122NY4u+Bf fNEh6vz6hRmCFHXDgdhN68QVFaav7r5Tg/A45TsxcDFb/nNmiwE/+L+xNC/2B0Rp9ti7NPCnZ zCgwzLXH5gER1voJPfHv8efTYCkrj5Me066MzVmu+ZeiKxITJ28nRQzhaZC3bp6ux6OobPI3h iydfL1JAbFkkKjgEpHcyCM5ChooCrBwo472LuA== 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 12 14:20:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133284 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1736862ljb; Thu, 12 Apr 2018 07:20:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/vNFuem9uej1ohIaQ64Zw8Ky80Gc4VJ/Znh1N/M9PE1PwUKVMgJwFTxf7Locf0gLquxegW X-Received: by 2002:a17:902:bb0c:: with SMTP id l12-v6mr1220961pls.347.1523542842091; Thu, 12 Apr 2018 07:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542842; cv=none; d=google.com; s=arc-20160816; b=iLMydIJEawRLm2xHrTbuvLDPPJbENxHuYUpj20V5G+P5TfiZAswtfUU5J0Cy38b4Dx nRprSLMeE7Hu7yTR5fWbCEF9ighVM+d6fzNONg4ZRCsiUBNblx2G+Yyj1kYxGqt/gHSU EIUmHkBKmw4WYKT2Uu3qyVl1k2/X3O1Ju+Z5K4qPLcimaW1H4Bv1oUaYmzPZdfNxpHuS M4HTm5cyvFw/AOJB9p7v7/413cwlgrOGJjPfEXuWvWjxsue18B9qFFJd+odBDTrovtmT mFpUZvxjInm+V9/GzxNQWt8BmhKSk7/W5lIifyyQl9fTYsTQJo9EVErzxlyxtRzSa72o busQ== 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=GNXbDRPOE9Ler/VzjEKlsPJdeveOMO0li4UHhgsimvE=; b=YgNwWcixdz3MA7X6bOXS1l649t+6yZmILc2kiYbVRw+xrFFvyKNZ9ujJH60rsKs/a9 ntJsAGZqyoIXJzVGX5jgVc8O9ziExzsoHFVMrOdzcnRJSK+A4FXG43aBSkS/gw6tF2iG ki/35pE2fPJDegCnEUhaSlLA0oj8x36hO2+BK77zcdAXdrheWt10bmRmSxoIdVTne+Wg HVP/zSXqOQYmxFBTy9KSxS2Q/0k8ja3k2wZ+Ka03fuuCmuHZB0dtp2yCl9xbQ7CzsDXn jSt6QlxvD5iQmgq8UEDwdOv7oiMl4VOusCx0jlwCqrbmjJVvtIt+Q6cT55VLa8fhglSi AFtQ== 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 p13si2611013pfh.249.2018.04.12.07.20.41; Thu, 12 Apr 2018 07:20:42 -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 S1753127AbeDLOUj (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:39 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:47377 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798AbeDLOUe (ORCPT ); Thu, 12 Apr 2018 10:20:34 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lx70L-1eQbF33WIr-016brH; Thu, 12 Apr 2018 16:20:32 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 02/13] y2038: alpha: remove unneeded ipc uapi header files Date: Thu, 12 Apr 2018 16:20:13 +0200 Message-Id: <20180412142024.853892-3-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:Hl7tuAx/AzVq9PLhiEaxrZmCy8o74FaTUlnckfhHF7ebjhJEojd EFgaqdt2vXYuNlRlG/BVEnDo1q6BWY7MEvs/HRsnUd6Bgg/cyq9UVQqhlqc56mL4rE5zyed JlLcDS7n0mRswcI3OIZusr1dRy/SlTS2tt48GlAWt96+jF1ss1dRIkMziZlwgTTsqonsyyc WA7QvpHNfpQbUH6jDbSYA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZtFPCYH0eMQ=:qKG4BA6SmHU3iNXUfr8e6s bIOeMS+bo4WmqiJ/M/W+denl9Dj6yAMvmAkJusGUVqeQaujWU5yTN1UrZdaqW6MRzONey9NL7 kGmpYzXD+u2mfHzq8UldDWfPnuAabnQvK8aJvSt5erX2Yjf/SNk8nP0/ltp0dvaEI2SreMTr5 jK1xCq+oGa5gdWCMsXJxyJ6/HAHALT+XY4J9D1nazhy3vhIUj+N5nPaNcr5fEG/id2+xR6jFM CcEFhy/DPHfnfzwIjbmi8CZoM3fd+dqEwEn6OUYtixQBNfMJ+M5R4vxUQVm+ygXZRuBL1t+Nh DdEBjyz+4BkuMsAYKVcz1p/2lJYXN+7SWtLnL5RxkOqZUTq87bKREJ7TxxuVHIOf6cIk1H97U sdzb+MAdp2lStJHBVoZcp1krlJPeQ9onHCck0yNj7iFY3TpFma5bOEdMLYQgLp/j24S1H8x+R TT2SSoZNGTP9rrSX9G1bHxzPsQ+O0s5rWe0h10UBVr1/IeAFbIrRd+eMRX8P2/xjZLf3FA4F/ qtsB98eX+MWoM/6jPJpYZ+uuDKWh0iBVThXd8Y1MqWvgxenYBeKHZpSplpTgFgosqmL3mQy8J GYtWsJuPD7lRIJ6e8F6H8mOx+01fTUVOJl2V6ZWb08lXDhlLHmhiCuyutrr9ae9guAS3N2Ii5 hSIeDWU/cnNlWE548vPiw0YX1abqIIZ5+TOAzV3DcGUK2r6NoVdKXzx6T8djv6Y0sxEq8xfX7 0dP65U6GnU5dLk9eqOtzY5S1sTdH+5EUJ1E1/g== 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/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/asm/Kbuild b/arch/alpha/include/asm/Kbuild index 0580cb8c84b2..b011d981cac4 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild @@ -5,11 +5,15 @@ generic-y += compat.h generic-y += exec.h generic-y += export.h generic-y += fb.h +generic-y += ipcbuf.h generic-y += irq_work.h generic-y += mcs_spinlock.h generic-y += mm-arch-hooks.h +generic-y += msgbuf.h generic-y += preempt.h generic-y += sections.h +generic-y += sembuf.h +generic-y += shmbuf.h generic-y += trace_clock.h generic-y += current.h generic-y += kprobes.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 12 14:20:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133296 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1739369ljb; Thu, 12 Apr 2018 07:23:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+qGShTtvNCmn5HMzyL6/gNZ1uvBIwC0CIvu/DxGm4jKNq7SHzrWVL/OKLvu/yjhyt49YC/ X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr1280325plm.356.1523543015649; Thu, 12 Apr 2018 07:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523543015; cv=none; d=google.com; s=arc-20160816; b=yrXuk24uuex6ZElg1NMEJl+578zpljaSx/BeQ5e7Vu4qd+Irwk3kwR4uvl5+f8bLO3 hqyoHlKXjlygQ8NQ/4r+o4SAf3fhGXnGe+piM6rb6PiI7e5KhFTgMB3JQfYfvduW+elS JNhVGFwFadMDF/x/3zlOF+amjosgFO1cqnKB10n4L52f4dhcmwGql2hudYj9o3uZBBAD f+3ho3ixeHMigx7KoyUXTZjwM5QQOLQaLIPaKiOItpNBBn+QdPEIhuhQ+BcLIMpRHouA ZG1rbuZtFF3FMCiukBqx1sb8Mv4qU4fB5rgilGxViRe1GS3+vXrOT5D+3U9EL2V/5Rxl VODQ== 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=TwBOc3TC7keLqBPOba5VtB/f+tY4+NKzqFp5iZnvCrw=; b=biIW+pF3BRSYKY6C8qTFEf1wZMmjFPZj/ldWBlQpkqANo1LxxK6qcquKv8BcPpsFNL nzl0jMP1cFW2nhjYnJWMRvgd3YEAXsYelZ9PfEKDGcb0+OS6W5IVbAlaVDGfKfUs2xSQ /TsfvkgZn1TpuY9R1BfspR/j+f/lO9jfYi69AOPv2wba5BIwHEU5Br9a2z2OmeZgESK1 6GHDX9rV64i+Im1UBFzluudqTOhEezyVE4cP8+Gsa6B2mpcB93+NUnQ1v8skANWZeOJy MWqPL07yB4A5K5ALreRiNtH7TPpsKih/wSKy2VBjgcfEGcQat3XIAUEwPtdo+7/DN2OI CohQ== 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 t6-v6si3563834plz.27.2018.04.12.07.23.35; Thu, 12 Apr 2018 07:23:35 -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 S1753580AbeDLOXb (ORCPT + 29 others); Thu, 12 Apr 2018 10:23:31 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:60501 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833AbeDLOUe (ORCPT ); Thu, 12 Apr 2018 10:20:34 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lxwsm-1eRzLp0DNk-015FTi; Thu, 12 Apr 2018 16:20:33 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 03/13] y2038: ia64: remove unneeded ipc uapi header files Date: Thu, 12 Apr 2018 16:20:14 +0200 Message-Id: <20180412142024.853892-4-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:zVwpS9/J2Hf6VrlPksFCMZxh4FLBhouqZXPzZVLVSp3rYasj6Bz pWBfdghZE+vhf3EoJ6iaFXMEU5TuyJg4xixZ+Vej0rLvtGHDUoWDOPa9GKb1euViIgDtbXr DExbbYhFNITF+PV0vPbqTOdpkkyOZFs5+ZLz/x8eVz2xgKu9XHsNpURGW5GxMlY/x0h2Dc7 q5BTcCxvmqvmy3sfr+qTA== X-UI-Out-Filterresults: notjunk:1; V01:K0:JoUskXIVKXo=:nUWV291sea+bnVig0Pz8el nhr7vYsQtjrzrss/M1O4Goa7IrQxZYeAYHxndbYG+0+RzjsMqj9WSRgnoBxVvtmXroUH14wvf L9NIuQBm4qEk+t6e4c+0ZWi2bdFwuF50Rx6HpLVg2Qy/RTZUiE6Ipdn9KjlmYzbZEu7bV192S 8B1iWOk11R5KvolPtI3t5T1x39QL3YhIQfk/UQcVsMinxLTja/Ija/IgrM4x7G/5Jcjx3tjw2 AKbZ9xDj2g7rzWma2dUwvxk/mryNDFaGEybH7Lis7K4TGLDbkAGh3KYKTUbDUu+tSWls3lAHo VpEbvmh/TlYwkM8AjGT0/N03PQwjPRoeBgnSA9i+anJEqG1r951gXvKwJMQfbsHtUVmWDhVdY R7jwNS3BcXttJmaumKIs/V2Ej2O/YB2pT61pd1/pD/Vn/IiDuGmv02MHhBEurAtEQeLhgwbz/ neCBzK4+w0hC5I7z3xeoJnG1s0HauFLXFq4s1qBuK6TF1qb8VSTGmrPAt4IlyRNnzdlV3sq8w t6VffmwXs38kZHgF3hon5ZITH4basZOtxD+jtAxDnHJfcD9bT/N82tS5NlKlg2Q6QgwyexPpA Rjj2cb6gG12RxOow+RNp1GNB9noevu8eKpVSWepj0u9VKt4eauvgzfu4uN+M/WLP5P8qRqtOZ QHpj/4YCg9qKxg4KZJOmbRDuobzIjtQfrbjP+jX6BAsg5r/HCWvZDafkuRdgkhf0cOi+rZZxl KpTDCodLfamlpEGr4w0k63P2+NyHCIuejuEr6A== 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/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/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 557bbc8ba9f5..c6d448e832f9 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -1,9 +1,13 @@ generic-y += compat.h generic-y += exec.h +generic-y += ipcbuf.h generic-y += irq_work.h generic-y += mcs_spinlock.h generic-y += mm-arch-hooks.h +generic-y += msgbuf.h generic-y += preempt.h +generic-y += sembuf.h +generic-y += shmbuf.h generic-y += trace_clock.h generic-y += vtime.h generic-y += word-at-a-time.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 12 14:20:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133295 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1739201ljb; Thu, 12 Apr 2018 07:23:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/54AahapaWNi0l/purp2QPcwnbtB5RcI9RjzYO8SmdlY6cH7iUuoMSnTAT00/XzopNmnNm X-Received: by 10.101.86.139 with SMTP id v11mr874286pgs.420.1523543002193; Thu, 12 Apr 2018 07:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523543002; cv=none; d=google.com; s=arc-20160816; b=S0EMKRxD6gBUV5LQABGuCoOMWiF6y5ihtquucr8bbULUY/s+oplds+Ur27Ew2OGJnu bYRTjHtMNEAti4Mowl01RU1g7bS3nCmhtsMiSDdqXbvwbh5X3dFxew9m6eZC3A/w8Dcv g1fCrskPzvL+cHKZB7U9+Rh8GCmLxmvysVusm+pOeUA5IaQzhsqL0o1HGzEAyClFtj7u G28r7nN3IlyNOOUjnFZQO0zwIwG8jnXYK5EcpWM8UxfyWQImIumj69OK7XRCmhpCHq1V 0g/CqwUhNKjzrhuOvpM5WiDr1Yqf99a3fZBQbOoLoDLk0Rr1ZMl0YmooK0LwMPDQdSPO 90dw== 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=Zj7Hy/7p4oCJ783sw+WWs5mvr35lKzhgceQcw7IL0bs=; b=PxpceKXCWuM+97PWRpqcRa3n6frK9pQa9KCb/2pNrtLViBC4bxBUwWlmmVgzOrUXfn lqsYwpP2EzYY5mapNolmADxyxdXtHrwddl2VjH21sldHAPb7eqGzIcEAFqHhSqR8v1kC lM+XKXUX5G0J24scxDT1By1Bskn9AmEp4Gy5oV8NmVnneNV1E5ZCgGOX2Sx4FHC3rttP YzpYYRyVHQNdgloSTn3s5qUBJjb/r2FGzpwDdXapDJXyMKTFUR5v6h5pQtQMndg2jPin YAzImZgDBVmZm6kPxpSu2MbI6RE4Az6KG4x2N9c/gzeX9Ij4tv7lxBQu6889g2dcTquW j7oA== 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 f34-v6si3550637ple.622.2018.04.12.07.23.21; Thu, 12 Apr 2018 07:23:22 -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 S1753446AbeDLOWj (ORCPT + 29 others); Thu, 12 Apr 2018 10:22:39 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:43241 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752918AbeDLOUf (ORCPT ); Thu, 12 Apr 2018 10:20:35 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MN3u4-1f8q0f13P6-006hoY; Thu, 12 Apr 2018 16:20:33 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 04/13] y2038: s390: remove unneeded ipc uapi header files Date: Thu, 12 Apr 2018 16:20:15 +0200 Message-Id: <20180412142024.853892-5-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:TWBxdmfQkFPtPBIshMFdO+ksugnB6idjxl98LpC3qI7P3sctBjL 9ZPcFKR2L3Fhn4YBDR4WtMfycCg4Pgrz1zDM0WpoHMPaIffldBNwFxFXZt3ySOHI00nM0dm eE7zM740jcbZie6F4yhJocdt8FQ97vPX6IpcML/w62WdrS+0sfqri+YsuvFfGI4Go0WNeAn 4nqxovSiosW6fNSzxeM/A== X-UI-Out-Filterresults: notjunk:1; V01:K0:+aUnCEFwi1M=:g0iDMQN2sTEIv0o70dJwXM DFKic6kH8rDOaNfTvpLfrTLmoTMoeeHeY/9ze+aRP4YnyWEwmVKHo1b53CeHIYtCtFrNzX3jz IHdAHgdhECy4y0BR/jD25iuLQ7LsvlKczeX1dkj1Z6Mju+iNaARiGZrgLRp0mNoRufAkqsuDj LqzriOURcEuOrnsn5Kde1bOQtPMnPbKLx+GdURIZgEMGcKSLkFrUpOakOO03C4TYlbBksCFG4 qjjeOXsMzMKNT5jrziUDZCvdN/qROKqhZTNjID+ztpdjFT9hMd0rT6hSFJ1gn61v4PluyWGxd MquqyyzR8e+hlr1GeCrbI9agSPRkWa3TEwnsXB0W6qii26mOW9WKtB74DsqF6qXNkNedrrIkf f4Vd4d0pHGgpX1I1HVVg50MnCQ/yYjEupAbpKoq4xHaNFLcL63a5PAL+zOgSIUp/FigRnlIqA 3iVo9h62gbuaEAnOc3IL9iBBLciZ9PaQpjjzQtF65AhLj6EHimJ/scvc46+M6cDPQ08uYYzoA Nf0Ol47uCwcj6omR+FdasHV4lZiut7fhmCrhO4wCEe43alKVsb/JzXWWXCgTB88+0swcimYSi jAjRoWuo2T3Fn3x3swiqV2DmIN1LTTmJlqeZKYFQQlyxVj7NFMBFZZfmYLxAx483zq+Jfn/C2 MUucQnqZkUvIZGcfKeqNnfcjxHSqDDuj8Ri5vKghxoXe5djOGDaa8JkjnYzIXKzcwoXi0eJFM jjIKUHfE8TTphwEdnxmzacRbU/TpLaxoudUULQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The s390 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, to avoid having to modify each copy when we extend sysvipc to deal with 64-bit time_t in 32-bit user space. Note that unlike alpha and ia64, the ipcbuf.h header file is slightly different here, so I'm leaving the private copy. To deal with 32-bit compat tasks, we also have to adapt the definitions of compat_{shm,sem,msg}id_ds to match the changes to the respective asm-generic files. Signed-off-by: Arnd Bergmann --- arch/s390/include/asm/Kbuild | 3 +++ arch/s390/include/asm/compat.h | 32 ++++++++++++------------ arch/s390/include/uapi/asm/msgbuf.h | 38 ---------------------------- arch/s390/include/uapi/asm/sembuf.h | 30 ----------------------- arch/s390/include/uapi/asm/shmbuf.h | 49 ------------------------------------- 5 files changed, 19 insertions(+), 133 deletions(-) delete mode 100644 arch/s390/include/uapi/asm/msgbuf.h delete mode 100644 arch/s390/include/uapi/asm/sembuf.h delete mode 100644 arch/s390/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index e3239772887a..d8ca80f081a7 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild @@ -20,8 +20,11 @@ generic-y += local.h generic-y += local64.h generic-y += mcs_spinlock.h generic-y += mm-arch-hooks.h +generic-y += msgbuf.h generic-y += preempt.h generic-y += rwsem.h +generic-y += sembuf.h +generic-y += shmbuf.h generic-y += trace_clock.h generic-y += unaligned.h generic-y += word-at-a-time.h diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 501aaff85304..97db2fba546a 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h @@ -232,10 +232,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - compat_time_t sem_otime; - compat_ulong_t __pad1; - compat_time_t sem_ctime; - compat_ulong_t __pad2; + 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 __unused1; compat_ulong_t __unused2; @@ -243,12 +243,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - compat_time_t msg_stime; - compat_ulong_t __pad1; - compat_time_t msg_rtime; - compat_ulong_t __pad2; - compat_time_t msg_ctime; - compat_ulong_t __pad3; + 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; @@ -261,12 +261,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 __pad1; - compat_time_t shm_dtime; - compat_ulong_t __pad2; - compat_time_t shm_ctime; - compat_ulong_t __pad3; + 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/s390/include/uapi/asm/msgbuf.h b/arch/s390/include/uapi/asm/msgbuf.h deleted file mode 100644 index 604f847cd68c..000000000000 --- a/arch/s390/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _S390_MSGBUF_H -#define _S390_MSGBUF_H - -/* - * The msqid64_ds structure for S/390 architecture. - * Note extra padding because this structure is passed back and forth - * 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; - __kernel_time_t msg_stime; /* last msgsnd time */ -#ifndef __s390x__ - unsigned long __unused1; -#endif /* ! __s390x__ */ - __kernel_time_t msg_rtime; /* last msgrcv time */ -#ifndef __s390x__ - unsigned long __unused2; -#endif /* ! __s390x__ */ - __kernel_time_t msg_ctime; /* last change time */ -#ifndef __s390x__ - unsigned long __unused3; -#endif /* ! __s390x__ */ - 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; -}; - -#endif /* _S390_MSGBUF_H */ diff --git a/arch/s390/include/uapi/asm/sembuf.h b/arch/s390/include/uapi/asm/sembuf.h deleted file mode 100644 index 3e917697b668..000000000000 --- a/arch/s390/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _S390_SEMBUF_H -#define _S390_SEMBUF_H - -/* - * The semid64_ds structure for S/390 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem (for !__s390x__) - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ -#ifndef __s390x__ - unsigned long __unused1; -#endif /* ! __s390x__ */ - __kernel_time_t sem_ctime; /* last change time */ -#ifndef __s390x__ - unsigned long __unused2; -#endif /* ! __s390x__ */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _S390_SEMBUF_H */ diff --git a/arch/s390/include/uapi/asm/shmbuf.h b/arch/s390/include/uapi/asm/shmbuf.h deleted file mode 100644 index 9cdce8d7ce60..000000000000 --- a/arch/s390/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,49 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _S390_SHMBUF_H -#define _S390_SHMBUF_H - -/* - * The shmid64_ds structure for S/390 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem (for !__s390x__) - * - 2 miscellaneous 32-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 */ -#ifndef __s390x__ - unsigned long __unused1; -#endif /* ! __s390x__ */ - __kernel_time_t shm_dtime; /* last detach time */ -#ifndef __s390x__ - unsigned long __unused2; -#endif /* ! __s390x__ */ - __kernel_time_t shm_ctime; /* last change time */ -#ifndef __s390x__ - unsigned long __unused3; -#endif /* ! __s390x__ */ - __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; -}; - -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 /* _S390_SHMBUF_H */ From patchwork Thu Apr 12 14:20:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133297 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1739531ljb; Thu, 12 Apr 2018 07:23:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xPkTiDzYO/DQgbzPZoJYCLYgerKUWUiVUEoOdHYhWK37D7F+2wOjBOrAGqLQoEu9xrqzJ X-Received: by 10.101.78.132 with SMTP id b4mr876948pgs.311.1523543025706; Thu, 12 Apr 2018 07:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523543025; cv=none; d=google.com; s=arc-20160816; b=XevuhNjWzqi1goQNlySYav1RmleizEvPxOXwqSnTJSP0XWNq2sj2064CyJBIzBtSXG y/FLYwuc+wh4yJlkcakj8PWaJDEmG/R160LI0LAp7Ttf0XWdZGWKJ2WTC/fxDsE0cIEN Hfjvtcz08NXb0k9Rj6lJg/t1WuOQt/KynxLxIEpZnlsqUk9cfZQm06NbWLDXF1Mh5uLj qx4OZTFwa6npR4l+RoKD3JnjpRbS6QiHO3H3HOrmyvZMvQBmFJR9Cch+iWbNn/mkDHVR NSlfYejLa6oa+LTqqFwzcujNjvF8OBHX2Ib3jngRgIfjj1RlOjZATTukDys4DmKapAJZ RIWg== 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=15SVco5QnoxEbj1na1GDw8PFl3LCtQIeCla91vOMdXQ=; b=yk4LQr2KoofTm6RTAyrduLXvQgMyw4XxRC5iU6G65Rte5ojzCAQJYIg4onu+ddONgE A0cUNWoRndebpNvH+dGcSVulzA1n+sswYNmiYlctA87vb/dMe9dH2nFcpPdsyRv7xUdf inB5MqT8mvl4luNnb6XuLcWsaara2/G0dZMw8/8rdKjOnKKZfBNElVmtQpmFJTZPxdmE xuav3btXThB7e//ZpzaufY+DQ5iJ9F1er5t3ocZXFqXbBYsn41CRzI74c3rMFvjOqpk6 Cd1b3BTkySQpRQ1TqAAFAlkxopuUtBiBNWEgcP7NtDbeyf6rz40BVhAjQfS+PxO+LUlz 7YQw== 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 t6-v6si3563834plz.27.2018.04.12.07.23.45; Thu, 12 Apr 2018 07:23:45 -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 S1753099AbeDLOXa (ORCPT + 29 others); Thu, 12 Apr 2018 10:23:30 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:59225 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbeDLOUe (ORCPT ); Thu, 12 Apr 2018 10:20:34 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lx70L-1eQbF21w0P-016brH; Thu, 12 Apr 2018 16:20:33 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 05/13] y2038: arm64: extend sysvipc compat data structures Date: Thu, 12 Apr 2018 16:20:16 +0200 Message-Id: <20180412142024.853892-6-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:/d4c/PFsTZDb3h7IbX0qLHp5RsKyc7pWLUjoyvrsKe9+pQltb7p tmhnV5njPoYS3uPzIyyOHXs8rpK+0Ex5Z3TRpGe3gCST5S2eRWd6H79Wf33xMakhyrE0fQy WEpWENskJwgcITpD/3pv/xXCME9ucmdK6Ky/YDFsJj9/Bdeuotl2A0aEH8l24PHzfiO0v5A chozliEoZq6ughykbmXJQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:P6toYeI/wAQ=:P6DidJEqFprQWPAqhJC5ac G+jNxVYpChEyOubbP15cv/mpsevmGXQw9DFYoN0TlPvUVsrE6XtqNYLL+ggD+IJH2WKIbDtC9 B0bHv9N/yB9LcmNrKxptAKUwGCLo8fIIjdpByv7HaSfFVJrYnxIbsobWyJt5gl6zXJZb7QJ51 pEaGhI4L/V/AXytmUyVf7/1+4YxxMpMOz3sohwnJ/HNI4svXj+dBgkh/1qtzOgvzEj2bEwx7a Yexr+Qrv11EyI8ynQTerod4YzapkqC/c15j64cmkc1Yc3nxYU0jxnZXcVZF+6EuO3HNMP7tw4 xSDnFEWsaIOEtLJJ88cxreR+MJKatasA545SSBrVqwVXgMRISTRfPELpjPi+RYH6nedRth2NP Qwk4vC8tPXVoBPwVVtz/36FfHvEMcZ6GY13M0bCGMggrvQAzkkSsq1EybiRO4YUXbjbz+4lUr QFMWn5GJE7WmAubqgxuISX7DtgR5REDX/dXuiW9ccH9AbH9jRecRTnWnP/7z0Bv3n523PtPS6 2DJ1U3LiaJ2xl03EnImYZrz3vRRXKrTitZl4YO3H81PtZL+bVwISZEYzuYR8aYvQil1cdk66c YKYj3JuVrPrjmtakQ+YKXwzd40C9V+EyY6egwFjY2IMJ63c1BVeFRQ3AaWBkYZBL2fH+gHWI0 hf98ya/sLGyIkcPvF3TiX5M/rvj/Pu2dacD/8btwYun9MYWI4HozmDlul1iMk+/MTr0ahh4Zo fse4RsgjNSETBp1HUffOukLSR6CUi+UQn9mo8w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both 32-bit amd 64-bit ARM use the asm-generic header files for their sysvipc data structures, so no special care is needed to make those work beyond y2038, with the one exception of compat mode: Since there is no asm-generic definition of the compat mode IPC structures, ARM64 provides its own copy, and we make those match the changes in the native asm-generic header files. There is sufficient padding in these data structures to extend all timestamps to 64 bit, but on big-endian ARM kernels, the padding is in the wrong place, so the C library has to ensure it reassembles a 64-bit time_t correctly. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.9.0 diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 0030f79808b3..1a037b94eba1 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -181,10 +181,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; @@ -192,12 +192,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; @@ -210,12 +210,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; From patchwork Thu Apr 12 14:20:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133293 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1738712ljb; Thu, 12 Apr 2018 07:22:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ztBg+XwkjHgPUtVPdFnDZKDPa0ErTiB56HtmrY73D11HlFpLeZLC2B1P53yaYmCx2fBFp X-Received: by 10.98.55.69 with SMTP id e66mr15132pfa.253.1523542966025; Thu, 12 Apr 2018 07:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542966; cv=none; d=google.com; s=arc-20160816; b=KFFNTeCjK9RWw2TtFysGBi0NVWyj/qdqp15uPAEB05GpPEn0FfWppOTDL5rXDgt+oZ EK/bSIizbpY0w4gubZqWJpq2Nm7bppvJLstROuiqUpwj5ra7ELVgg9Atb1aK/kOyq2VB wzM8mCHPWFqqcvarP7OH+Y22WgKRxysrQrwplhI81W6dDNAbriVEvOBq4w7bVBlvA7p2 i/zWcozXwvB5Kv1Zl6pwT+TzXpNR1bg1GtQ7kaLN6yZkWi3uMQCFjsfMWq8nrsP2v6JV Z4ZnOCLTun6GweEQ1mnrAyeUiNWj2E5whdMkAvfUyu/MPj98ZV0Yi1Nq1neRaH+1UUxl N4Og== 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=dJrtI/X+9MQNCfX6/nH1ozXEVmMsHoJfEKIr+ONL0ko=; b=q4xCSxi5oP6vz080z0Tod4zYVk/7FlRoIYabQWhx3QGE/VvBV1H1vSOWKCSKAMC07T KZqMt8/HYh36fc78ULFePDgPZmA4fImc2A4IHmbfS3U4kn7CRpbM+9u+hvDlUp7R5/Fn 7PZt2JfaViGK7BWHlDralkDN1qbpJm54SVCZNtm2aEvEZV5816HhHTYoTtpLAESx8mbR Msik+0DPvmOEXjDiQx8RImBysZNUvh3F4hwwf4ULaf8D2xffaIS+NWXOEFaY+p19A2hz g6aSiJjHd1lxi8UOYKu93JiDJieefQEVQKZkYp8WrXTgkOZHSfmJDSl6TI3UbChBgnbB QxEw== 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 p13-v6si3521639pll.416.2018.04.12.07.22.45; Thu, 12 Apr 2018 07:22:46 -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 S1753524AbeDLOWl (ORCPT + 29 others); Thu, 12 Apr 2018 10:22:41 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:39619 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752913AbeDLOUf (ORCPT ); Thu, 12 Apr 2018 10:20:35 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LnjcV-1eXr262tJv-00hxyX; Thu, 12 Apr 2018 16:20:33 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 06/13] y2038: mips: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:17 +0200 Message-Id: <20180412142024.853892-7-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:KYSDhrqIvAcxsCR1+Ad30URxBVX6omKKz6PYZYFQB5WiQUvIMAe 8OPgle1Eah66sf3O7pmw1S3W/sGseSwpRSeW7RJ7idkh7bJZvFsqu8/FMnB0ZSlzSMcLlAx UqioKF8JZgQUJyO97hBSilkLtVa1BHvYn6b5ZgOkguX3xxo2MOcTwZ7axtEqOpMIzeL0wd+ TFxi7n4FUo073eyUL890A== X-UI-Out-Filterresults: notjunk:1; V01:K0:VU49fow0oy8=:dHkDF2w4XYb0DSHfVSYISM kr3CdvvZaRbCl4FAeztnJcJdQ06Wlg07NrNeD0g8awsnt/7g/FEZc8a1aF23Gv/5DNh4MQOAQ aw3ONeDDmhLG+noWuaMaP5tbGlLS75j8kTV9NHOBqF02/hVJw7laqvAoEXIRz9JPwP4NeDMzG KVPCE4UuoWy+oS8/RHVRX66nHx/9E8woGAT9oK0E5YQjmmstwYCM/N47XYpZMp73uY6ry6QBT ElFmEmS1ZadB/Iy3EPyeNmygEPD/F4IFfC+VR+5CVqOlnipXMDul3zASyCjRJLdhPaUHpeFsW 45aN2VJbKiBTeL1o8WxmdFzhAOECQKz0inGrBOhUD2ed7dB+jCCBHleM43dcpH16wKg/EyMCu K/7578QUAQRKGp925J8XcuwO4VRTbKMzq3b/jRDHvIBgKOaco7r0QXKqeGmhQFPzcHWiqlliw coDnRpaVsbJ7UIOPrIBxxosVQd82dMMS2z5SZf/ao3JtAOK4CzUHrZS9S/Ran2m9zrLI0XOZZ +HG5IeZqAWIvbUlkXdB+lhDU+kS+oDvcUjCtwXzPmon7ClZ4NTdthDQ7nUSq+7JvD6ZuUG3mt 75R6Zmj2SniloIOzfPpfkcZTy4kEz//UZy0cIvghNPDsQN23Yim9kj8U6oyvB1XPYdB99kAPR fzEIGkyCQXRjyzESHW5Qpec01858pSnlHQt9Kup1V1g7m9bVmmk/m7tnRzBCVvDw/139n6KGd CsL5WLtvT8GVzkM/V4urZ7I/XCm6qpq+Huv5Ew== 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 | 38 +++++++++++++------------ 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, 92 insertions(+), 41 deletions(-) -- 2.9.0 diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 3e548ee99a2f..2e058c4d63a3 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h @@ -157,35 +157,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 +199,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..cbd19e0f0630 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_otime_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 12 14:20:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133294 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1738830ljb; Thu, 12 Apr 2018 07:22:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/grCSLV/KXlRR8vJJI6RQ81wEzSrQSvHzNcI8b4bGdoGnkm2KkdP+QLa/p+54lrLGuVHE5 X-Received: by 10.101.88.78 with SMTP id s14mr868385pgr.97.1523542975738; Thu, 12 Apr 2018 07:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542975; cv=none; d=google.com; s=arc-20160816; b=h7KN8QWyEbWSAuC/xs7+tLn2k/j5CXKR3/FVH4lE2rIwMXuyGU61W2iwscKDvFm9HN 8Ho8JM+yVrYlotoOk5aLu/QS8iT6c7EgsPBtprwwhOezERR2Xo40Z5uRsp39Ik+CZN9f BF/g9U3eJmc7K4LJFJcjFNR8Ye5LjPTL0yP+sqM0vpZHpyFvwNDBGVae6tZiWzbD3N+4 kKvzk7kyPrOYYUiI9EFNxi+/mtmWHf2ug1SgK++nnZbsVb4BOE5nRhr2nojKa2vKEr4/ D6k1MfJAZS5x0qFBuJwZgvGWzRRnidaM9JpWbP1lnLIPLvlrDHW/gNK37+o89K8yWzTV X3Dw== 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=VO8gZjTVtfmKKI7QGozY7aKlK3u9RaGdRTvkbGjMgwfEkeEaGIx2aKYu9kDBEVurMy e/iyswvKrgUa94SXZfBLeM/OjuV3hPtPeiJejL6Jjjht4u2STijWE0JoswrmT8PHegh1 PInUSrVIQxY3J7CQdHLtnTfoN1B0v2MOmVT2Oy4X50asd5i4mCHq304rkxpRy29EseEd nQI75SrvfpRXgb/FfNKra64IskYr/tZ35lWSRlRwwwukEp+3sjpuVZnoaRcDmxWPZtpQ 8LOIWLQogyRbVMGeYni9/H3UNHuDy9uGCQeImum5A34PbxNHOWWUKcLi8l1/2PWx9PDY H7sA== 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 p13-v6si3521639pll.416.2018.04.12.07.22.55; Thu, 12 Apr 2018 07:22:55 -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 S1753478AbeDLOWk (ORCPT + 29 others); Thu, 12 Apr 2018 10:22:40 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:56925 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914AbeDLOUf (ORCPT ); Thu, 12 Apr 2018 10:20:35 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MKaOt-1f4hoU3x95-0023dt; 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 07/13] y2038: x86: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:18 +0200 Message-Id: <20180412142024.853892-8-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:Gvkx1Iu8HYLWwq7+CQ5Z+JteBlAM+Mz2RC4NGYCcXWf3JshGLHV JG64B7ryHRfaqQmdlZU+XOp+aECv0dqUWqfKd+7xYPhdqsXJ6V7YwTI3HFMPdj8+1GWLrEI jS2KXQDdj3rhKTErFpg5rfNXKeDIy/MT92i7h+UWOnmn152NCLXwnkCyeKyqtom90QbOMSA xrpQNnqqomiJEkXljLxWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:sJ4u8su0Pik=:w/GmMoseokDNzWubRb+ish SIHmp4ZCdWxdL29KxgNPIfggDnXCqOm4CmvqZKX0eYe4fRJ21g1B7GNJvYz7TR63rlAZ5QrRS 3jeVICAs9ns8xD3VT6ABe/uRwJFlJPXlCBG0zWDkwoQo2Ey0ocXlN9RVlut3/QAF2ehtfv5eH pNs9K5atQDzQHxc7u1KRHDXHJq3vqWxeHwTY8S5+8B6wDk2LxdEpXzr54o9UDyckJ+ehogOyL pIbfob/gExtuijS2Waj3HBdjhgqG2/lzITt7x7EEXSP6xU8FjnzJ2JCwnI6nANIzv1fNroaK8 htsT+mZhbnN5jXJLMik3AfWM+hMxYzaAZyy4y0hjQF2lemj8tjocJ3BLPKaD31fFXnCiVOFLv E5vjbrW4I/5gqiQl/BcEPnYKQd7UYD6BESUF+SEw3eBW5ylr1m0LpdynwgvOUkRXXKRmzG5yd 0pjMPXR7ILCtAlUiOgKNQ1dCfFJ8I3fH5QYcLAH4DT/JGJO+Vl+DuLmiPGMSk6OBPphS2+Nzj Jbsf7oXfXmYHOiTkIj79X6gSwQb7uCHcWNVfcpYCcHbUYV2Vb4gHRhrR3iZ7gxTScXa/DQ5A7 Ny1gToFnqw0JQHRU4hcSF+2SXTaXbQnk/ssu4XKMMel1lHYHTukcos53tPcewca7T8UWxWbtK 3BS07aFV+OLqeA+VlE2C+Wlgr87GGz4JIE3ABhJyF6MmnaHt7ldzJmALGzbX/k3IiELOKVdau di59pXB5YgDXQuphJFopk8Ndxm4wNnhKaRwrFQ== 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 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) */ From patchwork Thu Apr 12 14:20:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133290 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1737881ljb; Thu, 12 Apr 2018 07:21:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx49AdlRRRof7XzA2jEPtz3U2yYpen5OtuaQl9U6EGu0Vamv9xrANiOz4Cc9FL2rWhQ+llKJv X-Received: by 2002:a17:902:52ec:: with SMTP id a99-v6mr308138pli.371.1523542908955; Thu, 12 Apr 2018 07:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542908; cv=none; d=google.com; s=arc-20160816; b=Q3DNIBzfHuVOeHBBf3ZkUZHX/IdZ5tRn6EreejW7hUpxw3pMSD1DREqQniJdX8kK0P n13XQkCmrZ3r2Af5/mxfEFqztkZmrmqClfOhtivjQ7JUvUJlCiaSCKBJMw7RHNAOtyOx 0BOKeEMsmKR12Xx0mQtKBCMvx2lRMi0aw74pdegzlbePzBfN1A7K8RzJx5H3lbixp17O +UAH3k2KyqDT5yMs9miYNNuJEnn8ekTkQU8fO1iycDlIcU7Pz+N9suQD+hDyTm1Ab6A7 ag+2FxoYEwUFUi7gp6FID5K7GxLuv0/bKdtFJl2CFiVQjlckU6ffWMYxta1al6WFMeBm /fVw== 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=l6l8hBD1LwMEc8rPECkl+yH6jwVWAzXXcGJGNxvajns=; b=qAkG8dmRju3E8GmpmFbJ5m1VWcRo3fjWYN1kAnb8dToxG7+8uFNooKRTYZgXBfLhRo kcuPEoYSTGjMjgiIlWx2CFS2Fp7w0zF0OBqvsFEZD2rpyTKfx3VFiwWPJUFh1lu72M2/ YvYXne34l0mqzt+68ot7FAjj1CdrQaUhI2kzn1loD6fEIXdvRdnJyvhp2s2u0ZiofypQ 5lIcNDpTkDHaYAF/H9zt7lAj+HSvpu+S3ji50k0yyWBWmKUvvlYQEXXCoqIIfRf/HsWM DFpfy+YXGusbSSScb3C6eCtJ9PhH8YjAVOd/TFYxDTvCU72aVeoqvhG2eIq1IwA14n+m qYSA== 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 e12si2624290pff.366.2018.04.12.07.21.48; Thu, 12 Apr 2018 07:21: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 S1753353AbeDLOVA (ORCPT + 29 others); Thu, 12 Apr 2018 10:21:00 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:51193 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943AbeDLOUg (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 0MfHVi-1eqcP21sEc-00OmfA; 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 09/13] y2038: sparc: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:20 +0200 Message-Id: <20180412142024.853892-10-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:E5DpL6168Mr+7Tgj79zfCr87hM7aMrzHvGJtCyz7iMT0bShqzaS 279OjtwAFJ+Ess3Ol3nNDMUAo5YR2AC9mWQ3f7Wp6dxa5MUzMcLowf10SEJc7GQZ9LFcQAm YiQeC4jsEtwyjLTN79b9l91+B8ObmtxiCojSBY0e5jxM2eRrVHeQDEcUYk91NQgRiVYJ/Hq D0npN2puuWuBL5U20SGJw== X-UI-Out-Filterresults: notjunk:1; V01:K0:0/GfNFSZ1Dw=:o/EyEkpUuciHpth/CT9dy4 DiueCe8KKI5Zbh+5ks0IxuRP5Gzi6RnxSPeN6o6xiRVUWkOV819v2nszrvU4h8i//+NrhXBRm EnR1tBr4EeI/TjSpfDnmhLw+X0KSsIOYa1xOcFLw4+tLz/DvkRmwvSqSBFhn6c4Dek6YxuVR+ +qx2dfDtWtXRqw7Vuoxna1y6P8BwkwllajJSE+M4IimnSvipkRWteCxQCjDcJxrrXXR0sNgVi yOeai2xTr8HPodUU2TJAM+z5rNKUhJA4TtXzrXIXsOuGqO5FpRFf284fJkjvpymk7aYySBTSc x6I9P2i0/czSq7Mv1WUYX7ZZz3rhOXa2wAur4UPuydzsroqOjKH0SgaOEzG64nilqlOFWoHc4 QeHzTg0IeFay8vpwO6+5XTSh/HPEBBFMEZ8hqeIfWEkjHlSX4zxj+UHYWdb8Zv2knWTc8C1qw kvM9154DQFEXsEaqJM4UAI/vFqEkOmsB7LtoQFTxmNv4DvQnJfHVYyluPHdxxEnd55L9R7Axm d50y/KLAG9v8JXnLjFHKLdceXbKfszP3K04fvRYrjHNm1LnTJqQw0WnQDpsFBouTlMNjAQhAr SyHEy/J8a+lbNhazQS9s7uMJaTlfBqb1vbro2ewv1Tlp8UfM1cOESq436hSodXdtXMXf2qJwb RT1GNBuZgCvAWXtbg2RKAViLeL513DsYzq2kDNZm3Q027m+LgOmG2npK3+/N6/YwKZdsN9g2y 0/nIuND8zUPt0eIHMzL10Hf/8wYOf27um2oaTw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sparc, 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, sparc 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/sparc/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/sparc/include/uapi/asm/msgbuf.h | 22 +++++++++------------- arch/sparc/include/uapi/asm/sembuf.h | 16 +++++++--------- arch/sparc/include/uapi/asm/shmbuf.h | 21 +++++++++------------ 4 files changed, 41 insertions(+), 50 deletions(-) -- 2.9.0 diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index 1910c44521e3..4eb51d2dae98 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h @@ -192,10 +192,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - unsigned int __pad1; - compat_time_t sem_otime; - unsigned int __pad2; - compat_time_t sem_ctime; + unsigned int sem_otime_high; + unsigned int sem_otime; + unsigned int sem_ctime_high; + unsigned int sem_ctime; u32 sem_nsems; u32 __unused1; u32 __unused2; @@ -203,12 +203,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - unsigned int __pad1; - compat_time_t msg_stime; - unsigned int __pad2; - compat_time_t msg_rtime; - unsigned int __pad3; - 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; unsigned int msg_cbytes; unsigned int msg_qnum; unsigned int msg_qbytes; @@ -220,12 +220,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; - unsigned int __pad1; - compat_time_t shm_atime; - unsigned int __pad2; - compat_time_t shm_dtime; - unsigned int __pad3; - 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; compat_size_t shm_segsz; compat_pid_t shm_cpid; compat_pid_t shm_lpid; diff --git a/arch/sparc/include/uapi/asm/msgbuf.h b/arch/sparc/include/uapi/asm/msgbuf.h index b601c4f4d956..ffc46c211d6d 100644 --- a/arch/sparc/include/uapi/asm/msgbuf.h +++ b/arch/sparc/include/uapi/asm/msgbuf.h @@ -8,25 +8,22 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ - -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif - - struct msqid64_ds { struct ipc64_perm msg_perm; - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t msg_stime; /* last msgsnd time */ - PADDING(__pad2) __kernel_time_t msg_rtime; /* last msgrcv time */ - PADDING(__pad3) __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 */ @@ -35,5 +32,4 @@ struct msqid64_ds { unsigned long __unused1; unsigned long __unused2; }; -#undef PADDING #endif /* _SPARC_MSGBUF_H */ diff --git a/arch/sparc/include/uapi/asm/sembuf.h b/arch/sparc/include/uapi/asm/sembuf.h index f49b0ffa0ab8..f3d309c2e1cd 100644 --- a/arch/sparc/include/uapi/asm/sembuf.h +++ b/arch/sparc/include/uapi/asm/sembuf.h @@ -8,25 +8,23 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t sem_otime; /* last semop time */ - PADDING(__pad2) __kernel_time_t sem_ctime; /* last change time */ +#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; }; -#undef PADDING #endif /* _SPARC64_SEMBUF_H */ diff --git a/arch/sparc/include/uapi/asm/shmbuf.h b/arch/sparc/include/uapi/asm/shmbuf.h index 286631db705c..06618b84822d 100644 --- a/arch/sparc/include/uapi/asm/shmbuf.h +++ b/arch/sparc/include/uapi/asm/shmbuf.h @@ -8,24 +8,23 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif - struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t shm_atime; /* last attach time */ - PADDING(__pad2) __kernel_time_t shm_dtime; /* last detach time */ - PADDING(__pad3) __kernel_time_t shm_ctime; /* last change time */ +#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 */ +#endif size_t shm_segsz; /* size of segment (bytes) */ __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ @@ -46,6 +45,4 @@ struct shminfo64 { unsigned long __unused4; }; -#undef PADDING - #endif /* _SPARC_SHMBUF_H */ From patchwork Thu Apr 12 14:20: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: 133287 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1737222ljb; Thu, 12 Apr 2018 07:21:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx495hJ8SgTLN+KKffW8CAgWlbePWRHwqCJeg+NrLqaG3fNRMAYtm85V/ZrCvdC6qRBLRJ2uA X-Received: by 2002:a17:902:7e46:: with SMTP id a6-v6mr1306231pln.61.1523542865581; Thu, 12 Apr 2018 07:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542865; cv=none; d=google.com; s=arc-20160816; b=T4kcKdXIralfU6kUAQ/tAFWOBMiIoPV5qGa6E5bjpLgjGIgktE6xKtwWyhLYM7XEDH +iaVToIKmh2MS2e2Gt4UXxupjNsEdU5yhPqqoET9esM3BH2J5O26Aw/rpXWeX0Y6zyiP eRajOMhoRnVmitVD2eQHcdeu8B5LC43DXvGKVNg1rndEAjXdDneqmBKYgAn/98L+JEuP 8nAo/M8Wwbtzch/UhTBVT4erR8cxYay17nwuZe4/FZIN4OvmfRhpYX5DWs4z8SquEoI4 y6RtofheMNEKHdi9uLqClbdTVy9pFHqTOCdgeBjVc3MnIxk3m5SZrWHe+/yaJL94+Dmw U3wA== 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=ztqddPyt99N0IEQQqqH0pmZuNP08ZR9wKa9Ch/U8GrPWTozWX7CXrdXGUfCROClPVd iJqUIdvoW7s2I4KsexVnVkhC4N7Tjd/Q03eYvgh0Q2PoUCYBv8y+lYxOJMeq6paWD9ne Ydi8tyS0m8b6elWW/kHniOnf1fQVggnWjMSZu4nZpoYsoPr08k0qzofZQkNQGUq/zf2k ufluZH//94FmsXr5OrJm9MQoOYBiG9WU2t1oDW6YmF3IJ9ln3woHZXmZM5U6hgecDSdA 5nrgTRc9XVVF/buB8ICRNPKah3CtZwoRdmwzULUlbGGSNPV2ZWg8xkS3wueUtIT1/Pbk SZkg== 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 p88si2731671pfk.134.2018.04.12.07.21.05; Thu, 12 Apr 2018 07:21:05 -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 S1753372AbeDLOVB (ORCPT + 29 others); Thu, 12 Apr 2018 10:21:01 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:39007 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752953AbeDLOUg (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 0M89c9-1eK2jr2zC5-00veZX; 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 10/13] y2038: powerpc: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:21 +0200 Message-Id: <20180412142024.853892-11-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:2A6WSm6inCQSe5+6zvDWkxr4L7h65/JDdeJmZ8ATjN8JM39sdYG 2AF/0kz/Ib9pEHl+Tu4zX0rnygmZ+/DQ2M95Sjn1+fxq0xOIFCkTrMxzuYuvc2GsNEMMMfw x22BbgbwpFMDeZgv5F4Su/IgpGkDeM7vUfwz4eMJSj6VZC22aMkUc5BxUgwPUSGCP9zCLUb +On/eGQmssH6Vrtldpt5A== X-UI-Out-Filterresults: notjunk:1; V01:K0:ok5KWf+OTcc=:d46NBjfqk0Cs0Z+iwFoXFC /UkJqEsn0CVGlKV3RuQsC5OQXB+CAvGpXCBWWMiUE/bvOEKyb4B4uqm1vgGPEGang75DJ/ICM Gb/UsLzVbl/OUbtMCe5JYT5jm6YeW9hYmumNo4eEpnFpZ1ShdL9jo2dVU290rNbmaqP5azXfj 6LhGekInD3ZTG1q3F02XkHGBBLXZrPH7H7b6FuMU3hy1hOFjFMnT1IrE5EPWJmuj778bj6Grr ppTuqjlMscjPGmiH+nJhB4AGj5mn19CZLpx2ug1EoiKJyZ2HTIczjjk50FQOPaDmOXxenKOl8 ICNeZxS3e9h4cFmKnCfQar5ACbeou1FVIRF/fwJxyBeFjXkYAK7sg4nn0hXM2riqyu49mREUJ U3xJR9e3Oabh7a3pfp7FTtPW4GvDDIN98k6B1Ut6MtLhqwV6Rg8DaSTEis3j/cdRDZAID45Q0 qmC+RwKiHd4tCFpoPH7tiSQmCLmnXt0Kosxta5A+dUXXN4eLWNnhO4veUrkOcr7GRNJkrMIYj egOZYKio5NDSv7Gyy12NnXvG92FjNFToBaCNtxjfSTl+ZsfMBDn0+eoV46elLLlTQli0UMDmy b/kjE1Sbzbs2pY6PqCN05zTHVbZIExKGvZ6Unfs9uv8S+sHCRHSOr5W2KYdQ9D16szin5SYrS YgiLDJAt8KLg1XKmB5eYvDrUrjf7FgVOWn+r9AOm1blLKAL0V5atP4BKHEYcMbsVgQPIrTKQK ZaRr5Gni7toqPhTMKMkmT4uTY2fR+9pExAwb8Q== 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 12 14:20: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: 133286 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1737198ljb; Thu, 12 Apr 2018 07:21:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+hyRf7QO0hiouddDflnJ4six0NW27/lGpzwS7TGDUb/TuMuaLkbk/n5+uRJUlljMAikuCB X-Received: by 10.99.38.66 with SMTP id m63mr901439pgm.164.1523542863614; Thu, 12 Apr 2018 07:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542863; cv=none; d=google.com; s=arc-20160816; b=BlWaqpoh5zvRMjNbkHbxylDbdS4VgX+JLY9NcnCjcYByCYQWmIC2fIXq6AfRrjuBVT xJ9HiA9otLtzT3tqzD56b9iecG8GL832nexXN/KQj5WS63lmvGPQHfBK8r0Ywcy4CEda JKAzL/VVzlkeGjGL0uyU7dJxaXi/79C17wVOpvdQx+hIXw8e6EQbLAwURRJFM9kpVZmq iArmd8EXdrYdycu3CjYWuSPAWJJH/veplMvgGR6K847BEuOvESdgbHfjMPiijP6gX3BR gjX0YsRpJw9JxUgmd3AAl8cvHmqFgdIkVLG8oLnNULY3up+1kR/LLaaYjShknDBrdU+G COTA== 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=o1dLGSbYTsvStsA6Uht7YFQHG8/DOR/rfseJS4tWUaPFjnQ4JB7RCY6j3n+CS5eBhZ 1Nwmch+2DIsQ6SQpQDTfJJC3zrxGK+YxIE/SkW6CZNzo5GFRVZGjljixmdwHNzzL6F7D R4fdWmEiW0u2i+JGy41RFn8xzVz3os7AyYfC5Eyj9f5dhwYIV1DszWGdo4iAP6FnK0d6 wFJvvHh/ny3Pn3uJOmL1sCEBeccC9Gt04UMZ+UAqSX51+0DwMN9UrW/PR6IBDqN7a+q/ KR0CzLHHGiEMRp/tTeHTPIuxjDautY44hQSqv6iFE9Jh9M5/SsrMJmBMsNsXFR5PWPYQ uJNg== 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 m13si2305446pgp.482.2018.04.12.07.21.03; Thu, 12 Apr 2018 07:21:03 -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 S1753328AbeDLOU7 (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:59 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:36611 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752961AbeDLOUg (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 0MLPDG-1f64rA40jy-000gCG; Thu, 12 Apr 2018 16:20:35 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 11/13] y2038: xtensa: extend sysvipc data structures Date: Thu, 12 Apr 2018 16:20:22 +0200 Message-Id: <20180412142024.853892-12-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:4QYNCMxY7eA0qd5x4/fVmxJ5c2C4hULScC96HtZWkwsiQWQkhnz MyRw4CWhR4nmFv6LqxxqIW/josPusMwq2ZwWJ4bnR+lUYvDT7KhEvL9dd4WddtwGN42cXkA /bE+FZocHfAmSyeGDYpdY98bcQBdZwkt/yU7TV8uxDtUlHL+mLVYs6NH+eLUAPxrorOwc6N EPnafvyajY0fPEzA9S5vQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:ld6VFo/VGjE=:KHil8KbDgxpbbHiLVeIglU vAhgtrM5kxLtgX9zixNKSP6NdCKmGWQvix1z8r3wcjTPBXcQCLYyoFTwt67R2C+fPr8GyfXgK yscVG2K3+UU14NVx1cGMUceUVazEe3qobLJ1hzPs37f5zAGAEXZe/0zvJI80VOJpjrS0GfoKO z0ac6W/rZ9SaemBV13IOtXS2CqjPsfvN9K2kgOgBKcYMm7sWRXnN4LTdfXN9bCzH6KY9CGg4T yUrJGoup59MuNviY+khVjI3LxTK1SJkKeR91GAVoZN4HQ4PmlsZuF08/LduPWBZL0p4/xafLI xEfUCGSdBej+M1nqAb2vG3T5V1MwSVgAn4nXuIpQJKeZZV1EgRcN2eIYhU08ureBJ4WIZkiKS j+kCbKKQponVW0iuZIMjGCuTXsAteUhc85InNJDxu9zw7Q1xPfDlpEhr/ISbZ5zBuGSIH6mmv ID1xxTp+NRSoSyaKqvJpcS5yLt0+KbFnalfHpghDiTyPULSh7rtVfp5DQ3d2B190fTaUKj6En P0ZvHwhmHrhyDSEJ9a0Hre6WbZgQN7vUB9mzEpfrK6/RRXVWv2f6kPUX+sKENPambVqcNOvRA PaJtn/Go4yIqkatpvOuQWfkztFv32JvjQIMQhBxNex2gwrlyqhvxbDLCObxTvW7XHzltDwQ3f WoGx2NH8ickUg0PqhfGE8ZpyNF4WarKkAem5Ux3SqOz75ge+FJ1enKK/+ZXbybrdVgKX6wOWQ Vwb0rmgyMzYE5k4TfsgblWIZdUuOC6q+aiHz5Q== 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 12 14:20: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: 133291 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1738206ljb; Thu, 12 Apr 2018 07:22:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ak7TCyJ47irGorYpSiPWryTH4w3ulbFohJTqYbLkTkKGCTmvZgfLYb827UDBi79b4su81 X-Received: by 2002:a17:902:8a94:: with SMTP id p20-v6mr1303385plo.94.1523542930646; Thu, 12 Apr 2018 07:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542930; cv=none; d=google.com; s=arc-20160816; b=rP0D7H2dlxjq4Vd0pmf0TkS564UIyB/Ag5pr9go+v8RTEFaqBsx0vLuYiI3sAW/lYC MpEUU1T5z/npIwESDy1P4EoU3bwqJaVKmu2/W/9n6qF50SRwHs+tUsR4IjI8vngImgsj 1feM0f7QnS/sgFjL9nBTJGAu0RqkqMHnokEfDXw5rqNv3AqvkRwlrUn8FCT+MrIY2vBy i3DI//cT790sRIsjYje1ikzQuYOtC/DTBZS7ojMXR900zc6kTGrzTPMifKKfYro9ZI7I 8pDzYe0iPTwRSflU1CY9SO2HU71JEvelK1pThzgZtvLu8s0lCzBnmlJqRvBdK6vbuGwP nt+w== 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=6DByiS1F2CCr2+gB2oGqCiz3xUdZjS7bRr/r9SRF93s=; b=dJ2Lycp2jBYVzvslpjs24M5zvMn3ere07dWPHIL/+oVWwKolCRpo2mvimjku8kFW0D ASZmayvDdHZmtBS44NPnTavSb1Ne4hNbhMeV1fT/F0rbZ2EJWPvmvVlnghP19rNj8Opg 10djuxvKStC2RqvrHowJZHGT98aK6xBJt8zmJBEsLA6+J1fySdX9SB5USKwufi1nw2ox LpCIDGZBw7NloYpmCp4bSuhAnQXptmeMLYr5/SypVnXutWkwk1HUlwVWoiaMsT5ioA28 Cuhjl4dKvyKNH+AYgZlsR3y9UnQiUM2+Aj6QXMr2AxzP/axSwkD5w54E1wz0JkjnENd6 oCuA== 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 z13si2149522pfe.197.2018.04.12.07.22.10; Thu, 12 Apr 2018 07:22: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 S1753308AbeDLOU6 (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:58 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52135 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752965AbeDLOUg (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 0M40t0-1eFLmL0rOU-00rXpg; Thu, 12 Apr 2018 16:20:35 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 12/13] y2038: ipc: use ktime_get_real_seconds consistently Date: Thu, 12 Apr 2018 16:20:23 +0200 Message-Id: <20180412142024.853892-13-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:d6Hun3WAu7qxSe9UnY5niAfmpFphUwr7LFNqTeDeFker6GOT9gV jCZKWy5FGIt5zH8/SixzRBxpamWaWSa3zPnNwXde9mF/dRAUpQAQ4dtIaNNOjs/odUtxVYc tKRTezQYMG9bZytFuTM5ALnvaHDGPesodm5yorull3cMfpXadH8593egj3lQXuj33kIcgDP 7lqAypuPzTxTHCVRSdKfA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ddn6WtrQL9E=:wCpvl1SzqkWWN4X4tqe1Kz jLOb4mZ5QguLdR2R88uLbMA/G4kdkVOPz3uomwmCGmoSqk6+73sfA/WxDk8NGlizEiVnfCaQr VU0BDeEe2oMgDoEMjKgF24LyCvlkGh1k+h70d9514ns5XSe9HDKLiSQMUmQvIOTn+vTR7AALI yiSXrzA+o2bc0v0wUQIj0W9hMrmD4F8IotBXs/4JJ43DIrHW4V2zk9QtCX+Iu5F3RRqpx0BcP R/fT7iWoLOtgPdSbGF3cdG9w3SZaxuGNgQYm4Q5ZCiwPHVqoce4OeXjU2ONiQCpskxIQ8u/Cc fgVytgg84RJstvFxNKtcz9eEH7b6LYxRKseb4wQ/DzY7fMrauWIjTfj4cuGRF9d4X2EUZBs47 8Kn1rRxYyPNNn/gxmHoOxh+ZCqPABNbAx8Mlw1vcn+MMkpQ8dEawUFxad3I9EJkJ36FgxE0Fd VBbaBjjzZpFBq9tbnH6P3Y7/4SXWkiucvy9A7VmxNrO7anGcL62nyrM4Hi9+Y1uXS4CKKRZQs iZA0dSdmJkdS6X5hu7+XVk/ICoW9gs5IseflyKIaYIlnJSJV2qspHJVZop1THLD6bKk7noYSW aAlxeepBSDyy4HPnPv8cYlFRxDGOt1NOMg+8dGOcaLYt9a/kdzBt7Qu7h16Nz/0Iw6gmQqczi m/Z3oFPFVqL8CHFjo61QelkpwaD1RJ1JbnH7cFZMgNduOaLcP7V9EVZb5GCnX2ZVNVJGx0Bv3 oE3TcCa9AU22G0eVJJh0fBC2gSFe8uxTalVAOQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some places, we still used get_seconds() instead of ktime_get_real_seconds(), and I'm changing the remaining ones now to all use ktime_get_real_seconds() so we use the full available range for timestamps instead of overflowing the 'unsigned long' return value in year 2106 on 32-bit kernels. Signed-off-by: Arnd Bergmann --- ipc/msg.c | 6 +++--- ipc/sem.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/ipc/msg.c b/ipc/msg.c index 114a21189613..5422d7c10e9f 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -751,7 +751,7 @@ static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg, WRITE_ONCE(msr->r_msg, ERR_PTR(-E2BIG)); } else { ipc_update_pid(&msq->q_lrpid, task_pid(msr->r_tsk)); - msq->q_rtime = get_seconds(); + msq->q_rtime = ktime_get_real_seconds(); wake_q_add(wake_q, msr->r_tsk); WRITE_ONCE(msr->r_msg, msg); @@ -852,7 +852,7 @@ static long do_msgsnd(int msqid, long mtype, void __user *mtext, } ipc_update_pid(&msq->q_lspid, task_tgid(current)); - msq->q_stime = get_seconds(); + msq->q_stime = ktime_get_real_seconds(); if (!pipelined_send(msq, msg, &wake_q)) { /* no one is waiting for this message, enqueue it */ @@ -1080,7 +1080,7 @@ static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, in list_del(&msg->m_list); msq->q_qnum--; - msq->q_rtime = get_seconds(); + msq->q_rtime = ktime_get_real_seconds(); ipc_update_pid(&msq->q_lrpid, task_tgid(current)); msq->q_cbytes -= msg->m_ts; atomic_sub(msg->m_ts, &ns->msg_bytes); diff --git a/ipc/sem.c b/ipc/sem.c index 2994da8ccc7f..579a60265fc6 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -104,7 +104,7 @@ struct sem { /* that alter the semaphore */ struct list_head pending_const; /* pending single-sop operations */ /* that do not alter the semaphore*/ - time_t sem_otime; /* candidate for sem_otime */ + time64_t sem_otime; /* candidate for sem_otime */ } ____cacheline_aligned_in_smp; /* One sem_array data structure for each set of semaphores in the system. */ @@ -984,10 +984,10 @@ static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *w static void set_semotime(struct sem_array *sma, struct sembuf *sops) { if (sops == NULL) { - sma->sems[0].sem_otime = get_seconds(); + sma->sems[0].sem_otime = ktime_get_real_seconds(); } else { sma->sems[sops[0].sem_num].sem_otime = - get_seconds(); + ktime_get_real_seconds(); } } From patchwork Thu Apr 12 14:20:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133292 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1738455ljb; Thu, 12 Apr 2018 07:22:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx48XWlonev2zkHG9UG/1sCRTCOymTIUoLPo7O5PTLuyD7TiwkZHmWKtXVxJNgELSFOUG4xj9 X-Received: by 10.101.69.198 with SMTP id m6mr885590pgr.244.1523542945810; Thu, 12 Apr 2018 07:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542945; cv=none; d=google.com; s=arc-20160816; b=rnxR3pu9gTcvA6F0sMb/LrGnJdSlsZCD71Wvm9WA5CkpGn4ME/SEa7kCT/zJialDJq Z2Q0ryv+5TfQ54v/tgKa+BRqKMC7RthctLXco07I6JI+Zdo+NkTL6Gr8GdjRBbOjzmI7 VkThVU58p/QSyfHlzsUE1yM+/7ST82VFeFOhRZtYiNU3IoqV8iT1hFplQHMhi8nS/xBf BgaN+5qS/CKl3W2VkDhAfC6Se1o6U4CaPS+iSTXMsz85ndzvo6LBhJwCaU+Uz0MWfor5 ZYXRvJ22mIcxSCT/iqv+DMBmXvhUxKVfWNsCxRTm4+WCEjvqyDtHn1j7NWMM/havYlix LyQQ== 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=1wQAmiadRlMrX6XK4Uh/VfOGokqD0kM857atjxZwc+Q=; b=HQRPK6ECyQBkSMRubq53qiU+L8YmMHDk1/5+wEzZdsuo/S6jkKepX9btvvsL+1i/u9 Sj0Ahl5SmkzABivr/+cNEdQWSjW0MC+aHZckk4xkgPL6YHBRJP6hpaVlLSFUXddTNvO+ g4JsoEL92JqTGEC8IeiQOHXai1D2phlxMQJCCwaXhGl5u78qAZJn+XtuqOGuzZwn0VRT AJIzDAYb7w9SMBisZ+nNhPLn1KggpYbePHtblsH2gmjQTktpCO5Xs82HEdNTdm1jIWUY ZXF76MCBI3rq+vfXmP1YS0mY2NrVi/JGWLIsakU4lsuJ5nhVDF2j9eEKJlFqkJtHTgll C6cQ== 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 z13si2149522pfe.197.2018.04.12.07.22.25; Thu, 12 Apr 2018 07:22:25 -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 S1753279AbeDLOU5 (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:57 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:44853 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbeDLOUg (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 0LrbET-1eL5TC1gkf-013KbH; Thu, 12 Apr 2018 16:20:35 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 13/13] y2038: ipc: report long times to user space Date: Thu, 12 Apr 2018 16:20:24 +0200 Message-Id: <20180412142024.853892-14-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:Hi3KvLfoP8E4DXp87UJa4gNS/UlnpRQgbUjRAzArzu39NKiIZTd spGyW8sYK3975kupdavqbtTYaASykZFaJ49b4h6Phem33kYZ5iOvFH5xRtBt4alacWyErir AUZtD5wK4c3dLkxKCoVlwox3ua8Gks43nS0e5MJCXJgfYot5vzho1TAaIjOhtYzVQdsLh7k sCWxsNIxflsAaf3KBCpiw== X-UI-Out-Filterresults: notjunk:1; V01:K0:9kHgbazk6lA=:D6eMCgnLEPzFaQ6b85dH5M UpNLfGhh91EDCRfMjN+og6Ba33CKb79pmlIcu8csHsAadvPEctm/XAz9y2zbFAi4FKnjNXm4k ICkcDu9n/e82QfBaSvvN+cLS5eHbyxWCbJAisjsgoDIZS0hztFf8UYGbLPlR6In3lJmgjoYYn PdPcn10LRvl9iOXLLoxMF0qwI5DHWHFwSdhjrX2OoHBc4naD+AFT4unxmYLfRcB76Tsndt+HT i7utOFltuV9EzinsYzkGoxCxd7fYuW7uBjGaLkRXY3bfEjWpk+WspsbF02XKT9D31RqubI5uf AuGbdOizYbd5LwGm83Of9tu5ic53ZlCWiehuIgfIIAYJT3Q2A0YHQirByDrVtb+OCGghPgLQw rt4zuldBZzIQqBxJapJxMq6T9kwm5BHbKxCbsRjqDgGuQK1wrLD4QWGOB+QVKqdJZoYXIqZVH VtXGHGykUlCkFB9YfCb2KcHRgA81dofP0PhhU60hXopvfI8rSblWVXG3inDjXGU9isTkbr+rD ZIQ+Tk+lQZqNC2DrNcYa6dHoV/8OWLOYOjRN4/QnDK8BjCQTRpvaYE3LEn8WgJ4Dy40yss/fp 0lVcjbrrDL2QkAZqzXGJrh2F4MPD+V2fgDvy2DZ6SqgDd0PijTHl8o7ugnEcUkJdIJBxeT/Ho dA/wUPIdLHjo/GyXFjxXu1by13dolnY4UlNrPJau3SNCDWMldkISqgSauO7khlqp64MoT2Pgl Qv4qnu53ibN6fgRXTPlcSgu2n2Fp/3evK1FvnA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The shmid64_ds/semid64_ds/msqid64_ds data structures have been extended to contain extra fields for storing the upper bits of the time stamps, this patch does the other half of the job and and fills the new fields on 32-bit architectures as well as 32-bit tasks running on a 64-bit kernel in compat mode. There should be no change for native 64-bit tasks. Signed-off-by: Arnd Bergmann --- ipc/msg.c | 14 +++++++++++--- ipc/sem.c | 14 +++++++++++--- ipc/shm.c | 14 +++++++++++--- 3 files changed, 33 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/ipc/msg.c b/ipc/msg.c index 5422d7c10e9f..57869f007265 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -532,6 +532,11 @@ static int msgctl_stat(struct ipc_namespace *ns, int msqid, p->msg_stime = msq->q_stime; p->msg_rtime = msq->q_rtime; p->msg_ctime = msq->q_ctime; +#ifndef CONFIG_64BIT + p->msg_stime_high = msq->q_stime >> 32; + p->msg_rtime_high = msq->q_rtime >> 32; + p->msg_ctime_high = msq->q_ctime >> 32; +#endif p->msg_cbytes = msq->q_cbytes; p->msg_qnum = msq->q_qnum; p->msg_qbytes = msq->q_qbytes; @@ -640,9 +645,12 @@ static int copy_compat_msqid_to_user(void __user *buf, struct msqid64_ds *in, struct compat_msqid64_ds v; memset(&v, 0, sizeof(v)); to_compat_ipc64_perm(&v.msg_perm, &in->msg_perm); - v.msg_stime = in->msg_stime; - v.msg_rtime = in->msg_rtime; - v.msg_ctime = in->msg_ctime; + v.msg_stime = lower_32_bits(in->msg_stime); + v.msg_stime_high = upper_32_bits(in->msg_stime); + v.msg_rtime = lower_32_bits(in->msg_rtime); + v.msg_rtime_high = upper_32_bits(in->msg_rtime); + v.msg_ctime = lower_32_bits(in->msg_ctime); + v.msg_ctime_high = upper_32_bits(in->msg_ctime); v.msg_cbytes = in->msg_cbytes; v.msg_qnum = in->msg_qnum; v.msg_qbytes = in->msg_qbytes; diff --git a/ipc/sem.c b/ipc/sem.c index 579a60265fc6..94164c0a15ae 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -1214,6 +1214,7 @@ static int semctl_stat(struct ipc_namespace *ns, int semid, int cmd, struct semid64_ds *semid64) { struct sem_array *sma; + time64_t semotime; int id = 0; int err; @@ -1252,8 +1253,13 @@ static int semctl_stat(struct ipc_namespace *ns, int semid, } kernel_to_ipc64_perm(&sma->sem_perm, &semid64->sem_perm); - semid64->sem_otime = get_semotime(sma); + semotime = get_semotime(sma); + semid64->sem_otime = semotime; semid64->sem_ctime = sma->sem_ctime; +#ifndef CONFIG_64BIT + semid64->sem_otime_high = semotime >> 32; + semid64->sem_ctime_high = sma->sem_ctime >> 32; +#endif semid64->sem_nsems = sma->sem_nsems; ipc_unlock_object(&sma->sem_perm); @@ -1698,8 +1704,10 @@ static int copy_compat_semid_to_user(void __user *buf, struct semid64_ds *in, struct compat_semid64_ds v; memset(&v, 0, sizeof(v)); to_compat_ipc64_perm(&v.sem_perm, &in->sem_perm); - v.sem_otime = in->sem_otime; - v.sem_ctime = in->sem_ctime; + v.sem_otime = lower_32_bits(in->sem_otime); + v.sem_otime_high = upper_32_bits(in->sem_otime); + v.sem_ctime = lower_32_bits(in->sem_ctime); + v.sem_ctime_high = upper_32_bits(in->sem_ctime); v.sem_nsems = in->sem_nsems; return copy_to_user(buf, &v, sizeof(v)); } else { diff --git a/ipc/shm.c b/ipc/shm.c index acefe44fefef..7bbbcd0814eb 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -983,6 +983,11 @@ static int shmctl_stat(struct ipc_namespace *ns, int shmid, tbuf->shm_atime = shp->shm_atim; tbuf->shm_dtime = shp->shm_dtim; tbuf->shm_ctime = shp->shm_ctim; +#ifndef CONFIG_64BIT + tbuf->shm_atime_high = shp->shm_atim >> 32; + tbuf->shm_dtime_high = shp->shm_dtim >> 32; + tbuf->shm_ctime_high = shp->shm_ctim >> 32; +#endif tbuf->shm_cpid = pid_vnr(shp->shm_cprid); tbuf->shm_lpid = pid_vnr(shp->shm_lprid); tbuf->shm_nattch = shp->shm_nattch; @@ -1213,9 +1218,12 @@ static int copy_compat_shmid_to_user(void __user *buf, struct shmid64_ds *in, struct compat_shmid64_ds v; memset(&v, 0, sizeof(v)); to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); - v.shm_atime = in->shm_atime; - v.shm_dtime = in->shm_dtime; - v.shm_ctime = in->shm_ctime; + v.shm_atime = lower_32_bits(in->shm_atime); + v.shm_atime_high = upper_32_bits(in->shm_atime); + v.shm_dtime = lower_32_bits(in->shm_dtime); + v.shm_dtime_high = upper_32_bits(in->shm_dtime); + v.shm_ctime = lower_32_bits(in->shm_ctime); + v.shm_ctime_high = upper_32_bits(in->shm_ctime); v.shm_segsz = in->shm_segsz; v.shm_nattch = in->shm_nattch; v.shm_cpid = in->shm_cpid;