From patchwork Wed Apr 25 13:22:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134292 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp861811lji; Wed, 25 Apr 2018 06:23:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/R9LCvX9yM4kDHkH0GIJf+34YleOXbRMFbT33aoqJIW9Ns2djn+/uojI5U1mDRVek4LH/0 X-Received: by 10.99.124.1 with SMTP id x1mr23120668pgc.286.1524662583682; Wed, 25 Apr 2018 06:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662583; cv=none; d=google.com; s=arc-20160816; b=RKtubiSZiiYwkR+iBGtwhr0sjTJPvvGgsbYmci6CcPrvlqX8LySi0YnoykdrJSWRgt ttb5n0dX0oZPYR05uuIi46rsupYsQfMxAEc+K1GZFP0XLfnpLe9TPC6ufGt0fUP4wTlU MibUEs3UVufULTF5ctyiXFJtGM/S0Warv24n4WFtpoZuPtK9AK+0+PJUcnR8I6GTP20j unfOU++62/EJTVZMiEtBbialrk5KXdennFFrkR06TmsYhyiMgwu9bXiIUYqyvjXCWyQb ax0PWYjGXM+PZXB0b3nSTkNhOy278kzqsTdDeu+iAGDrWMR3i9uPiNEyLO1JNQ7Tedq8 X5mg== 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=n21C6+7DXqa1/UHMo9GxpKf5rBOCrpEgn9YzE+CmHpc=; b=GZOro7OO4OoIVRbIcJm163urjfAgC/iyJf0A2wR3sc1BcXfMdyeDuUmuSGSPAkRYN/ vYG74jR6TRP6J+HFIeIYNVG2rwmOwMQGm4imC/g+WXQCJgff1VvlrrFR4hAZAq+fvQZ5 7+6xxRdHuVTshbYxWmiPV1eZFI4g6msTkX+ti7GkJ+GK46YL79B4VKyJBiiNBl2cF6SM mVnsAgiqKC1sdLo6ILEttZe45W9Y+ZpTj0HlW/UCdW/PPJzuauKepTFSi8rZt13WfUe9 R6b02EtpGo44bD5yYPdhCv2CVhjbfk7eeFNojOaN8CBe3Njjd9Okor479x9Dm8qtf1r/ gdMw== 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 m22-v6si16009597plk.214.2018.04.25.06.23.03; Wed, 25 Apr 2018 06:23: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 S1754157AbeDYNXA (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:00 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:56069 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbeDYNW6 (ORCPT ); Wed, 25 Apr 2018 09:22:58 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MN4u0-1fHx9d18bA-006enf; Wed, 25 Apr 2018 15:22:57 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 01/16] y2038: asm-generic: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:27 +0200 Message-Id: <20180425132242.1500539-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:QYCyxVRnoRy9Hk+2mwz9zq6aFgwoNeCl8lDL4XVuUCMPE/0uhxN n99QW50Laoqg1E1HKit2mh5UFVdQv8/NQH0uYMYsjEM3F3ImxHRvDtbTumsqQ0UzcF3bvBL kISTXKq4ck2yoMRo7zzmxjQOc9pf/jYVKwfElHbnln9aYsEQ8IqAIt6p6+XpJfTABB6i2d8 iOyNSU89+FcaMlLaIq2lQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:P+y59aTOQAY=:QGdylhjntopVQpGbRpgfee OhWVAIlXIfpWTsCrzyWuPb0JAwz+a3fNRYHAmp8y7Yj0tzzN4AzSz/YyJvr/essCqnM8V+oiR mAINpuWvP72bxZ7mzO6yneyjjwIJN/fNz6YxGedh4KWWVb5pSyQiquBmjKBu9YyhC6pniDEOe zQqgAQEuwLowveB0MJtkCjoT+duEGb5AOWJtB1zeK63vFWsNO7KFkUE4fIMG4E7CTbD2AIAVl HkTagn8wVYt3D21JR3QOk9PcYj/ToMFGT8epOxUT1YFJneH1aqEk3wIMJWM/GUxHfDSEw4xJG 77f4bZMgIvNkT66trv9l5vpDzaFss2SOusAld++o4Z2Pu6DiGUHChNC5m+XfOWgjuh/65RDW6 PmE1pbTPCTPmCu7ZN3njLMkJVDMyHerhiAkw14Q2Ylm+dx0g5al8wKZ4oeT3LofZt6RtVECxj B9AzqHlwJ//HppACRKIlD/3QwYC/51BzQSYQSrdyQNkIP/X8hDzlqfWH+vL/Y3Zm+gHm7EVei 8xPSiuMcVjyYGulbNi5Xe1L1yvzqj+z+JvHBUw37x/lA/r98dJRre5gFhBZv651ogpfWvLb55 5IP16zFDjdFiuPiqg2KuxjJV0FQVK+bWUx7ovmpp+HZZqxUZmWjN/O8ZTp9NKHisWNOsbzlkl 7PtRRjI+GrocLUhhGH6IbiDlWJTEoy0xrSns/SCugS0TvigSyWCHtg0vM3jD+Iv1DSthu47TI t8pGZB4/gPYIyP8nxBRz4pOx/subK1lLTZPdwA== 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. Note that msqid64_ds and shmid64_ds were broken on x32 since commit f4b4aae18288 ("x86/headers/uapi: Fix __BITS_PER_LONG value for x32 builds"). I have sent a separate fix for that, but as we no longer have to worry about x32 here, I no longer worry about x32 here and use 'unsigned long' instead of __kernel_ulong_t. Signed-off-by: Arnd Bergmann --- include/uapi/asm-generic/msgbuf.h | 27 +++++++++++++------------- include/uapi/asm-generic/sembuf.h | 26 +++++++++++++++---------- include/uapi/asm-generic/shmbuf.h | 41 +++++++++++++++++++-------------------- 3 files changed, 49 insertions(+), 45 deletions(-) -- 2.9.0 diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h index fb306ebdb36f..9fe4881557cb 100644 --- a/include/uapi/asm-generic/msgbuf.h +++ b/include/uapi/asm-generic/msgbuf.h @@ -18,31 +18,30 @@ * 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 */ - __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */ + 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 */ - __kernel_ulong_t __unused4; - __kernel_ulong_t __unused5; + unsigned long __unused4; + unsigned long __unused5; }; #endif /* __ASM_GENERIC_MSGBUF_H */ 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..e504422fc501 100644 --- a/include/uapi/asm-generic/shmbuf.h +++ b/include/uapi/asm-generic/shmbuf.h @@ -19,42 +19,41 @@ * * * 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 */ - __kernel_ulong_t shm_nattch; /* no. of current attaches */ - __kernel_ulong_t __unused4; - __kernel_ulong_t __unused5; + unsigned long shm_nattch; /* no. of current attaches */ + unsigned long __unused4; + unsigned long __unused5; }; struct shminfo64 { - __kernel_ulong_t shmmax; - __kernel_ulong_t shmmin; - __kernel_ulong_t shmmni; - __kernel_ulong_t shmseg; - __kernel_ulong_t shmall; - __kernel_ulong_t __unused1; - __kernel_ulong_t __unused2; - __kernel_ulong_t __unused3; - __kernel_ulong_t __unused4; + 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_GENERIC_SHMBUF_H */ From patchwork Wed Apr 25 13:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134293 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp861879lji; Wed, 25 Apr 2018 06:23:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx48k8fDiXX+MYF5cZ2YVMRtPbByNVPKJkbvXGmbZkMc8JOKu8kGJyX2mUh1i4bEa1JY+hlqm X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr28810497plk.36.1524662586670; Wed, 25 Apr 2018 06:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662586; cv=none; d=google.com; s=arc-20160816; b=ls9nlLYScP1uXVzi1gmpvBlZAmxKXVQh/6LcLGDyYQez06P3fcLXBICyBiyp0hWj5i 4CFsXPmX8ZBG2dLqB0Ow5WIjPVnK1QGqg/s6RZWINpF7EnTl80nNYii3DdVF2ORFxq4n 9DHhHHwx0LjhbibyKRwWwyLFDXDqXv2mVpGB+XDkk4CwMFxyweCTbbn0RpmWx8xnh7iA f2M3BCimHSwzZcvt1h2NuUd86Zm5k3AMBLcssY3qYDVmxaTsCSquzP5dlNVmmpA4dq4o 2oA6EJgfrxms1CZq9imvrB+GC2ZRuOeJ5ZV8e7CiLMwL81mQKCURZj6XPzqX2CFt+gHK eG0g== 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=+iX10soMDLxfroW19wxglJfwum37fFCl0JU7rorTpaE=; b=NquKPW8j+rfgSPzmSEtKds9cCfGihcIDtpdImhAait18RG2mnQlJMmmtraWRsgk4rf 2lH4YrML34YbQlyGSNHsk0oGhAIY1UNF9IStb48vKvBuqHemIWG1yAuo5EaC6sEAyoWx Gw9ePyMymyjR0A9woggdTFapNDkxjFlQz/0Px/fMtqu1Svcp0PneGw0QG39irljuOOXc nrQzoqCLYanhUjp7O8X0beIAiqTEc17+n2ojtPwCDht3sAzRMlTUU0EvxnwAgqxfxVQ8 cq+OWeL8zZ7CNjMiYCTzjdfqe7SyJgSCui/38coHMKX5+pSY7NjnzW0e3ltjq5v+8gIq MYbA== 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 m22-v6si16009597plk.214.2018.04.25.06.23.06; Wed, 25 Apr 2018 06:23:06 -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 S1754222AbeDYNXE (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:04 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:34625 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752829AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0Mddoi-1f1WlZ21IC-00PQ6V; Wed, 25 Apr 2018 15:22:57 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 02/16] y2038: x86: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:28 +0200 Message-Id: <20180425132242.1500539-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:hwYzL4dDm+VjP2fGL4HeIgBy60kDoGpFzOynzUKe165fDM1G5Qo cnUIMvk3z+AZCeTBHqO0MmqMKHB/DzFiMKL3uxm7+Uj4FATIs5zZMl0bMaYyCMdOsy2wWOJ lQfpHJ8ggyRCDSbcHp5T3bLrfxilTNX/znzj0gi2B8+JM4AQQuW1jm3p1OWIoM2ZiaRsWpl fr8ypqq61KfWxLOjnHqJg== X-UI-Out-Filterresults: notjunk:1; V01:K0:N4kpLiWWGE8=:pSl4pJ9bQi+Shh2D5MTXJq 4hrKxuobSwAz/Ypl0BLlKGelIdic/Wpx/IT4a+OHGiEg0NAtYmsh5qWIe4K5h5ff3FOmL7uBJ 8ihQvQ+qANGEosJAPrLDGUY7y8EEd4WXF1wpnz9R35Yj2kwc4UGo63iu/AX4BLb4pIfg+4R4H 8vGiasQhxiMZyGgIZWXinzH/8EMwBQe4DkCB+pqy3xYorT1rKT9dTZKj74skL9ItseB1dkUQo tHujaB3b6BELbXupuK5xB6wIDSfDB5I6n0+cwLYV8teLGAd0rI4Ih8h+PjT3qVjgcPD7Ih0xm Bp79AghsUbRX3vW6bQtIWFZ7O82AcRkRZo2ixG8VxBhgbw8KOLIGBK5NgSwqQ7E6uUwfcXFBZ 3IjLUtxM6HNxwJfOtI+3flJCSk7eiGjGahanEtOI/u10fYt0OvXL2m815WxLgxQiZaVv8CK+y +jDPTl8sJXdHR/8fQkSV7Vr6rSDv/4SxIppDxhb731+qZkcqYBRzT5iXuNFrXnVg7RFrxwK/9 P++P+FiVHzXuDpzC2/JeIGaFyu8p0HcpeeZL1WRgjxis/M1dx8QIQ/KdMZrZ/jGDmBlibyEZM MfXXx6Q+YbQTEQHLwYFJyBLQulRaEYpZEhEGHBy3NLnjlW4AyPGWKdxqtiFi7kPkD8Q8vxWyj lVFd6QY4zantOlnU0sjgrVO6A8NGo1taKp88cuIuSmy8Yuq95c32i4vMcFCC10ELza9NQEOnW 0SqgtESBnijyxuOS5gDS6HW2fnVvlyihEKtn3g== 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/sembuf.h | 11 ++++++++++- 2 files changed, 26 insertions(+), 17 deletions(-) -- 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/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; From patchwork Wed Apr 25 13:22:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134313 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp865306lji; Wed, 25 Apr 2018 06:26:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EDBSUeZlk1boLIMUYfoXfnCFQHaMkhaTZA4ELaCyc6sN3lDfHZIdVd/KqsIvB+UtHxqjC X-Received: by 10.99.177.5 with SMTP id r5mr23015882pgf.186.1524662767213; Wed, 25 Apr 2018 06:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662767; cv=none; d=google.com; s=arc-20160816; b=bWf0ZTzAUMEkZx8wM8TfyBIAIPeEfezczvwp9a6pHkCvOpmq8Ti33X29ZUR35GR3nZ HlV0jajBvaMYMOOKRNhqXDfeZxOm2FsWdIJOawagjK6cIB0bOWigF3L8OGsNwOQQ3EF3 lq5QJ0zg5NACQfg8PJo1KsLtvvTGI5fcCkalW3IZySVn5EUFA1DALWF//HCxRRVB6Kd0 D12Mf5LM5X2Cra3HXaHtORPFt6dxICQWSwkVP3Ojpb3/qD+S412fw7xuCddPCmC0heAv UtiD4QoGfqnATEjk+MgMQxwjq2VqgqrDLFA7zpfUnAycqSSWubZH5KKCpgCH3H70DyEm bTcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XtM7rZEhfNXfxy5aDuJ0byj9FqIRVtPU5RADUe6Z8Qs=; b=AjfqZxwnJuWGXkBTtqlxJIcQl4vR0TpZfwPE/Q+KylsZy2vDYrw9VqNZr7WyNb2Jqq XqAkv7k+VpsOz5vcuhYxM64fVkWt/72bv9Xf5no9O0MpUGKoUOUkyQcXroF8iVR2+T+t CmmO6UbjJ0LnGxlTY8hMzvDO/XUP5SuMBgvKhUOf8QIda5EYh89w2nX6CsoEYFeKegxk wCxxH2CAcUbT9GcKm0aXZb+CwvmnWoaK91SpP/0XVTM0iSN6yNlMeRhl+iXHrV03pCJ4 9fA8pPd0tyJJy2KkSsIHP2We9pNBdWS6Pn5siswUb06fF/s4nI5V2tzdsJ1lH8T0Rkh9 wzbA== 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 l22si11500064pgn.74.2018.04.25.06.26.06; Wed, 25 Apr 2018 06:26: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 S1754594AbeDYN0D (ORCPT + 29 others); Wed, 25 Apr 2018 09:26:03 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:39133 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752985AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0Le53E-1eaxQL2uC4-00pqyJ; Wed, 25 Apr 2018 15:22:57 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 03/16] y2038: alpha: Remove unneeded ipc uapi header files Date: Wed, 25 Apr 2018 15:22:29 +0200 Message-Id: <20180425132242.1500539-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:nNxmCVph91iMEuhvNV8ggAHicLgiXCPVDs/Lox21+qZXVcnvyQC xfAOqtKdsr3zO5dt15bcLUHKJMgsBVHTXFoW6F7Kc8zYMFEpx/El5lk3RfVM21s7E3Etms4 v6JrfKuKWXZWyDmmSKIkWdAJZlHV/NdYWhZIDMRWtFrMIim9+CoZM9Z8uY+REkx/qgupHCf NOK7wj6p/yCk/pSMisLLw== X-UI-Out-Filterresults: notjunk:1; V01:K0:XoRTgtyhi5M=:41IBRo/KyEVKOBaBbCo1Rn TaS+23yR7djdU0FIhhuBC0cefx8Zjx5CrCNz30iH/MhwbLHOlVgZr0tygQXLp0Pq8VZLHlf1N SICBeE6NeHm5S/WshP11/y8sh4+ECg5qZ1wpHGTJaTGEyu7uPnl1m9gnWNS907SvCEuOsEuv0 j2uGn13+UsYmJVjQ2t10Id/cXII9npNNHuucwerKWMB91c9cWffibDhr4doU6fy5++Bm+aeMT lZBHwAWMgE842rhVKFh8ah9ksWod6f7J7dv4ALCZwx6ZhZxXrfWjiAJ5GRYUKuj5B1mCQGCb0 rpJ+P8YOTcpB1adB/OQ+M9umFatY2XBnp52B282bHlEmjC2Np8zsjT4jo6AjtH+klwFoUep00 Vaody6kXRcbO58gBg5jWTn477D/i9DxNMHIR5twt+kjuqUKXiD6610H16zNujvzTeMD08qo6J R+npynexCo+1mAJB0yBv2Wtsk47jtIx/Yztqee0fb/wbyP4NIZj70PY6d32etekEtSn9pMFrz yHUoz14WmH9MuNRGIPnaQ6E9J5j9+WdeStYEy4/uC3A/YgLwoWrEuibgmBD1WbWn6Mo7sUSNF h2+ymEe9mUAn07T8QKmjLE6qi0Iv43KKU8XfjLL9mIgJs25hnfcjMDdjJfjo+0c9DYRzhDaU4 DjYtJBvFvppkHKfjc8DhaCOpE0FxABMKJPONNQ9MLNkXwFtVs/TGljrB/EF3XywjyFMZfmx9q G7SH+GueR724+lZzsliTm4AhoNq0LHCWeeASYw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The alpha ipcbuf/msgbuf/sembuf/shmbuf header files are all identical to the version from asm-generic. This patch removes the files and replaces them with 'generic-y' statements as part of the y2038 series. Since there is no 32-bit syscall support for alpha, we don't need the other changes, but it's good to have clean this up anyway. Signed-off-by: Arnd Bergmann --- arch/alpha/include/uapi/asm/Kbuild | 4 ++++ arch/alpha/include/uapi/asm/ipcbuf.h | 2 -- arch/alpha/include/uapi/asm/msgbuf.h | 28 -------------------------- arch/alpha/include/uapi/asm/sembuf.h | 23 --------------------- arch/alpha/include/uapi/asm/shmbuf.h | 39 ------------------------------------ 5 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 arch/alpha/include/uapi/asm/ipcbuf.h delete mode 100644 arch/alpha/include/uapi/asm/msgbuf.h delete mode 100644 arch/alpha/include/uapi/asm/sembuf.h delete mode 100644 arch/alpha/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/alpha/include/uapi/asm/Kbuild b/arch/alpha/include/uapi/asm/Kbuild index 9afaba5e5503..1a5b75310cf4 100644 --- a/arch/alpha/include/uapi/asm/Kbuild +++ b/arch/alpha/include/uapi/asm/Kbuild @@ -2,4 +2,8 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += bpf_perf_event.h +generic-y += ipcbuf.h +generic-y += msgbuf.h generic-y += poll.h +generic-y += sembuf.h +generic-y += shmbuf.h diff --git a/arch/alpha/include/uapi/asm/ipcbuf.h b/arch/alpha/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/alpha/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/alpha/include/uapi/asm/msgbuf.h b/arch/alpha/include/uapi/asm/msgbuf.h deleted file mode 100644 index 8c5d4d8c1b16..000000000000 --- a/arch/alpha/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_MSGBUF_H -#define _ALPHA_MSGBUF_H - -/* - * The msqid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - __kernel_time_t msg_rtime; /* last msgrcv time */ - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ALPHA_MSGBUF_H */ diff --git a/arch/alpha/include/uapi/asm/sembuf.h b/arch/alpha/include/uapi/asm/sembuf.h deleted file mode 100644 index f28ffa668b2f..000000000000 --- a/arch/alpha/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_SEMBUF_H -#define _ALPHA_SEMBUF_H - -/* - * The semid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ALPHA_SEMBUF_H */ diff --git a/arch/alpha/include/uapi/asm/shmbuf.h b/arch/alpha/include/uapi/asm/shmbuf.h deleted file mode 100644 index 7e041ca2eb40..000000000000 --- a/arch/alpha/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ALPHA_SHMBUF_H -#define _ALPHA_SHMBUF_H - -/* - * The shmid64_ds structure for alpha architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused1; - unsigned long __unused2; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ALPHA_SHMBUF_H */ From patchwork Wed Apr 25 13:22:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134309 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp865175lji; Wed, 25 Apr 2018 06:26:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpwPwG423x/lQaxI2nzdxTMRosLi3tj2GPyWRXN7PfUqGFRLkJMJmQ+pgUs+GnTbTxL+o0n X-Received: by 10.167.133.131 with SMTP id w3mr7993200pfn.197.1524662760513; Wed, 25 Apr 2018 06:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662760; cv=none; d=google.com; s=arc-20160816; b=y1AvEHelQE7fdHO3DuQ3QjGYXJIFq80GEja7wH3rtvqirLFiqUjeby4dPRQImFVXQq mWVXMrJ8FdLFAcwTq3ttaPvRoIA/fLIPzmEDfhMpYShAyZQmmdy+cp3IS//NeXpZIkB6 y3NC9PnVRQRw46WOTLwhG5hxf17QvxPI6u1lI+rjWeh7QEBbbb01Uin6nnskC6FneTiw OzUMy34s50FZcgt1Db3jfV8MZr4hmfY3xjLXWRL02emP21MHZi0YON8TgoGtoRVv9pBL 9FA6uPNwnEb6LIvo3vpRg62l3P3HDjEG/aN25++mG62YEC59VPDKYL4Lnl2Ru9M27FY5 Z7wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=scVQmMPibmaUCjrnlkAhD+FtGGnY/E4Zdr7onZX+a7k=; b=WBZYXkYgLsd/0uaN7Mg+onfe1Rdhkrr4yDvlOxdgn00zKYvAHcLh4I0CJF5K0XcA2c G3b6ale7KsvbRX44xbM5+BHJXzlhc/dWVHa6WLaaA8VceBRE21yyd+LUzSGvOMsr7mN5 M8/0dgPSYMyKBV3GBqTINlMMCioxi6U9Lr+IzWIZC3f61ukRN9k9Zq827OfekQ0/XmFm onm6J1JHRFRsFUrIej6EPjEGlnBvjo8AaJwUZF+VtqKfs3TpmaHLpT1uBqfkV/am3OFT BmVGhubz1Aa6ODxnEP4ZPPvshaa0BtBa6DM1W2DUG8rhlaUEhmujIumCrRNIjWHnIukl U8jQ== 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 q1-v6si15689808plr.477.2018.04.25.06.26.00; Wed, 25 Apr 2018 06:26:00 -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 S1754434AbeDYNZ5 (ORCPT + 29 others); Wed, 25 Apr 2018 09:25:57 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:47113 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753040AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MWjXP-1esU4g3mBf-00XugG; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 04/16] y2038: ia64: Remove unneeded ipc uapi header files Date: Wed, 25 Apr 2018 15:22:30 +0200 Message-Id: <20180425132242.1500539-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:mfVJNYq0oJtcLAxIGLSlzLBS734KezI4y2tjRCdSQ7NvFCUvRnG UV56CXaVktZT1cVQv62kUJ2LdGsYXzAYx9BlaVApKBVAUGePeBIhlLrDGwx9KAuHWPJak7F TS38lpUyPhWaZhwb1iGU8wYk8PilnF+E2/tOVvPCt/QFdJ1hNFQWZHBHITlsae0mj7K0eBC jzw1/rTB7X0gjauCvQsHA== X-UI-Out-Filterresults: notjunk:1; V01:K0:enjv4TuoJZY=:PaCONPSlZz97KmQ6O5LccO vWLgQTr5OohbUL/Zpau/zQUHi+ee4ODgUSUfCRz4ZPIgSUJWqlr/9PNF1qS6A/f4YBLFsKrEx ytAEdICJlc3uu7aBxk7o001XhqNCyUUWMbkAiVIpm1uvGZJ4uTMoyRlTooZb83E5IvfMZJ3p4 gslytLqdZ8IGL+DbK7TYggaCsKYHguGXGhbp2f2A3OG1OXY/D4JZXp0AYUvmdffU0tjkE8716 q6o9/lui2qZa5HRmyu+HZiO06i6sYi+FQYWEhzSNxAIPIoG8gfJHDC0wqROn+BxQuL47QbqJ+ zzK33g64XFO5Nv6YIvSTGET/Xil4CG9k8eX4UepqOj0jZzcAwHoeBFy5qaBEuUZVrTTx2RYA1 6Skqknj2NDDB8kyBdyXTAKlIPE9stwevD6Ev+XY9q4SaSPU158deoA0UFXiLdoQMWnKy0G0gp jk1lbRFvznGlPOP3HPWwPYVZ3cqK6AgdctHm3cDQsb/jzyOKpWOjmx61uRWgJfXEuao25mM6A SdcRmLDdPfM3EocIXwSyh3jKE9F4kZ0sLe+5ZmuTme0EVvEyRBIWUgCmOoUrJX1LI49ucGQOg KIyiMKdMcGkTmiCZTroVOmu1gzD0IUsRaKIBnx0wCBPd6qSkr/B4KgfM5mFDgtr0EFBwNFzbV W0nusEv3P4iVQupSUXOgnWL1vqVc6PPIjnPvJqYowOQU56MFrWcDfeBLWD48x8wJ+D4FYYTlp 7oJTozdMxj1f/LnMaoRPcomu3HnfL+op4CqkiA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ia64 ipcbuf/msgbuf/sembuf/shmbuf header files are all identical to the version from asm-generic. This patch removes the files and replaces them with 'generic-y' statements as part of the y2038 changes. While ia64 no longer has a compat mode and doesn't need the file any more, it seem nicer to clean this up anyway. Signed-off-by: Arnd Bergmann --- arch/ia64/include/uapi/asm/Kbuild | 4 ++++ arch/ia64/include/uapi/asm/ipcbuf.h | 2 -- arch/ia64/include/uapi/asm/msgbuf.h | 28 -------------------------- arch/ia64/include/uapi/asm/sembuf.h | 23 ---------------------- arch/ia64/include/uapi/asm/shmbuf.h | 39 ------------------------------------- 5 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 arch/ia64/include/uapi/asm/ipcbuf.h delete mode 100644 arch/ia64/include/uapi/asm/msgbuf.h delete mode 100644 arch/ia64/include/uapi/asm/sembuf.h delete mode 100644 arch/ia64/include/uapi/asm/shmbuf.h -- 2.9.0 diff --git a/arch/ia64/include/uapi/asm/Kbuild b/arch/ia64/include/uapi/asm/Kbuild index c0527cfc48f0..3982e673e967 100644 --- a/arch/ia64/include/uapi/asm/Kbuild +++ b/arch/ia64/include/uapi/asm/Kbuild @@ -2,5 +2,9 @@ include include/uapi/asm-generic/Kbuild.asm generic-y += bpf_perf_event.h +generic-y += ipcbuf.h generic-y += kvm_para.h +generic-y += msgbuf.h generic-y += poll.h +generic-y += sembuf.h +generic-y += shmbuf.h diff --git a/arch/ia64/include/uapi/asm/ipcbuf.h b/arch/ia64/include/uapi/asm/ipcbuf.h deleted file mode 100644 index 90d6445a14df..000000000000 --- a/arch/ia64/include/uapi/asm/ipcbuf.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#include diff --git a/arch/ia64/include/uapi/asm/msgbuf.h b/arch/ia64/include/uapi/asm/msgbuf.h deleted file mode 100644 index aa25df92d9dc..000000000000 --- a/arch/ia64/include/uapi/asm/msgbuf.h +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_MSGBUF_H -#define _ASM_IA64_MSGBUF_H - -/* - * The msqid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - __kernel_time_t msg_rtime; /* last msgrcv time */ - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ASM_IA64_MSGBUF_H */ diff --git a/arch/ia64/include/uapi/asm/sembuf.h b/arch/ia64/include/uapi/asm/sembuf.h deleted file mode 100644 index 6ed058760afc..000000000000 --- a/arch/ia64/include/uapi/asm/sembuf.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_SEMBUF_H -#define _ASM_IA64_SEMBUF_H - -/* - * The semid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _ASM_IA64_SEMBUF_H */ diff --git a/arch/ia64/include/uapi/asm/shmbuf.h b/arch/ia64/include/uapi/asm/shmbuf.h deleted file mode 100644 index 6ef57cb70dee..000000000000 --- a/arch/ia64/include/uapi/asm/shmbuf.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ -#ifndef _ASM_IA64_SHMBUF_H -#define _ASM_IA64_SHMBUF_H - -/* - * The shmid64_ds structure for IA-64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused1; - unsigned long __unused2; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _ASM_IA64_SHMBUF_H */ From patchwork Wed Apr 25 13:22:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134311 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp865256lji; Wed, 25 Apr 2018 06:26:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/OSCAFl3sAKjVEuVqqECGpwjMSKZ1IwH1fx47KpwI5X2DLMKDvmJCC2G0JJSGityNa54UU X-Received: by 10.101.76.77 with SMTP id l13mr16441807pgr.46.1524662764207; Wed, 25 Apr 2018 06:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662764; cv=none; d=google.com; s=arc-20160816; b=DdYeN+Z/WIPtzcJ6KqITwX4BndgQsD0h6EzJp9cigfv4ylk2ruvYYmdRJa6EtrmxVA C2r3NvxJ2vll/DkXU49aMX86ZFBpucnozX+T0M3OOR/gNDpoHoxigFygmIgXpu9Y0zXm 8K5ZGJXebABqe4A/rRGk8kv0z396ly/BjsHDhJq3oGtpclzqA8CzI3uTK22FkRAB1hz4 FAndc+HN2Vd4gt/qIXDr6mdZ8SzpEYUlpNBzuVuJ5ALagpXVNQ29x7yfRpQtKhP80tWt BohBCtWrUPKR4AKrL1bqB4jyVAjaba+ydvfP4I0b4TVCaibXu3WiARrh1AfFiNLqzwqB 2IUg== 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=i79rdsUgCi4psCZeuUzrVQSFeCQdrNBTw2cSNLXKi4w=; b=Ib1/wcFtaL+lRDFXrrFnJs4N3vByIOJMoPz9Ks0l4Xt6IVNpuPaAWM9dZ9nkTt2QlX wa0uJmS3z04yFhcCNai+WQBOy7rZXyU+3BU2PuGHpzbQEw+P2vJTXraC9krgwD8Es15d g08gPnPRakdWYAzeTI8qQdnalbKRcgMRx9Y2Qvz9AyEpj0tD6MA2b2jVaC0CUT3m/jBu cWfEFrNUy8/extX84YrHdJ6qjXXR6kaB3jdhX0qHzenlwGImmdr+6uRyV4028j2UkBiF JG8M2tuhyO4KndQKmIzy+Ce/WnKZ1PiKjgJy3WNoGaRx/lYwgEUnbszhI0Mzdt8k4bsa i55A== 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 a23si11991128pfh.295.2018.04.25.06.26.03; Wed, 25 Apr 2018 06:26:04 -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 S1754452AbeDYN0A (ORCPT + 29 others); Wed, 25 Apr 2018 09:26:00 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:34925 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MLfrX-1fC9b70UV9-000sAe; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 05/16] y2038: s390: Remove unneeded ipc uapi header files Date: Wed, 25 Apr 2018 15:22:31 +0200 Message-Id: <20180425132242.1500539-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:zePQTeRdeE7zFeZ1Qfq8ao1FJNUDtbxjwtwaGAWUJUyZIPhsmeM LJjBwNwZiTsPDArZBKppSE9EdjjAD7v6VfYEROr1lrIk8fKNtMyLC0ikW3YSZp+sp1oChk7 h5dxGDtLZO1LGUPUQXGTVM2Jh2lQmmMLAOw6X1R7RVTWAZhhNfgUQaP5WEfEe8c6zDtRNCA gQ5lXfqvDmoevGfVxV8bA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Xd5aQGE5T2E=:Iu+hWtV7l18hpZKk6Dsz1u vkwng5wJjsfOf3zAPM4Mz/ZQDshVUnbAVeMc7Lmnte0+zdS8mLFJuYop9NqN1YaGV2qNqAXNQ 0WgsYKL82NJ23yYWQtXYMdXgjx+j1J5Xr2QervEyPa71GC2rv1WMrDszYLQ4efzVYFHRwR6GY WNA0P+Aj5cjJym/rmUPaKDFuH1uB2wFou7nOeAk6jwV8WpRo6DxRUnSf+7vpFla4iKDJX3caG s8nI4mYCVvkNZ+mDzxzenHVduf7msvDniUT5pC8Jy1/NpEPOV3Igr0ertOFyLD+8lp1IMECwI G3Kf3xQab21L88cZ5LwXZ0zRJNN3wMrPyIrbCLQm+Esgi8s27bZPtxyoRNLKgjciiHpjYQJaJ kuqC7RuHbeZZb43L4xdmm1Atje0lqTUxbsLdNrOrQVes6WBRhtm0C+cAwz1RyGNK5Yb1js3Qd CXJ3Y9pFES4JSRxmTu++GtowLcgpZsKVO5C+cBpwVn9FHjtL/hoOXs60a0Sh6nmwqlJvt97br FvVXHPtHSd2Om/haqNKYkl1UYaSXybvGc1ZKk5dGNSY0QS8p0pXOBOcPcQRERseUSInpeFOdX VLMpJ7AJjyke+S+nxgO/mzGsspDi6GEjgTASBLxETzDUgIEv8EY07EyorbrLfDw1DXfc5j2ap nD0z1/NhqhlH+UAOzyIgcwLVm6iwAHUpSjvPqDqAGLhOVFPn3woRes1UWtkvM9GJuh/3i1N/C TUUgfC3gT3Z8cPJE3qPfGNinZv38AewmRiuV1w== 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. Acked-by: Heiko Carstens Signed-off-by: Arnd Bergmann --- arch/s390/include/asm/compat.h | 32 ++++++++++++------------ arch/s390/include/uapi/asm/Kbuild | 3 +++ 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/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/Kbuild b/arch/s390/include/uapi/asm/Kbuild index faef3f7e8353..e364873e0d10 100644 --- a/arch/s390/include/uapi/asm/Kbuild +++ b/arch/s390/include/uapi/asm/Kbuild @@ -9,9 +9,12 @@ generic-y += errno.h generic-y += fcntl.h generic-y += ioctl.h generic-y += mman.h +generic-y += msgbuf.h generic-y += param.h generic-y += poll.h generic-y += resource.h +generic-y += sembuf.h +generic-y += shmbuf.h generic-y += sockios.h generic-y += swab.h generic-y += termbits.h 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 Wed Apr 25 13:22:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134308 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp865079lji; Wed, 25 Apr 2018 06:25:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48VVYcI4VnUDP4Sq5wpBLe+ZIqv6OPf459/q2wN+61kIE1JFYR/mlZmBW523KsYV1j+//zT X-Received: by 10.98.56.144 with SMTP id f138mr28147512pfa.173.1524662756347; Wed, 25 Apr 2018 06:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662756; cv=none; d=google.com; s=arc-20160816; b=1GeJKC1YeXBvNy0d0mrcq7+gX8ZznIILT9fOy6ilSYmBO7NL00+aiiNR1jzkQ/Ue0H 13uviAGQx6s4enMdWaxBtcBKjAtBUmRJ+/mUYmVUhewS0+hlhNZio35M1Kr7xbRagRqJ ruAt9ZSUrkreUBHNi1nzMZiynHngt46hY+tynCUWSiXUnqs4+Fc8XkqL0IO4XEaQU6nu HhmCEq4DkEJiudigN0ioCU+cUvpcRQjRZgsZetrA5JZGSSkgs3co/ngmEt5fPxyDvvT9 iAfeyOrdJjj6GcPitWSCfkoKtgjZ12NMu66Afr6HdzlGeFjf5BTuKMdQPCv5qcwImxmH HkZQ== 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=jKj8bwqqEOTyraZ2KmpAbYJQNRwM/mjp41Z9Gh0rpgoukMSEVlsF4ZqnsAXwuy3sEe toNSwMPwh6uP2cYd6kbqRb3b9eECBub3xixPZzMOu0FalwJqWN43CnpU1KNsUJBttbQj FotYAhPoLw7lLOSpAcJfxBaUs6eSgf3dP0Fz2P6SDlmMKuA8f1cPh8yqLeDiqx8M8r5+ Uzu9IMCjNx+Fj/MviYrSoAGWSCZIAHjXYWBumbXrd7Hrz0fJ2f1PZZF2zgd1Ak2k6O09 S67/Jd+0Gc97lx70u2uzNNo3a/Vok2KX1EKNq05GKJczAE6zLdAo/ljCFQcQIVq8lwGt clzw== 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 q1-v6si15689808plr.477.2018.04.25.06.25.56; Wed, 25 Apr 2018 06:25:56 -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 S1754207AbeDYNZw (ORCPT + 29 others); Wed, 25 Apr 2018 09:25:52 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:52213 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753405AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LheLp-1eXv191KML-00mqIo; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 06/16] y2038: arm64: Extend sysvipc compat data structures Date: Wed, 25 Apr 2018 15:22:32 +0200 Message-Id: <20180425132242.1500539-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:wgjVUuMhxC3paqxcKqToMhbRmvhgaUYuIAJ4ev5lWWQTKLC/F2U 1Be2aBVaulk/gJatfg7RuTZOPzS63lH7EJWt7Ocd7Hw0quE/FOZ/Z5Y541v1mEyaavJTyk0 2w2E7RE2TFcAU91TYr7Q/Jx1OPwe/RErBBjlB3q5EZzbyMVY5WIoKMFaGn3NVO565C1aQqm yBLkKRGMTtHWL9uAmddHg== X-UI-Out-Filterresults: notjunk:1; V01:K0:KpeT+df1QwQ=:syNQ0sp9IUeW305c/MWtbQ /CWp9nH56+wR6oF0GVUJcPapl+G81PedvCbQVS7+3eQ5BF4MTKLCs2lpypiWWQ+SilUmtQ3YI 6tvMrf1xTQT0xFGcMjg3MN+ELNW4Spa7fLvvVuyrp3Ks9zv3oc2GSQsksC4vdqR1GKA052ScM 7bLgDWo48C6JakO54tLX2/T1wvUUvAiS6NxrH0L00PKE2EbItZq6t6YWZ1nBV31N5zyqXCG9E rikXXOmAd5Amq99S+91riEPXhDa7wP8RoQARQJVcPLU9bDU7t8XHbiOAQ7H304M23aDSCdN5A yzdz0kuBT1LAsf3mWEeU3bsn+Ih/+2cuCo4NFjw1sVpD3VP/QQGoxMIM6wpVBIRUeX+++xXWP HoZoUR0oj6kCj5gcctwd6RITMeVWQzkwMqh6k/Rs95dRDE7qHOjLtFKH/qKvh5fZjWe0xa568 lVY6+Lxa0X0XhgGCSYrTM/rvc7c2ZZHu27mlYId4frBNk2ZschlN4iSpxTfFDE8k6z6Novs3S XprL+i8erYtLNlYvFIQOJK/Govw1o3XtlncaAimXy+o8oLoLyRfqM8TAONRr4kVuaYsPF7EGs ZwFSWAK1Rv5Sz3UJqc/HWrRpYYWULQwnmCMO4yEcMRVPSVxt36h02vqAHJAEJ3IziNMKoXmW/ 1LWDPcI/6/MGtk67xTf9yS8bG0HGERDhyREPYyyXG1RsgvDF0tnJsYNht82Wiz3ZHLEh7aJoZ 33sFgoKTdMeIcsni3Ftbi4JBArewbabwovJkmQ== 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 Wed Apr 25 13:22:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134307 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp864995lji; Wed, 25 Apr 2018 06:25:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+6ispB964BhVoSJSmrRXevKsOHnjXuGBaXM+1REuDohIsc9xrMR3O6tQ80Oj2RDNXnOPCU X-Received: by 10.101.70.8 with SMTP id v8mr23721833pgq.336.1524662752207; Wed, 25 Apr 2018 06:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662752; cv=none; d=google.com; s=arc-20160816; b=uweDExJMvKpGVa+GI0CS4qfvWT59UL4PMZ2Tfg2Ohc0ve/6CivLcsW+0gFKHOgdd31 xH7w+gc3U9qZMpPkrkGNi63z2qhHDm4F2PPcE6dzcanNqOBHal3/wyH1bLouaTOPOYL0 FpyCvoV3InvKpF5Xi7jVnA4iRUvH8Fq06kcGYH9T88qwd9c4cnEY9wUBC0GIogS5vjMI bnDabOTOIasRCPar+Y3d8HQgvdyC5J1eZw95W4y1OlsmYkigu/Cyl8uugeVsO92vjvRB gtEfEoX3lynYDqidglVipZl3CdTrM9dvVuvtGTAzp4dGqufTP4JzYD8c0s4rlFpdxwVb ILiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=FrJlXdbBSOBOPVP+ss+6R3FFoyGHjbxMkFl3d7fS9XM=; b=eDgaPFqOfcmq7kT5DvrSW9NsGgm2fmwIfV3rVnPDuOk0exkWsrRVGQVTW82PELjphu I7MIeMHmqyyssz3pmlifX34MmUBZ6uBvtSOzUx1NtUxnxlF0bLssoVWaJG+9/iD+VYjt iZue6iUCfb9xAHd2KWT1pjiTsD4f9kA0LYsY2t+Ftl0pC0hpuEf2dUK3XOIpcI/Xx/F8 /Cfsg65ohlcASuQ93+RArEgEpovuVHRiggS2Sw1yb+XOcd0dXI0dRrZYx4AH+pi3TkPH WsHYqZmvHRnUg3O3RtPy+CgVddjqsfIBEzg4t/kUXLOC4YEvz81WmJ6qVhW1a1BlPGse IYPQ== 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 207si13863967pgg.29.2018.04.25.06.25.51; Wed, 25 Apr 2018 06:25:52 -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 S1753971AbeDYNZt (ORCPT + 29 others); Wed, 25 Apr 2018 09:25:49 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:57523 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753825AbeDYNW7 (ORCPT ); Wed, 25 Apr 2018 09:22:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LdmTL-1eU3P72BZD-00iyPk; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 07/16] y2038: mips: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:33 +0200 Message-Id: <20180425132242.1500539-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:aM6gKUZ8rDTz9+QSEXV6xv/ZnCvSaRrvFseit9dyX/Ydkzg3pTI eMIAlCx696bBGbE9nwc+zhVvSY1vp5QdSKtqfvCxjTp2RWTUeIT4kTcWren6oSRm8aU8uPC 2xtIDckls1DlRrN+6pjYy9z3/v4kp/lYKh/ABuIqDIjb+mDXy8jRRUN/b4Ue2AqsKTBLkYC c2t2Vk+0dckRjBWPO+CIg== X-UI-Out-Filterresults: notjunk:1; V01:K0:UbH0bf/wFbw=:LQfj+7ZlN7socAxQDOuZGq MlmuyXTe5j5NXVWcvRANzxo7wvEP5wxfJd0hY7tegtMnfTu+iV3Njvu2wvLD/x1yYZm/dIDKU ug+pn8EXracxoMyTgYPS+hN6CD/PiojusCrw/WdKpFouiiL0+uPXVozzo8ah3Apl+ZdePRSm0 jH1hWU5lIijPodSTVWI4wVjQ1t9UyuBZkjeZjbtHV7QPzKbt1bapC3S1JYn6xkZGhvzAPQYMg Gg8BLMSe78N085rjwcSMy/mMYbHaDNquV66L7k/xPylUm61MhE/wrI0bE3V7hcu1xhi4Oe8Fr 5xsXr0so1kZ9FK9LnQ2Scc2J4YYzmqiyLhuUpdUyQSszZ2a9hEHXNSm1xjf3qaIO5Udr2jNDG cl8nuZrlerVlRpF/3mA0DjlW3HRCUWY0wsHZtsAoooNXpkg3CRFQfSjxRiA/UuZT8lbI1quUU voiWE9HiFYXR1I0j/E6cVvQbm//OWe1s/A3CM72EMwkRSL3Fs8UymG6sPnd0qusmxSLiokYl3 cq0KxEmW5eudsyfro5+QkEYc5e/WG1cGIMeDMUv/dFhdWuvkp/EASYANE1yXTjZcq5blwHOma 0TDW2aDeAw8pL1W0t3DeNg0pYHE4aDfVGlNIpGTeEhRJDJLGXw3ikNdjGE24Vpn5eFHvXocd9 tInjOhRiJiIbvCQdgHFPxM4Ja3KqN/PMak+8tvElM5Hgt6nnmNQeNpF/7UPZLkR6x97MD8evS O1rgtHecoAESozBccdnSfLwLadSiVseNRB7JTg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MIPS is the weirdest case for sysvipc, because each of the three data structures is done differently: * msqid64_ds has padding in the right place so we could in theory extend this one to just have 64-bit values instead of time_t. As this does not work for most of the other combinations, we just handle it in the common manner though. * semid64_ds has no padding for 64-bit time_t, but has two reserved 'long' fields, which are sufficient to extend the sem_otime and sem_ctime fields to 64 bit. In order to do this, the libc implementation will have to copy the data into another structure that has the fields in a different order. MIPS is the only architecture with this problem, so this is best done in MIPS specific libc code. * shmid64_ds is slightly worse than that, because it has three time_t fields but only two unused 32-bit words. As a workaround, we extend each field only by 16 bits, ending up with 48-bit timestamps that user space again has to work around by itself. The compat versions of the data structures are changed in the same way. Signed-off-by: Arnd Bergmann --- arch/mips/include/asm/compat.h | 40 ++++++++++++++------------ arch/mips/include/uapi/asm/msgbuf.h | 57 ++++++++++++++++++++++++------------- arch/mips/include/uapi/asm/sembuf.h | 15 ++++++++-- arch/mips/include/uapi/asm/shmbuf.h | 23 +++++++++++++-- 4 files changed, 94 insertions(+), 41 deletions(-) -- 2.9.0 diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 3e548ee99a2f..78675f19440f 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h @@ -37,9 +37,11 @@ typedef struct { typedef s32 compat_timer_t; typedef s32 compat_key_t; +typedef s16 compat_short_t; typedef s32 compat_int_t; typedef s32 compat_long_t; typedef s64 compat_s64; +typedef u16 compat_ushort_t; typedef u32 compat_uint_t; typedef u32 compat_ulong_t; typedef u64 compat_u64; @@ -157,35 +159,35 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - compat_time_t sem_otime; - compat_time_t sem_ctime; + compat_ulong_t sem_otime; + compat_ulong_t sem_ctime; compat_ulong_t sem_nsems; - compat_ulong_t __unused1; - compat_ulong_t __unused2; + compat_ulong_t sem_otime_high; + compat_ulong_t sem_ctime_high; }; struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused1; + compat_ulong_t msg_stime_high; #endif - compat_time_t msg_stime; + compat_ulong_t msg_stime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused1; + compat_ulong_t msg_stime_high; #endif #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused2; + compat_ulong_t msg_rtime_high; #endif - compat_time_t msg_rtime; + compat_ulong_t msg_rtime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused2; + compat_ulong_t msg_rtime_high; #endif #ifndef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused3; + compat_ulong_t msg_ctime_high; #endif - compat_time_t msg_ctime; + compat_ulong_t msg_ctime; #ifdef CONFIG_CPU_LITTLE_ENDIAN - compat_ulong_t __unused3; + compat_ulong_t msg_ctime_high; #endif compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; @@ -199,14 +201,16 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; compat_size_t shm_segsz; - compat_time_t shm_atime; - compat_time_t shm_dtime; - compat_time_t shm_ctime; + compat_ulong_t shm_atime; + compat_ulong_t shm_dtime; + compat_ulong_t shm_ctime; compat_pid_t shm_cpid; compat_pid_t shm_lpid; compat_ulong_t shm_nattch; - compat_ulong_t __unused1; - compat_ulong_t __unused2; + compat_ushort_t shm_atime_high; + compat_ushort_t shm_dtime_high; + compat_ushort_t shm_ctime_high; + compat_ushort_t __unused2; }; /* MIPS has unusual order of fields in stack_t */ diff --git a/arch/mips/include/uapi/asm/msgbuf.h b/arch/mips/include/uapi/asm/msgbuf.h index eb4d0f9d7364..46aa15b13e4e 100644 --- a/arch/mips/include/uapi/asm/msgbuf.h +++ b/arch/mips/include/uapi/asm/msgbuf.h @@ -9,33 +9,15 @@ * between kernel and user space. * * Pad space is left for: - * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem * - 2 miscellaneous unsigned long values */ +#if defined(__mips64) struct msqid64_ds { struct ipc64_perm msg_perm; -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused1; -#endif __kernel_time_t msg_stime; /* last msgsnd time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused1; -#endif -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused2; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused2; -#endif -#if !defined(__mips64) && defined(__MIPSEB__) - unsigned long __unused3; -#endif __kernel_time_t msg_ctime; /* last change time */ -#if !defined(__mips64) && defined(__MIPSEL__) - unsigned long __unused3; -#endif unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ unsigned long msg_qbytes; /* max number of bytes on queue */ @@ -44,5 +26,42 @@ struct msqid64_ds { unsigned long __unused4; unsigned long __unused5; }; +#elif defined (__MIPSEB__) +struct msqid64_ds { + struct ipc64_perm msg_perm; + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused4; + unsigned long __unused5; +}; +#elif defined (__MIPSEL__) +struct msqid64_ds { + struct ipc64_perm msg_perm; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_stime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_rtime_high; + unsigned long msg_ctime; /* last change time */ + unsigned long msg_ctime_high; + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused4; + unsigned long __unused5; +}; +#else +#warning no endianess set +#endif #endif /* _ASM_MSGBUF_H */ diff --git a/arch/mips/include/uapi/asm/sembuf.h b/arch/mips/include/uapi/asm/sembuf.h index 2c0f507ab7d1..60c89e6cb25b 100644 --- a/arch/mips/include/uapi/asm/sembuf.h +++ b/arch/mips/include/uapi/asm/sembuf.h @@ -7,10 +7,11 @@ * Note extra padding because this structure is passed back and forth * between kernel and user space. * - * Pad space is left for: - * - 2 miscellaneous 64-bit values + * Pad space is left for 2 miscellaneous 64-bit values on mips64, + * but used for the upper 32 bit of the time values on mips32. */ +#ifdef __mips64 struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ __kernel_time_t sem_otime; /* last semop time */ @@ -19,5 +20,15 @@ struct semid64_ds { unsigned long __unused1; unsigned long __unused2; }; +#else +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime; /* last change time */ + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long sem_otime_high; + unsigned long sem_ctime_high; +}; +#endif #endif /* _ASM_SEMBUF_H */ diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h index 379e6bca518b..9b9bba3401f2 100644 --- a/arch/mips/include/uapi/asm/shmbuf.h +++ b/arch/mips/include/uapi/asm/shmbuf.h @@ -7,10 +7,13 @@ * Note extra padding because this structure is passed back and forth * between kernel and user space. * - * Pad space is left for: - * - 2 miscellaneous 32-bit rsp. 64-bit values + * As MIPS was lacking proper padding after shm_?time, we use 48 bits + * of the padding at the end to store a few additional bits of the time. + * libc implementations need to take care to convert this into a proper + * data structure when moving to 64-bit time_t. */ +#ifdef __mips64 struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ size_t shm_segsz; /* size of segment (bytes) */ @@ -23,6 +26,22 @@ struct shmid64_ds { unsigned long __unused1; unsigned long __unused2; }; +#else +struct shmid64_ds { + struct ipc64_perm shm_perm; /* operation perms */ + size_t shm_segsz; /* size of segment (bytes) */ + unsigned long shm_atime; /* last attach time */ + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_ctime; /* last change time */ + __kernel_pid_t shm_cpid; /* pid of creator */ + __kernel_pid_t shm_lpid; /* pid of last operator */ + unsigned long shm_nattch; /* no. of current attaches */ + unsigned short shm_atime_high; + unsigned short shm_dtime_high; + unsigned short shm_ctime_high; + unsigned short __unused1; +}; +#endif struct shminfo64 { unsigned long shmmax; From patchwork Wed Apr 25 13:22:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134302 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp863868lji; Wed, 25 Apr 2018 06:24:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48jGvTmqD97aR+MukiOnUA3FcXal6pbIRTrIF19Q7IJ8FpjeS2+cKz1vtbn7XIBiwBhGZsp X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr23072852plj.150.1524662691636; Wed, 25 Apr 2018 06:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662691; cv=none; d=google.com; s=arc-20160816; b=GuqubPFkwHllECefhWlrzDaMuaPcwmuHatYEgLzp222N4ENYSV81tDgDPWEUMWD++9 pDwwjzkI+zwtMulghTmGCo7Btb+YfyJh9DEFGVMIRrAblcucLlEfPNyDb99oa/xgWEUV jdUh1A/KYOkClH0riJyDcsv5ZbOM9a8cGIDZ1agjIKnht0n7PjB+xhuOeS9sQFhSv5n5 wmF5PDPPWCZl3CfdOIjIGGRzp0m/WRtrXvMUdXXEEXOZzD2H4EVBcrWgPwM2HI57yI0Q Rc/sxZ29lhUkcUvgQ1rzxFVi1KOaqkh4vXeXnNWcTCfQXYVrWc/rojvqtrCD/w3h7FY1 xBKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Zyy+4cXFhgVVK8I1kRuewmcD1U57zCk+1InHA5hMdZ8=; b=JLQefd+Ml1JqhbElS6almjqD4gE9Cj1HU/Ce+Ori1g202GCJaN3AOCmhyYsWTrC+55 nz93+WZoOSMydljcRoPPqnGzUu6M+N2Nt+2z/5ldyH6WrLjf0NB8kYaD0DkZHQ9CxZCf fZ3B3mn8wtnEbvRY5DLZ9dnXCaWlmW7XqqMN3JifcdcoXR1t1NxBSHwPXI38e8GGoyQx IocEDZn1vKStRJts/GOl4XXPXxu96itzKgM/hi9DfbT0EUj5kTzgblWcD724maJJ5q0V Jy5c+18gMqKCcYW3qMUSyEWh4OZnXgOqUJF/ipPjjc60qMdZ4frt3zzKTYI6Sr2/4vnp 0Rfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f30-v6si4473231plj.600.2018.04.25.06.24.51; Wed, 25 Apr 2018 06:24:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbeDYNYt (ORCPT + 29 others); Wed, 25 Apr 2018 09:24:49 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:58715 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753919AbeDYNXA (ORCPT ); Wed, 25 Apr 2018 09:23:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJU0R-1fEMWX37Gd-00341k; Wed, 25 Apr 2018 15:22:58 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 08/16] y2038: parisc: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:34 +0200 Message-Id: <20180425132242.1500539-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:lp5CK0JSLcpF9RtdK01TLgFsRd03M3K6QW7KO3EmMn4kdnOCWjE eza3NoWuZ6SBQuVgYdNLuyV65UECdJJ9KE56347ZKbIX4ux8GVvCmYxBRTfIBdK9b5rVs0I 4681DHLdRYZdjdE7k912/8TJeSvrILPDoCnQPGMppTRm9ZIF1zi987AUCI7GFt1Sl676/cz Lt2nc5tzgHwebyr+pNNaw== X-UI-Out-Filterresults: notjunk:1; V01:K0:HNujq9WsDwU=:T0f67Jqobbz7r4ro0yOxV4 wk8szbD2HNhGA3hoXo1IN62bmHUgkpwGXSCg7HI7WNiiQNh3kFqn2+mDopcxasF6Mp/054Xwq cX9zl0WLvL1Q2lI8Aniy5nCb8awvtQJpG3R5Gwunhh0OArGVYl68gy+KejAZ0tcQO42D7Y/0c 01jEomLBtYgq5Q01cLc/eZMmvOpNh/ub/7QN64i7CQKPO/iTs6/sWayk48qtqQdrCm9HJLM/7 9fynSWqK1yNr2mVUf1A2/7HtjrfyNI+rCd+vBz/lbZCp0y2SgO0daDPnGA+7J6R/Gop3bDu7e pC5WI4G4I6+iVh0zk61yc8ue8XQNjs/FfSjZQLIrMGgKsrEyl0nnmcH+Eo+hwyW4+QeIEcES7 wAExmsQFRshUHvFZVuae7kXvrUgK4xmdwANVxmbmTlWPiRS30G95LGVDi6keE3kb/Ni//myX4 9zh8P51DiIwsXp2OHlIgdcG6bqP943x1G9QIFuh7qTETTIPGKQyYiR70tafRN0Hn5rm3XNs3g mhhxvJMw7G7Yhji7JdYo3vrVrHj7G6/GNNVAkTZctkJZjc3K1TkauxNlQm3gGDe7ZqMbxrUH7 srdhB5JuB4rli4114Ev05WBQPNlulC6oWIzbliZHE4qgzKkvWBBaFMab3nLtngkJ/OPEZYXvn MMjyQF0lWHMwNH7pPTXtuC6gh679Oh6+WaTwzo/IzGtmbSJF5kHR4x+dFQECAhC4L1VveLp6S /ZBDXcsIKgRRMACZkzG68Nmocwr0FwBRz2pEWA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org parisc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. Unlike most architectures, parisc actually succeeded in defining this right for big-endian CPUs, but as everyone else got it wrong, we just use the same hack everywhere. This takes just take the same approach here that we have for the asm-generic headers and adds separate 32-bit fields for the upper halves of the timestamps, to let libc deal with the mess in user space. Signed-off-by: Arnd Bergmann --- arch/parisc/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/parisc/include/uapi/asm/msgbuf.h | 33 ++++++++++++++++----------------- arch/parisc/include/uapi/asm/sembuf.h | 16 ++++++++-------- arch/parisc/include/uapi/asm/shmbuf.h | 19 ++++++++----------- 4 files changed, 48 insertions(+), 52 deletions(-) -- 2.9.0 diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 0cdfec8857bd..ab8a54771507 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h @@ -138,10 +138,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - unsigned int __unused1; - compat_time_t sem_otime; - unsigned int __unused2; - compat_time_t sem_ctime; + unsigned int sem_otime_high; + unsigned int sem_otime; + unsigned int sem_ctime_high; + unsigned int sem_ctime; compat_ulong_t sem_nsems; compat_ulong_t __unused3; compat_ulong_t __unused4; @@ -149,12 +149,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - unsigned int __unused1; - compat_time_t msg_stime; - unsigned int __unused2; - compat_time_t msg_rtime; - unsigned int __unused3; - compat_time_t msg_ctime; + unsigned int msg_stime_high; + unsigned int msg_stime; + unsigned int msg_rtime_high; + unsigned int msg_rtime; + unsigned int msg_ctime_high; + unsigned int msg_ctime; compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; compat_ulong_t msg_qbytes; @@ -166,12 +166,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; - unsigned int __unused1; - compat_time_t shm_atime; - unsigned int __unused2; - compat_time_t shm_dtime; - unsigned int __unused3; - compat_time_t shm_ctime; + unsigned int shm_atime_high; + unsigned int shm_atime; + unsigned int shm_dtime_high; + unsigned int shm_dtime; + unsigned int shm_ctime_high; + unsigned int shm_ctime; unsigned int __unused4; compat_size_t shm_segsz; compat_pid_t shm_cpid; diff --git a/arch/parisc/include/uapi/asm/msgbuf.h b/arch/parisc/include/uapi/asm/msgbuf.h index b48b810e626b..6a2e9ab2ef8d 100644 --- a/arch/parisc/include/uapi/asm/msgbuf.h +++ b/arch/parisc/include/uapi/asm/msgbuf.h @@ -10,31 +10,30 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct msqid64_ds { struct ipc64_perm msg_perm; -#if __BITS_PER_LONG != 64 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t msg_stime; /* last msgsnd time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad3; -#endif __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; +#else + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ +#endif + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused1; + unsigned long __unused2; }; #endif /* _PARISC_MSGBUF_H */ diff --git a/arch/parisc/include/uapi/asm/sembuf.h b/arch/parisc/include/uapi/asm/sembuf.h index 746c5d86a9b1..3c31163b1241 100644 --- a/arch/parisc/include/uapi/asm/sembuf.h +++ b/arch/parisc/include/uapi/asm/sembuf.h @@ -10,21 +10,21 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ -#if __BITS_PER_LONG != 64 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t sem_otime; /* last semop time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ +#else + unsigned long sem_otime_high; + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime_high; + unsigned long sem_ctime; /* last change time */ +#endif + unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused1; unsigned long __unused2; }; diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h index cd4dbce55d0b..c89b3dd8db21 100644 --- a/arch/parisc/include/uapi/asm/shmbuf.h +++ b/arch/parisc/include/uapi/asm/shmbuf.h @@ -10,25 +10,22 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ -#if __BITS_PER_LONG != 64 - unsigned int __pad1; -#endif +#if __BITS_PER_LONG == 64 __kernel_time_t shm_atime; /* last attach time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad2; -#endif __kernel_time_t shm_dtime; /* last detach time */ -#if __BITS_PER_LONG != 64 - unsigned int __pad3; -#endif __kernel_time_t shm_ctime; /* last change time */ -#if __BITS_PER_LONG != 64 +#else + unsigned long shm_atime_high; + unsigned long shm_atime; /* last attach time */ + unsigned long shm_dtime_high; + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_ctime_high; + unsigned long shm_ctime; /* last change time */ unsigned int __pad4; #endif __kernel_size_t shm_segsz; /* size of segment (bytes) */ From patchwork Wed Apr 25 13:22:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134301 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp863750lji; Wed, 25 Apr 2018 06:24:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Tek5BGjAzVSFLW26nm2GMgaX8zpTNCCe4ZQ+uns//MrUNRe7j5jpU/VVfQ7d2AB24qSoV X-Received: by 10.99.98.69 with SMTP id w66mr23885322pgb.55.1524662684063; Wed, 25 Apr 2018 06:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662684; cv=none; d=google.com; s=arc-20160816; b=nNh1+5pXZstnQaSp841cN9+H7av6yHC2f529VVG5inR9FEO9vKX8OkJWtQ84q1E4mS B+IIw2qZadjY0LAFAHCjrommEUCalPC3TZHdBt6y3S8CCU8dHmlJKnkmP0B92DbfblD5 CMYFI07T4THROPoXfRFpNnOqm7KTWhfSY3VHxyOQAheZk1eijpBIBLe0stVooHEq07YK 2in0V/MJxFvd5uuqbtf7Q5sObj1kpX2SHuOema6gI5qxXnKyex9b00PpYVKv32cEQvGF xzU3NxhYdV7JZAV6SQpwPtpP6p12exWLdBMKM8BknbztXMP2E6nY6+1haclz1ke2UWKx 2oJA== 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=sJFHHtCRqJiTIAziYUJohTPdyBefr91onorYLH5+Y2z5Qm7E17AhqUK8n8JMbhZt9J MmwN2QAZXgKHcWZhPKdElbnzcUjXS2CskwUBS1h7uiYgQuuVcsmmHkvamtr0/8MChT8G OsHTGgIv0WrLmTK2BLZw787Mj1Oz+qShR/HICRSY7NMHIda54IabYmj5cTV6liXMlKeT X+LJVeMwUEX393yf4IEcGxs52HN9CuHWHAVjJBMuVAnQoDQFySqhx5kLAdNNzcZtGirM lfE3QULzmbNyg7MhV5K23K6WptKkZ7MHzEgF6ARoGvQxGXYzCuN76yI1cNXH0n1mWOJN 21Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f30-v6si4473231plj.600.2018.04.25.06.24.43; Wed, 25 Apr 2018 06:24:44 -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 S1754544AbeDYNYl (ORCPT + 29 others); Wed, 25 Apr 2018 09:24:41 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:52929 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753941AbeDYNXA (ORCPT ); Wed, 25 Apr 2018 09:23:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MC1E8-1f2YwU3xke-008oW7; Wed, 25 Apr 2018 15:22:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 09/16] y2038: sparc: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:35 +0200 Message-Id: <20180425132242.1500539-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:IXH4mBqrBxs1x5+hIrapXftf8q9YT+OtsSxIoC64JC0VPX/ggKT moHxVq7/8NEX3t7k4ARaAJ4cenCKCj04U9rv11HJjoBWuTvMElYdP4df1P25jz03kmGZEwZ vSE0F8rJJ34g7wIliLhFyF3FzWukNG3csevyeu2wB8Nt3B+IODdIkYNkXo7713JdGUHU0I3 56CC1z34reuLY0TzikQIQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:j2ZiHF77Fng=:drIXp+sURUP+hBnatMHUTB Sd4dByXL1PyVpN+dGeSmrNFek8b+EaGLVBlWt0GFINYsLJkfq2ipirM4bMWnsLp3OGQJRj944 o3zv137M+s0kBGaLZUREdDk3eUKD/Cw85DOzBzIgX+ZaMNiGemlIMN8LY1j0xiRwA4Zhqu6mn H3hwj3nDMns/z5I17o9OngoIAMhL/9BAXeGphGMseKT+24bX5N0JpTkQQUmpmgOadbnj0mGIn 0vDKo4q2I3eenauZ8zqt30PPDg+4t+ElRINNCSjZhD5WgIkBOKCKbw6g8LJ8Iej3wdNqYmPSN ley8ygM1gqBhvajMVaTewuGU/ySqpyMCzeDvhMWUtflFAUzQwcbTuzm1sNBa2N/TpoIX2XAiw L3Jwyav+JLphVRWXFQ/DleOjk6u2bz56YNKPcwH4V6kBhmr/E/R/BZ0qP2sI/6rGY16IwQVCk SLfyHvNUqG0x0KsSIY8cgigAI9yEqhkA4ZpRimQwG9ECB5m+N9mfX8uzP2lQgtc6pywT6B+N6 yrNf9kN8TAfC/c7/8WOVE2Uz/VnxD3ugbN0KD9lcUoaoKMgVjJGxq2i3ByH/7naHFu72h5ods pvhHpdSxzXZGemLScP2Ze+R7QUSOEMYhDQtNy0KjnxlvQB13PKYfvsr3qCksAY0tEelkQ+vbw RS2IRdUVuBHkRA/etjzT5H054+KYJ8RvBtZL69LNqcSSHUVMpgYe2nGPqL7olvNxKNzFkUgke aSjTGTQxxRwRZNKDbgHDaOAQ31k1um7KdEMVmg== 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 Wed Apr 25 13:22:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134306 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp864362lji; Wed, 25 Apr 2018 06:25:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx49i2Ca2KZQbS+p35cfOPEIQiIagZJbrEf6zR6hcSzGyNnScAMBKmsfAi60Dp56DyMPXPHyj X-Received: by 2002:a17:902:14b:: with SMTP id 69-v6mr29757183plb.184.1524662719650; Wed, 25 Apr 2018 06:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662719; cv=none; d=google.com; s=arc-20160816; b=YZBZw6eaayuwBDTH9VjaUwFEq/lQFlzhkC+bIH3ZNQnO2Is5Y9oILy7neAkurtsrsu i5uD0vfg4JKpcU7KRl0tlQIPmSIxBkcCFoxeC7o6SV2fKPDTZ5sKM7gFTOj2zGia7MDZ sk4c4uBZFm+nwPRLZtDWK7wvbE19gtaaxeSrr4yjNR2xo2Qgrcnxzgj/acbSq+ghFnXh ChXV8cdWq5LSI1g/u/R5rUFtjy8UJRgdgTvzXkUGvsQNTqzdiGsKc8FdGIur6L5mV0lO nXzHmVB0VDLhJYlhmRNMhFUg1GuYZmVPMjHfQQOwUv6I0Qy30p8oPrsjhWU63kLTw66A KtXw== 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=EgKa3fzN/uMsD7DbxfwVbXNylqxlaQpxFZptRADaRhEUh4p1P9dzbyLch85PmIaVyV xkzauxEMqDxyI4PFnwR7tA2G1fLJbyixKg9hV0Ntht/dyzP4bmPmSQAtx6AFrNBCleVm qohGY0HyKoyKpyfftW81aXocimHqvu0+Hg/6iukur23bhkrSAHtstijnzJ5BGkuoZdw9 7AVUsZiMMsvQufxLGgQDu/7ttXcfol/hxP1NUM4wakuiif7p7Ib/a+7g7IvdkzbMUgSv qKR2vXA/x8XPISBR+1vzvMxh//qk8geyYM7PlUrR7KjHhTKt/+/mhQB8RuCm5G/5KiEp cj1w== 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 207si13863967pgg.29.2018.04.25.06.25.19; Wed, 25 Apr 2018 06:25:19 -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 S1754560AbeDYNYo (ORCPT + 29 others); Wed, 25 Apr 2018 09:24:44 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50761 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105AbeDYNXA (ORCPT ); Wed, 25 Apr 2018 09:23:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M8ztN-1f69JW0gIf-00CNPu; Wed, 25 Apr 2018 15:22:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 10/16] y2038: powerpc: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:36 +0200 Message-Id: <20180425132242.1500539-11-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:CdLCGtnmTDNlN1K4dtn/CBLw9Lx3H2LL6y4d0ZJxIeo42t8qaRA lVf8Em0bBVmhWJ89pWoC4cv7ClPkOx7RXsH3BX16Xdk9zA9WBCbOz3K+q1Mk0pw97dlUMhm Tohas2pMRuGxCi2oOyG863GW/s5MNefUo2xxa6IdFl2mgVayXcZMCNLHB2DzV35WyQ/ermi seUsJW1giew4oQoi9yPyQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:a0Aq2V7hIPs=:0CLUzK3H3SKOs/VRaNgHVi Dk4MQpVpyfDGzNwdCcbUT3is7LqjsCZW8ab4DKme/naAOd8z9Y4ssxaO0Hv52+JpuaGOnsMNG Py8AzWcLMtXTnBche/rIoe0vQaKwPJNQgE4ez0ITGsDOI/PkGeuRb3pe4Iw+2GOmexQ74tJ0k b2jK4NV98pdLNQ29M/YejwL4H/mNtJcSY66uVlPg19Xf1/ek8BjUedUsUdHZ5TASOrsYdiLyx Us00Aw9vq0SQ9RwrO2I/0FUsv1hlK2MWw51x9KfarMTa15lxtLpWN9bpuOb1wYZ9V/849wNix q+DJJJ9DKcBanmAzk1YG1Rs2T71d8Prib6Uwxt3jk+LprdgdVHl+2lKQDnu+O3VMNZH3nV1bi /LD2JzgHQkw8X5Foq9WX4IrI26HYZJVXoYwiwXCk84ICgVq4V1Nb3BeApY47Ud0gAIHYh2QZF rH4HcR2GD/uQCjVhE+1ArRI/audhUDaYl3X2HG5+ouLhGwsiRYWYhdOdoV7+3YrsbvTP1L93x YHrH5NZQbywqlB4r9AD3ecxCa0Omh3emaJ5QcIaG1G+6mFBmfuNXNZf38NLiFbB8gPO5R4x0U qg452q0oesAlP6ItYrUB9eY6zKofRtdt6sGkZSQpKsJZirsFBSAy5mp7fCOOuWKNguOcYbJna Sbe0Gfr78ozrKgmTObhdr4jzi1Yc07SkGHxGuWkY53ezNLN/1H6q7xEbtGOIJ3XOMFiWCK1fK E1zwG068blL3IjkDfs794aZJB/kwhbjz8a3bxA== 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 Wed Apr 25 13:22:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134300 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp863636lji; Wed, 25 Apr 2018 06:24:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49dYZAINCBq8PkN6VEkvF8ZGsZ/Ry5svDPvCVUBTglra7jyIu4bUBsRUodAbHXUlGIS/Zat X-Received: by 2002:a17:902:40d:: with SMTP id 13-v6mr23768307ple.117.1524662678582; Wed, 25 Apr 2018 06:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662678; cv=none; d=google.com; s=arc-20160816; b=Yw2Dc5DrBk7M7oyKGCVtZnvs9a+kdWVkILDaFDP2+GEMzqP59xvPh4Ba/g66loS1/D NzkMCW67myQcPthmMYY0lVMojm5+owjV2BL9NyDTWBJ6/g0OdRvg+Pr5iqqwqLukfled vDsfsH9wqgZWwJ4muviiqKorR+4ZIkyGMrah7ct/uJT/hWuQDZ8ez87OPO2NQnNoRFsV 0UzMrh9+qt5VI1yhhGj8K8Uj05u/3MLUpqPXtDbhYbKAqhGRLKSIYadOSrnPyKqKfUtl eKWpTwn7V4ZlnGmx9N/B6385ft7ngi2Hf85GGsfqz72V+94w+VY/+jppClpFh29AaYlm j9gQ== 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=ieMx5zliTjmujhTfjI2LSb4TlY9qzLdIBt1TEl1MEfHLk5BrhXWEiIIXAw815RakHH EOl2ho+DNYn3iGkKd9UPLPgsDqMFXjV+Ke2wKwlCmDUe3vgT+KuT8UIxXYfMiterHScm fvRB4Hi/s0CJ21WztV+omhO+VQiP1RFHyCAtR8qT5ZvNOMsNgW43rGszFm/DnQM9j9fP KjKUSbG+6rHi6TKcnQbMwur6qKSHBXJZZdmDyObI7d1rFKuD6kNE20BOIJRX11kD6yvz fTm5ZQyJkYCkp6+bup2suYEkT5rJ3LgxwoN5Lu4kGXlOD5cMtnN+hrFUrsfjMpD9joIx 4ZTA== 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 k14si9426898pgt.27.2018.04.25.06.24.38; Wed, 25 Apr 2018 06:24:38 -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 S1754524AbeDYNYg (ORCPT + 29 others); Wed, 25 Apr 2018 09:24:36 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:53435 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754112AbeDYNXA (ORCPT ); Wed, 25 Apr 2018 09:23:00 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LrKaC-1eF0jH1cgm-0136Ul; Wed, 25 Apr 2018 15:22:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 11/16] y2038: xtensa: Extend sysvipc data structures Date: Wed, 25 Apr 2018 15:22:37 +0200 Message-Id: <20180425132242.1500539-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:VnC7RDmdkuVwMXDa/0Q3iXctakzxttaWlKnKAZHLtOh1npkakHR mGropsslwQUd3aRNbNpX62dY1pA8PhYRWroOflFFwcnbXANTxsf9ccWlLcCjh2yx7o7uYYB 5xrezUuzuek2HDdIa9kcA/ju+JzunDume8fuppxUlB0zYjHHMqNXzNwBO2QGlaMPOP8yikk y7hfnGYjwyt5n6kh/tsDA== X-UI-Out-Filterresults: notjunk:1; V01:K0:3iyvHuc8Wpo=:qn6ghZj72LMHyh7O2c839d p4imYCRwxxRn705vMAdesOIetG02uBq2KuwGKkvtIqkEukInCzD7YzzmLgvmhShbfiE51tmg5 N48AwaFKdLYfuuhylZ8sPFf2TH8miVToZULQzxl7hUh9rcG30vh/vacM9aBYz3DIuyKXQtJG6 7GO3JiCS5C7ReMVXkTbNkJtwzU8Sj5OYFAqj/RPwvuFgpaS6vZsiPg48bVOu2cLfQAKeB+z8u Dw0ytmQ8a4tATVlyKnF3SIEx+R4szeSPK68e7nDtg/ZKkLNgXhFA53EUGlExElFiGhcrF9hNW kUXtfJNOHuU9F28IvtSHMhU8ITLJhD5PKAip3qRImP/r5FpPuojkcI/jQyXBxW85MrZ50vO/U PuDm0V06KBKPuuEo9Jl3udB5cbp8JPyroEqjqz/M672bKWX5oi3Wcrl7WYW8g48Jf3baRP4T8 TT6JDV7cbtco60A5ZnbqKuXXqiwvbhdlERTBaDeg7nymNJtnQB4fZajHnOOD0sfNQuy7fk5KE OsdemVJYBIrRyp3aR8JWDHlTyKX4sOl5uf9hOGqdr+vBZ84j2OREm5rxF865luU3c4eabXHKS KPGr10vCETz0nTN8Y3PvZ6eTYQxqonp/EVfF+G6d08yWfyQaQ2suM0boDHu8Wwsg5ofWa8lM3 eLhcS2Kg3I0poJ1hMY2LS7BcwwLTu/vBBVwyC2teofLEazB1vW/D1m10fJpgOx3DKrpMP4OEz acszHjXQ6esp9dLqwvk0LCeXqynT2NcV9yoNOg== 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 Wed Apr 25 13:22:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134297 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp862529lji; Wed, 25 Apr 2018 06:23:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/GpZw+lw+Dtz+9b04jzYviyL00dGZ/7pWIa02OUA1tgMTAaA1cDQullY9EbMfHqAr1g84B X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr28471508plc.368.1524662618001; Wed, 25 Apr 2018 06:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662617; cv=none; d=google.com; s=arc-20160816; b=le1CvSPl90RzRUyYMnliAzVg62YLVwjlFMPH/lHw75lTs59Nw9hLSOEbYPITpLskLw 6HuRfHR7owXJWTW8pDkjvUZ/qXzOdffw7IgKND+depVFERJq2SbsZ6XavQdxoMkHSXYW KA23wiwABh+ofOfVCBKo09Odd7ZqJo4AjYBurdFPKi99x/K6y7kJt7QikMStrjmOwiS9 gKUcTlCf6pAbtIIFhrIwH37cSw8Wu0OVUIqN5xcUAalBS2K04P3fJ7iMjGBbpJ/t74Ns ui/ILrVX4+2pVcNKJakliM46K6iWvTIj5ov0gKDzbehFDdHHQoAS23+5ShAlifqNiaGC 0qig== 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=FNvNZqL1QVz9jPezmoJv0nLyoBHEtt5FGAOH7Fqlq3E=; b=Apnd3ovPRRhohhDhVEUn3UgRKCNYY6Z9Ut27+s9tiNUuQuzfDMnOIJ+UdWRtD9v2X9 LaJXFcvElqMtEqrA7Tv27T/t8DOSPzEQ2TpXG8K27T9usfojadnjZyARVhgeM1c0LG/q yB1WNow0yTdNAZZvzsyZB1fAgIZPTakoJTedviffskjMy/GODgcdrTCS9FSINV4WCDvx KxXsueBW6EVnr/o3EnBM5XEPUQ8S43LWCaOeQKo9913RnAYhvCvBqY5t4tUICpC4wtZD zW2FVA0Zm3/g6IcI5bWEiJkOOUTbQFwwUprIngFHxc705q466MDRy3OqzkrBXst2X0Oc TrLQ== 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 q1-v6si15686006plr.477.2018.04.25.06.23.37; Wed, 25 Apr 2018 06:23:37 -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 S1754448AbeDYNXg (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:36 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50055 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754124AbeDYNXB (ORCPT ); Wed, 25 Apr 2018 09:23:01 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M3jZR-1eKjlS2Vgf-00rKOs; Wed, 25 Apr 2018 15:22:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 12/16] y2038: ipc: Use ktime_get_real_seconds consistently Date: Wed, 25 Apr 2018 15:22:38 +0200 Message-Id: <20180425132242.1500539-13-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:/Bwr/CGb098G92uX49eDHx3CelA/h9Pb2XwxvK9kBIIrrZmG49+ PIkdxhfYaz1w7kdwHoVOj7gPOq+skdOpgv+CW0X85IfnuzDlGL4uO7ev/OfM4bIi3kKlRqh SH9tnGOVzL3JrfjJ1VOOjL7v5oAAgb1LKYyOyTrwheeRgBptaCbDHAtNMb+6NW74LH4j2Cl sb9jOHVRG/XmL605aWejg== X-UI-Out-Filterresults: notjunk:1; V01:K0:VXtblfxm3es=:jzDRwkeRVeBVK99Q596Anu /fKwzTIPe4E1K4IRxtEYc8m4pkNkHuYr6whWR+/hffFSHzv/mYBr6szhz5SbTa83YM0Lh0qcZ cJ6Z+6VzKBfsTfav0RH3uwksFFXysKQUGs/7M6xYZyI6703D4xNcTrHmG7XIvDvZGIVpTNtzu MBuw21YGOGhQTu+ycP7EayT2WCe4wjegMEh9bXbEZv1SrpXxK+EsLRNRdX97N1UVLM+XaTpYY 7xV9Ru+4vCB4z1TF5zyYdw6LT3RmHlUTjfQkvipF20LpHprESnDaM+ANNSWemCHsbZwvOYdxA hkeqOs809bC1t9yH46jICUTCipwNF1ucZqWw4jzviOaXWpTvIt5G53pc8DmLnhZa6UA1tv1aJ R6+cK5HTDzMfvBRyhj6v7z/U8IPEOxRnwq889GevgTueQcOiNBdBpS2xq/03UOwkduxjSxM5M nEFk9tweOFv21yZMqIoKM6pWSJ5VU0OwFjuYkTcxl+AxQWBVzmdhObcJh1ZqkMO4DqrTYoC/4 nBAP6Y+Y7RjYI3wxyEFJ/a7aWuvi3U2cwQkvGKqBCWpmVqvhAbhoV4qAupf/IMm4reuAH761K JUu/je1qXZDCOLo3VB0lQUIVDCLY6s3ddCkStxn+Z/ddXcqwKKewjPIiZA10yNmNy4Sw6ngNm SKAzL3jaasMiQNRBjaVNRym2bWGx16zE1TfHgflw+gftk4MT/qgJd2ghUMsQRazyYuZPQd5Hv Xi9lO/A8f/QZFyHAexVVC+93UoI/iSxpiEpW3A== 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 56fd1c73eedc..574f76c9a2ff 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -758,7 +758,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); @@ -859,7 +859,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 */ @@ -1087,7 +1087,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 06be75d9217a..c6a8a971769d 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 Wed Apr 25 13:22:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134296 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp862479lji; Wed, 25 Apr 2018 06:23:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx48TziLLmcbbdYAfQ5vN9cGHDBUukt5KNf7r2kmxlOKc3wo63VOrioVGiVT+e493HEz3qHH3 X-Received: by 2002:a17:902:7007:: with SMTP id y7-v6mr29207661plk.227.1524662615486; Wed, 25 Apr 2018 06:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662615; cv=none; d=google.com; s=arc-20160816; b=d8lyLc+lqhKNnlkRCPDWNDHGcnYkJlYRtRkoBWymQSTbzUKI6z+bHYxitcWZj2406K hjqMyXqZ83ybosbyqHEs4xPZzr7tm6STFYANwikCycx3TtnIPehwqHd+p1i8+hoDq/SW 0KfoHBra62QDIHQjrMMfPFJ68cJPEkNXmtD50Cd8femU6cOydOMcaO0JA8v71pjTQqar rXh9hGGX01d6gWb3Kh0D7DB2ZFvPBMHiHXTamyAwovFfIAgBhj8lip45ja6BZvSFQ2NM iL1EAdF8erBf3LbEJKzwS6s6OY7tro5O1sI4IiyBU69jJV1C3bMJoDcr56dW3eV8qKOK X22A== 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=UBzRDlwPHIQ409lkdhtVRYuqTq2/VtvTzjteyodxr5Q=; b=bv3Fh3pDKON2JR+69Qd64n2djGaZMxseb5su+d8ku/GGq/TCF53YWkhdGn3/c8CdJT gvoTy3/7Nb3efunkwnfDdRRYDmqqLSMpd9679hzijcFBeB3S/YilsdqAyDaQG5OtkSm+ R4tIM4lET0FuSSThVBu8D6KoIEdLr1FbJx7AkZtZnjNKP+JXyssOhh+dBgK1D3nUkteD 3/rksfR3hl9QUKdfbkgG6DP3QaMF6Ayqgc+nXoCZXIV1v8ZhDDN3ckirukCvAoQglq2X /GUsh1OixL/6YTkr/4+pIdpqG3FUthWTbKrdGixkDcVZ02I0BpxUu0CIwLArNDUaHDQK fdZA== 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 q1-v6si15686006plr.477.2018.04.25.06.23.35; Wed, 25 Apr 2018 06: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 S1754433AbeDYNXc (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:32 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:39563 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754139AbeDYNXB (ORCPT ); Wed, 25 Apr 2018 09:23:01 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MOzFH-1fHfu83N3P-006Nx2; Wed, 25 Apr 2018 15:22:59 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 13/16] y2038: ipc: Report long times to user space Date: Wed, 25 Apr 2018 15:22:39 +0200 Message-Id: <20180425132242.1500539-14-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:KwPfWWk6me73Ns1gVd+5Fh8sh2XQWraJhawlJMkBsT65GtVtsnb psDjHJNN5/MsDFd/bplFtFjyTe6LVKRieeCh7jJeG9eX0mU9+U+5rnb1m8M4zvFBXV037PZ 9RGwqhubpY4fDA7KoBPkbCEfzGVLLD0GGJc9hjduws9IhsqppIRfn0pTt1F2plrYARc+AWl 7ko+KQX3tOYMWNGpPpFZg== X-UI-Out-Filterresults: notjunk:1; V01:K0:EAzZ5C9f6lg=:LIDJEdsMAsx2NZK+KvTI7n 23Om6euY/zo4nJrJLum+biBuLFZrDfgc4DE5Y5iJUTEjN7ibCsGvrRr+OXzNqAH3Ps8+yLTXI dkVu840dbBAGGdOJZonca5OGpxtUuEiMdxcXhsqj6guy2bWyWXZj4LgfZGMQQlQbGCGoBVksd 3rDqOKvO0dtiV0uZis3CasVtZ6D4IQQMNLTuJ4co7Nc2pdnWSX07kZBj86UiNffgqZOsx6tuE d+jZ1j1xPtdUuaCauMLyfO/eNfraeytcaU4Z1yKGSGDQ0Ian3umwyTuWse8r6RQXeU7k3CkWl MzkQJULA9m+ovil4i5PPCcCOjf1Lx3N91s7nG9kZ71SK81volbbiZ0NjrGVdWIRpsERlTrI9k DNu3c63wLWl+a7+sTNotGhULQrRO5x6ZSetc/7INL/H9n+cvb/FOfUHgmLPSaqiBPlPsr9wjB rdnsyp7vJBhtF4SnwRLo8VPtU46/hCvuQZf49tvpGZLc+g576PSSs+/WLSezKM7jjzdgvSeZm vZ1G0+8dlFrsozug2ls4BmnhdIa7jA+jJMyAzVXDhYmII6zSnQS002zh9C1uIPn5mqfmYarau Ys7de1PGKVOAbkHlCgNPigrC3qcoUk3GfuwoUWFbEKpeHwsfdIejpCIHrJth3hSHwiEsLCDbu 3ynyxJ258XvR0PVzcdSlmrnHErcPofjs3P5D8jpknrz2MepY6cKmk2PziIf8BpxYX9yMtPmkz yF+qfE5LCuG1nwWb1q1w5KfsANFUxeAL4FG/7A== 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 574f76c9a2ff..3b6545302598 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -537,6 +537,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; @@ -646,9 +651,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 c6a8a971769d..8935cd8cf166 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; @@ -1257,8 +1258,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); @@ -1704,8 +1710,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 3cf48988d68c..0075990338f4 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1002,6 +1002,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; @@ -1233,9 +1238,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; From patchwork Wed Apr 25 13:22:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134295 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp862374lji; Wed, 25 Apr 2018 06:23:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/rYU0wqFL4pFoKeSb/nTNpnQECd+0KecbmUi7+fXu6BsLjtWTbHLsR4OjqsmE21GckZf4S X-Received: by 10.99.125.74 with SMTP id m10mr23626985pgn.80.1524662610678; Wed, 25 Apr 2018 06:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662610; cv=none; d=google.com; s=arc-20160816; b=T3e95rSGfdZrl2tQZGeU6mVD7dYZITnADGWSqrJnPeilEHmaZU4ovFOAaDJvamLStw nDtzyrR1WvolyEMKIgA0vYPj3PHbgQtVUvxxIwtUFWeF7lnx+KX9iMG/+IwQBAf66cDR wA+7tx5rNrgoy/JRHC12ryw3QCNdy5ti/gnmfPRo4fZ6CTPKuW3ViwTzucykQf++v+3v uIralm2rhLJgS5WbBA7+XeZ9wvQz2ZDAE/uu0MVDFlm/Y2O3eCr/YOIHsbQAWk8LrTwP 8GzD34zpMeQwY5mNVvvqCAinGkkUPsS8kDBSfGGxBTmGBk758Q3VUKvIuxEw9CmIk5SF nj0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=O5FDEUvv+T9xGV1OaSiciU6iSJkdzsowujXxm6xlkpI=; b=eYZ9vAylpv+Tq6Wc2ZN9YpDHlOwb8dlajMRE975xNSdCAIK78V/EP0TYat7AmWvEE/ wLpBQwxiQbZwTembSuB19j/+awwizoKQoq4B6b+yK7/E3wIlKfG5t3yCTnAK3SSpG4bx KHi2GDX8+7CHFbHE6sbDX2OJwJg/OI71aQamCEZX3r4nwDn9qj2ELeYNbD9iQZ9Naaf8 hj0EQ05GPB2urvfbpNXBe6o56x4AOqjorg7qVUCAtfrvCyIL4Inzzh8Pyouekl23DCZT YWNzdMhEnCrOWQ7wpu+Y2Lf6iDoij++Gu1Mx3nM1ZF0NN+4wpRVgQCt4oNOLBT+Us7ZX EuNQ== 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 x64si12882552pff.196.2018.04.25.06.23.30; Wed, 25 Apr 2018 06:23:30 -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 S1754412AbeDYNX1 (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:27 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:42569 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbeDYNXB (ORCPT ); Wed, 25 Apr 2018 09:23:01 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MQfGf-1eocSf01tN-00U2nC; Wed, 25 Apr 2018 15:23:00 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 14/16] y2038: ipc: Use __kernel_timespec Date: Wed, 25 Apr 2018 15:22:40 +0200 Message-Id: <20180425132242.1500539-15-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:enaJExFVg/MzNLYA7AWtk9RjzL4WzvqzKq4cEtAIu0Ccsj7xotK HeyevMNJvfcrk9J+agR9b7vpXHOPXL6I8YYKaP2pqfv4YXRuSqy702FT3TZf7l7AyVC/FaH 6qDMBIqNsgE8NWznOu0Vp61vKnOdLbdK9bj+cuUSAfuRwiTsbK1FzTWc0FjVtAGn4Uyw7ni OK1KW/N7YoxO5YrrDhANQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:9Ueq7wwQ2Dk=:3fDU2DKLngTJ65jRR39wrO KGrs/8l5PE/C+SF8802VToWyIAWfDdfbJ1468mlXU3/ZacNtq4k5yP7fuSe1v8gTbKfZh7kfa zpAhhvgqkAHw9iJ1O2IyKQPArAJ026jI8vGoW4UlXdvmo4ZoxEiDHjpjp/mrJIBhogB/WgNZP Qwo1O9pDbTqrd2CJ+DvojD6P2HE1q19aUOT1HhZ9vM/V8sKw7NFgWZYZbjzirQLxu2kZbSf/K 0OBwNLloJ0cLGVtNwHl44n3vjMewfCKqEHzTBZs/kLIe07UPLrh+n4S/VQwLMNONaPPYHDqJN OsY9uJi9iFoSRc62DHmZ1aibP/IPEiJPKBDhBscmz4LidqGvzixcB9z8MIQT+yUoPTlbFUJJB weebpG8EIdYGM7aq0zm3aqFOmHgR1Y81W77RnvTz7mgZq6YLlKlRUtzi079LGpuwZhSyBCKua zOFNiOfyLr/p/wv4dSYWre2Ov4hAp2dL3ZlqSm1KMWxEf7cuFjLDZocKThte9O+lh2XXNsY6n RwftC44bCV6wSoaDtZqGIRAuTPn4exTfLYxqASW0xBq9tPLz2o/hR8JAEsophJDVneIeT8V5k /wlPiqKUueLBaLmTP71+flT6FfYw/CHxpY2+LUi858gvu4sk1YXQcZSAHB8WBIPWecM529txb sjgVXs4FnoihXhRhpgRkNgn1UKjNIQkdZ9QMvnuAgF6KH7zPrayml++I2LlQYS1N0Tp4AUN4m OEhvdcfrTl36+EVJxtP0E/qRPd28KoQ1je+Lsg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a preparatation for changing over __kernel_timespec to 64-bit times, which involves assigning new system call numbers for mq_timedsend(), mq_timedreceive() and semtimedop() for compatibility with future y2038 proof user space. The existing ABIs will remain available through compat code. Signed-off-by: Arnd Bergmann --- include/linux/syscalls.h | 6 +++--- ipc/mqueue.c | 6 +++--- ipc/sem.c | 4 ++-- ipc/util.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index c9a2a2601852..b92cb79d38c3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -680,8 +680,8 @@ asmlinkage long sys_sysinfo(struct sysinfo __user *info); /* ipc/mqueue.c */ asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr); asmlinkage long sys_mq_unlink(const char __user *name); -asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); -asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); +asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec __user *abs_timeout); +asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct __kernel_timespec __user *abs_timeout); asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); @@ -698,7 +698,7 @@ asmlinkage long sys_semget(key_t key, int nsems, int semflg); asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg); asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops, unsigned nsops, - const struct timespec __user *timeout); + const struct __kernel_timespec __user *timeout); asmlinkage long sys_semop(int semid, struct sembuf __user *sops, unsigned nsops); diff --git a/ipc/mqueue.c b/ipc/mqueue.c index a808f29d4c5a..9610afcfa2e5 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -691,7 +691,7 @@ static void __do_notify(struct mqueue_inode_info *info) wake_up(&info->wait_q); } -static int prepare_timeout(const struct timespec __user *u_abs_timeout, +static int prepare_timeout(const struct __kernel_timespec __user *u_abs_timeout, struct timespec64 *ts) { if (get_timespec64(ts, u_abs_timeout)) @@ -1128,7 +1128,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, size_t, msg_len, unsigned int, msg_prio, - const struct timespec __user *, u_abs_timeout) + const struct __kernel_timespec __user *, u_abs_timeout) { struct timespec64 ts, *p = NULL; if (u_abs_timeout) { @@ -1142,7 +1142,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, size_t, msg_len, unsigned int __user *, u_msg_prio, - const struct timespec __user *, u_abs_timeout) + const struct __kernel_timespec __user *, u_abs_timeout) { struct timespec64 ts, *p = NULL; if (u_abs_timeout) { diff --git a/ipc/sem.c b/ipc/sem.c index 8935cd8cf166..b951e25ba2db 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -2176,7 +2176,7 @@ static long do_semtimedop(int semid, struct sembuf __user *tsops, } long ksys_semtimedop(int semid, struct sembuf __user *tsops, - unsigned int nsops, const struct timespec __user *timeout) + unsigned int nsops, const struct __kernel_timespec __user *timeout) { if (timeout) { struct timespec64 ts; @@ -2188,7 +2188,7 @@ long ksys_semtimedop(int semid, struct sembuf __user *tsops, } SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, - unsigned int, nsops, const struct timespec __user *, timeout) + unsigned int, nsops, const struct __kernel_timespec __user *, timeout) { return ksys_semtimedop(semid, tsops, nsops, timeout); } diff --git a/ipc/util.h b/ipc/util.h index acc5159e96d0..975c6de2df9d 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -251,7 +251,7 @@ static inline int compat_ipc_parse_version(int *cmd) /* for __ARCH_WANT_SYS_IPC */ long ksys_semtimedop(int semid, struct sembuf __user *tsops, unsigned int nsops, - const struct timespec __user *timeout); + const struct __kernel_timespec __user *timeout); long ksys_semget(key_t key, int nsems, int semflg); long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg); long ksys_msgget(key_t key, int msgflg); From patchwork Wed Apr 25 13:22:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134294 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp862244lji; Wed, 25 Apr 2018 06:23:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/vxIfwUq/Di8/5+E+JwZfr6MWWnCke7qDl1mqfVQ4V7mpLITxUxlTsTqly3vAx/UkXXPmp X-Received: by 10.98.86.16 with SMTP id k16mr16081436pfb.19.1524662603997; Wed, 25 Apr 2018 06:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662603; cv=none; d=google.com; s=arc-20160816; b=OT3IfmdooGJ+jSKn5aexIp3oBLDGP1vlIPa7ecTzWdS1d7fqLSkLhQnlKXQlAiiFHP PsLf7GAOZ7sqjovzqg7+05V4kSkeBVFln8wz+RwyRA39Sw/VwzZp0jWSEgMXM/2WKIwE ziGtGBoUANcGjfm9RXjdlsKZCjNohFZPwa/lvl5WTwGSParq70YV+tNDNVYj2v7CQfQO VGCZsVQZlquc4CXQuMVPcQcO+obBVRjNbi+i1QtL0XXP/2g6IVzLswR9+KjCczL3K3FU huJDb6nheRWYzh5i+cb0YeZSKbEz9VeanBTOUde74PZdKSAyUBXb4V5g4xJB56QdQExs FYLQ== 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=CLZOfbiWuiHqC0BeAcR402aTnRNG5tOEtrsqLfrGOcE=; b=UX9MrLNcPwpm4jWH9zKdflkJqH1VMWkH/b4wWuzJrlaOFTEALLeqG18527v74jwnfd 03a2I4m/OZlfqMTx4iMZkiy062z2kJ23eUeUNqNGEB+u8ZrQ8iqtDs44Qok7l0iqKUe0 ueuwIFfTFlzGhnyPyMo2pcMqVzKHgkxp2M0UE6D2w0TKfbcgQCBjGH00HZzd32XUlJjx OPXNAh5GeWJ7DgDsWuLvFc58xHopk4Rv/ecfTFWbJMv+b8fnKm8UeyQfAkeuXipmoCuS EyzwwahZw+M7WUpmQbqlfeeBvDPqzHmOVzhEv0yc7FbdpCkT31yri37U0JHg+NFgCp+Q o/fw== 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 x64si12882552pff.196.2018.04.25.06.23.23; Wed, 25 Apr 2018 06:23:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754349AbeDYNXV (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:21 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:42487 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753885AbeDYNXB (ORCPT ); Wed, 25 Apr 2018 09:23:01 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M8hNb-1ePhqB0tOd-00wIDU; Wed, 25 Apr 2018 15:23:00 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 15/16] y2038: ipc: Enable COMPAT_32BIT_TIME Date: Wed, 25 Apr 2018 15:22:41 +0200 Message-Id: <20180425132242.1500539-16-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:+3kf9/B378gkx7URUEwAHGXUPS2r3wBwqt5jzmV1+VpV8zOFED5 7AXAL1PL9ZSTHH4ik5jTrl1yjLWBa/WofrowkPyJZMdjYG10+5zBdazBjU1Cho+2/Mbg7Ww mv2v+OVCsb/WWH56mIivALkCb5KQ3Ay7rnNuru/2j1IZ6R66iJ6dwfHfA4U0GMOEh9ae0nz QK+udas/unISRfOGl29Ng== X-UI-Out-Filterresults: notjunk:1; V01:K0:lS8IKBb8TVQ=:v55OrTgV79AukyB1FrRjQL VtpZrgv6HAzbZPH8EDnzPPQYFc+AgxlyWrn+js1f8fwZ+uKEUBbuDn60fdEC3UvGgGtqtYfWK WJt6tkD3JINZrwu2mtDA0dOo33vhQZXDTDaEyVUv/+48ux+owEWoH6Y71UPohT5bJ55mOee8c oq5I1/odji6zXTpeGGk+TZ8kx6OIFCWuYXbiDIDYjyAymt0Fp2mDYq3VC9mnA8zAGnEvY6N1e pJPbLYrNZ/ZTODAo2m58XFYbYgetXAq+u0+xr72udMIMJrsFBvz8RRmyg1g3PTEOL6bCj4LzC UgQ15K0gEEZIl2MhcIZqwJbEVfInu1yN3I62yeVTM6BJLcNj9PrcRxHQFKnR/IsCKuAnsAGVv nNmCP/mstt5vfrn2/C47cOgyn5UzkQ/WzPR/xYcGBqA4dF0zzwXDacNfDXbIo01+MCJ9Z3Sy8 NfoDtB5brj7iGM/HEb/g1e4z5otasCSw1ntvHOJjkOTF+O20iaQ/fTls8INqxVzlfShT0WIVM mIBVhAvEsEg1W3iSMuG4KWx3NtcNaiwH8N9FMorjurp9qHaHbhQle9b9PREqZVPxETy2zzfg9 NJ+GBs8LLnaLHsueZu8Nr74JogMzm9STbde0Ozc+L/GhGPtKRv2uHhoiAhiAaLu7JTwyStOds vFnN1eZ3jWhX6wihlmzrZuCg5CEw5h8fvY0iks43rwgV8NgZ7ycgKzQCuYg97/K3Kjn0XcZIW qawTSm6wYpHc2lv4173QIvwvpdfLs4c5d6ycUg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Three ipc syscalls (mq_timedsend, mq_timedreceive and and semtimedop) take a timespec argument. After we move 32-bit architectures over to useing 64-bit time_t based syscalls, we need seperate entry points for the old 32-bit based interfaces. This changes the #ifdef guards for the existing 32-bit compat syscalls to check for CONFIG_COMPAT_32BIT_TIME instead, which will then be enabled on all existing 32-bit architectures. Signed-off-by: Arnd Bergmann --- ipc/mqueue.c | 80 +++++++++++++++++++++++++++++++----------------------------- ipc/sem.c | 3 ++- ipc/util.h | 2 +- 3 files changed, 44 insertions(+), 41 deletions(-) -- 2.9.0 diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 9610afcfa2e5..c0d58f390c3b 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -1420,6 +1420,47 @@ COMPAT_SYSCALL_DEFINE4(mq_open, const char __user *, u_name, return do_mq_open(u_name, oflag, mode, p); } +COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, + const struct compat_sigevent __user *, u_notification) +{ + struct sigevent n, *p = NULL; + if (u_notification) { + if (get_compat_sigevent(&n, u_notification)) + return -EFAULT; + if (n.sigev_notify == SIGEV_THREAD) + n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); + p = &n; + } + return do_mq_notify(mqdes, p); +} + +COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, + const struct compat_mq_attr __user *, u_mqstat, + struct compat_mq_attr __user *, u_omqstat) +{ + int ret; + struct mq_attr mqstat, omqstat; + struct mq_attr *new = NULL, *old = NULL; + + if (u_mqstat) { + new = &mqstat; + if (get_compat_mq_attr(new, u_mqstat)) + return -EFAULT; + } + if (u_omqstat) + old = &omqstat; + + ret = do_mq_getsetattr(mqdes, new, old); + if (ret || !old) + return ret; + + if (put_compat_mq_attr(old, u_omqstat)) + return -EFAULT; + return 0; +} +#endif + +#ifdef CONFIG_COMPAT_32BIT_TIME static int compat_prepare_timeout(const struct compat_timespec __user *p, struct timespec64 *ts) { @@ -1459,45 +1500,6 @@ COMPAT_SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, } return do_mq_timedreceive(mqdes, u_msg_ptr, msg_len, u_msg_prio, p); } - -COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, - const struct compat_sigevent __user *, u_notification) -{ - struct sigevent n, *p = NULL; - if (u_notification) { - if (get_compat_sigevent(&n, u_notification)) - return -EFAULT; - if (n.sigev_notify == SIGEV_THREAD) - n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); - p = &n; - } - return do_mq_notify(mqdes, p); -} - -COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, - const struct compat_mq_attr __user *, u_mqstat, - struct compat_mq_attr __user *, u_omqstat) -{ - int ret; - struct mq_attr mqstat, omqstat; - struct mq_attr *new = NULL, *old = NULL; - - if (u_mqstat) { - new = &mqstat; - if (get_compat_mq_attr(new, u_mqstat)) - return -EFAULT; - } - if (u_omqstat) - old = &omqstat; - - ret = do_mq_getsetattr(mqdes, new, old); - if (ret || !old) - return ret; - - if (put_compat_mq_attr(old, u_omqstat)) - return -EFAULT; - return 0; -} #endif static const struct inode_operations mqueue_dir_inode_operations = { diff --git a/ipc/sem.c b/ipc/sem.c index b951e25ba2db..cfd94d48a9aa 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -70,6 +70,7 @@ * The worst-case behavior is nevertheless O(N^2) for N wakeups. */ +#include #include #include #include @@ -2193,7 +2194,7 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, return ksys_semtimedop(semid, tsops, nsops, timeout); } -#ifdef CONFIG_COMPAT +#ifdef CONFIG_COMPAT_32BIT_TIME long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, unsigned int nsops, const struct compat_timespec __user *timeout) diff --git a/ipc/util.h b/ipc/util.h index 975c6de2df9d..0aba3230d007 100644 --- a/ipc/util.h +++ b/ipc/util.h @@ -265,10 +265,10 @@ long ksys_shmdt(char __user *shmaddr); long ksys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); /* for CONFIG_ARCH_WANT_OLD_COMPAT_IPC */ -#ifdef CONFIG_COMPAT long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, unsigned int nsops, const struct compat_timespec __user *timeout); +#ifdef CONFIG_COMPAT long compat_ksys_semctl(int semid, int semnum, int cmd, int arg); long compat_ksys_msgctl(int msqid, int cmd, void __user *uptr); long compat_ksys_msgrcv(int msqid, compat_uptr_t msgp, compat_ssize_t msgsz, From patchwork Wed Apr 25 13:22:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134299 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp863326lji; Wed, 25 Apr 2018 06:24:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoV47uOFaHrk9ZGZiztzCg2Gg4SCbH4avlaT7d0ilcdu03TTfe5owmSIugxmZZFcr6tGlGZ X-Received: by 10.99.66.69 with SMTP id p66mr3672170pga.345.1524662663272; Wed, 25 Apr 2018 06:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524662663; cv=none; d=google.com; s=arc-20160816; b=UxMK9SYS7LrnF1BLoJ5wl4rjPKB1+jAbIh4oa5tTOSf+IjurrwhCAykuUGGGJyGJZn nUDxktNa8i2T3fEfhdOZmArL7gJfQ5q1YAbkwDMf79tqIDUk5kIkObvzEpYeb4gbXqgu djlfMrrqnnyDhopTafgcwCgN3FTcGgNAR0l0YS+mkSNPi7D1xYGzHRzRQ0xIzZJWv3+C meJ90kWjF1cFw2YJql4EHkCr6ISK51siGXlvZ2Qts/BIz48AP1+fwRmQVpxYZsQz7QEN dmshyN5io+2IdMDwepYwzjTChBWm9n/UIg9TwELZJQU8ijiBT8+ANvTRoD9eN/Wnr8K0 cV8g== 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=39/1bDfRnc2X5xw7srZoxuOsBDHzOzoOVHiQ+A0iwOk=; b=AAhZ1qWYFHU8NNvfECL4A3f8WWX1D8RUYgsj9LbI6otxr1BFwVpfHwNcdO1ppd2VcE +QxYZ1tGXrVcheoBn6K5EDyk7p8IIJ2dCHq1cgxzs3uLeXEIhjQK1L153EGCtP5bxpwp c80Bb/Bai2PpvBN+zhCcFF0aSX9+T5rdU2BWJ3hvKvphbRQ3SN10R8m71MnMy1oIwtZk 9Hlprd+ijfqPPkRNb74xlaXTbGDkH/BLkfWTS1bRwvkpn5C4CvO0J83rpHKNeGabE5ms Ss/dAN9JWuRIc4U0SQDtW66MGKFlijyw8AfveMAqhLRIQVVaUAXc3p/m1L3A04O3Gq2C rMaA== 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 k14si9426898pgt.27.2018.04.25.06.24.22; Wed, 25 Apr 2018 06:24:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754283AbeDYNXQ (ORCPT + 29 others); Wed, 25 Apr 2018 09:23:16 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:50043 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754164AbeDYNXC (ORCPT ); Wed, 25 Apr 2018 09:23:02 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LvAri-1eCFZW1pbe-010Mft; Wed, 25 Apr 2018 15:23:00 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v4 16/16] y2038: ipc: Redirect ipc(SEMTIMEDOP, ...) to compat_ksys_semtimedop Date: Wed, 25 Apr 2018 15:22:42 +0200 Message-Id: <20180425132242.1500539-17-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-Provags-ID: V03:K1:LDLhkduSZObZwgT5eCRs8HvrmF3o3noQ6N/6vUJD9EddNFII23S 5xi0UupBvUU/V0rVfzGb0Q2v3PGVMtosUM7YCi394isIDlXDwz9vD29o+d/IE86L9x9X8GD bwIcUKBAwQ4CTViH2VVbIZWogroYP+3V5AE4ai7i2WZPW/gVlSEJTvKnc6HHZnAn0km7GWu lk7uVEAD4Bq4cn0YSM7rg== X-UI-Out-Filterresults: notjunk:1; V01:K0:TUA867JTD8A=:dHfik+fFiWdwYR4IDD/73y Byxo6j4Q7XHo6rDc2eBHQSh+UgTLLeSgmPeyTXpCJ9xNL5rnDtUYm3dV4gC2AQcEa+mEEhznj DDTHwsl7kLxqewTq57pSMQHOGL8xy1TdQXFuyGqZ7956yRnClBqthThJIJxYq0oNlngIkDp7h jgRdsrvi4C7ARkD0chFh9wyj35Kn/BBa/xNdyCUbXDUvLX/XekJVB1FKElzZ2hhBm4EtkaA44 VsvOiDmf4bQe9Jq6t6inJ8ZIDq831QIUATarf4Jjj/3PQUoxyWK+4mkHzld5nZeGS8WITWHgT rnrysDDZWsVvwYn8JHn1cOd6GITraAl+q3dqHpYz6K2Ih9EA0fZMmg7cMeTGgqVLZquVq7oF4 TzKW9ibf+ZEpWPMuuGkbzCaJMT/zJ5Oj1VUUgkOr9RJVW/EeSW+6InuJCDNtWRpLvk1Q6n1TZ b+upBdeVmeJlC4kYlKyGmRjLqTgeSOpDRUXedqYV2oqJCP86yVjMSznOjIUG556L9NiNcYtoK C+pFioy/6uags2rfQ8ceKIzHr/t6kskGXfFEDmQkDnYpjiI+5df23SatvuOmbw8+KniMn75Hs UEfGlcU8iGy8OAAnw1upfCC8Z+dIsvXaTpvuBtOxafm6eat/Q7tqfRvVUQ9mYOhHQPSX8wBkr m7FsuIewv3O3VIt1csgJ85sbHvrNNLxzR5AvF/i32n7w/TRIAqGdwrD8qXNM+FS286j8Hodmn mqWj2Cb/XXfMowl2zSsVoVZv7NOzk5vZpsH/qw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 32-bit architectures implementing 64BIT_TIME and COMPAT_32BIT_TIME need to have the traditional semtimedop() behavior with 32-bit timestamps for sys_ipc() by calling compat_ksys_semtimedop(), while those that are not yet converted need to keep using ksys_semtimedop() like 64-bit architectures do. Note that I chose to not implement a new SEMTIMEDOP64 function that corresponds to the new sys_semtimedop() with 64-bit timeouts. The reason here is that sys_ipc() should no longer be used for new system calls, and libc should just call the semtimedop syscall directly. One open question remain to whether we want to completely avoid the sys_ipc() system call for architectures that do not yet have all the individual calls as they get converted to 64-bit time_t. Doing that would require adding several extra system calls on m68k, mips, powerpc, s390, sh, sparc, and x86-32. Signed-off-by: Arnd Bergmann --- ipc/syscall.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/ipc/syscall.c b/ipc/syscall.c index 77a883ef2eca..65d405f1ba0c 100644 --- a/ipc/syscall.c +++ b/ipc/syscall.c @@ -30,9 +30,14 @@ SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second, return ksys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL); case SEMTIMEDOP: - return ksys_semtimedop(first, (struct sembuf __user *)ptr, - second, - (const struct timespec __user *)fifth); + if (IS_ENABLED(CONFIG_64BIT) || !IS_ENABLED(CONFIG_64BIT_TIME)) + return ksys_semtimedop(first, ptr, second, + (const struct __kernel_timespec __user *)fifth); + else if (IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) + return compat_ksys_semtimedop(first, ptr, second, + (const struct compat_timespec __user *)fifth); + else + return -ENOSYS; case SEMGET: return ksys_semget(first, second, third); @@ -130,6 +135,8 @@ COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second, /* struct sembuf is the same on 32 and 64bit :)) */ return ksys_semtimedop(first, compat_ptr(ptr), second, NULL); case SEMTIMEDOP: + if (!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) + return -ENOSYS; return compat_ksys_semtimedop(first, compat_ptr(ptr), second, compat_ptr(fifth)); case SEMGET: