From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-3309672-1524148734-2-17557520004617299748 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.25, MAILING_LIST_MULTI -1, ME_NOAUTH 0.01, RCVD_IN_DNSWL_HI -5, LANGUAGES unknown, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='US', FromHeader='de', MailFrom='org' X-Spam-charsets: X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: linux-api-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=fm2; t= 1524148734; b=H0kgb7+F8iWnfZ1PtqFXsjYe4o/oC0QV+u7U1cDxjT8DToXquC +RQJP8gdrXur6tE0gBDSPl6WHiIOrq7tvAhh0wcxWSuTWeEvsUwuUQOXtp8LDRKD jxyj2DkwYBMGQflcemL21oA8GdIodGznTqFHBhafNJZsjAKLOYfZTgOcxuaJLPoK HROm9irzCWf5W5FdZu46e1xvaFI8jz9bxW4RphP5wQnASnL2ZsuOw3B1Mh9SA3S+ DlB9HXTK+vGLcGT5gh3UKuNrP8uDkut1LwMYoPiwjobTWHc1mftLT8RAxe6XDwIU SWQ3dPw2+hy3rYzP4a/Upm6s0IDlONdoc91A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:sender:list-id; s=fm2; t=1524148734; bh= jhL3aVt+c/UKYTcjmYGEpdfxR/fhS9fWi01sNMXuEU0=; b=tgKhj/oqciSSZCUK 78LZN6YjPMLGLOtKwceheqkz2hu/Fh6VSnrKurTY71MOvpPkh1odLXcuNprqG23v 0WEvXQrqbzTeGhMG2eexwZSOrtDXafb+aLg2vN7LlmYE4LJqhb4miLz9LevRitQB UtO4lNMtkKAhHrWl8w+0jZPNPxZIRmJo2U6QMwnpnpP5EwN+3fFHg4Yh9MmiFQUY l8I4Ct+4aPSEx1EkwuBolTAD0kWQeAFvacXJGYNbqMw+L1iORcqrcn0xVO31Wz6d FtIjlSaEL+TyKNOjJ6j3VdGYUM54GQ7dT4VAHLXsfcabMaXthV8MfdM/p4LDOwjd uQ9Agg== ARC-Authentication-Results: i=1; mx1.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=arndb.de; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-cm=none score=0; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=arndb.de header.result=pass header_is_org_domain=yes; x-vs=clean score=0 state=0 Authentication-Results: mx1.messagingengine.com; arc=none (no signatures found); dkim=none (no signatures found); dmarc=none (p=none,has-list-id=yes,d=none) header.from=arndb.de; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-api-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-cm=none score=0; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=arndb.de header.result=pass header_is_org_domain=yes; x-vs=clean score=0 state=0 X-ME-VSCategory: clean X-CM-Envelope: MS4wfMSP1FJn964XEyxsk29u4JPJ4zDwQv8IASzljS+8aNFoJzVw+zDxYYKy+aOyKQQy8qfFVkeP+jsLYUZ4h3+vuMCNttUG5A/7V56R2/m4WfEt6lw5cVCU BCB7hCrwRMeRBuqPHjhqio10Qi114DPQOAkpZVkQsMwWIWkbCUjFzUV2AYh121R+sLPGpuY+UPKSMTjq/PiJTlwkxAIrXKZflw6UhuAH6tCYdpeHf99sHvqr X-CM-Analysis: v=2.3 cv=WaUilXpX c=1 sm=1 tr=0 a=UK1r566ZdBxH71SXbqIOeA==:117 a=UK1r566ZdBxH71SXbqIOeA==:17 a=Kd1tUaAdevIA:10 a=VwQbUJbxAAAA:8 a=gPkY2qt6JDp1UgQM5MoA:9 a=x8gzFH9gYPwA:10 a=AjGcO6oz07-iQ99wixmX:22 X-ME-CMScore: 0 X-ME-CMCategory: none Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbeDSOiv (ORCPT ); Thu, 19 Apr 2018 10:38:51 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57809 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753041AbeDSOis (ORCPT ); Thu, 19 Apr 2018 10:38:48 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 11/17] y2038: xtensa: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:31 +0200 Message-Id: <20180419143737.606138-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-Provags-ID: V03:K1:RczaO3VV23TE3Izuu2/VkNiF2tyQuFwKmqpdc/YL8CBp5WcSs8f S7w4zRSC7dL3lOomrg8jY5w0v3IxpvqSS7Lbfqff8ue6sJ/ZQatDJuSF2MRU1tYwXvOdNJS aHON6cCFUfZD+yjgNUM7nvDusVz7cDIPr1KhPsst8TU6KCPWrxo2GlNgYH8c27mmdwF1AVj 3eubHpola/+KJpp6otljg== X-UI-Out-Filterresults: notjunk:1;V01:K0:sGqednWy7yc=:hPjUxreVN+jMxHrmqkVeme CBkfadJTJCYmgZqAhzXYUDp39EG8pIX2OFLJx3XjruGECnE4tkmSJVhAeqwM2VNIioh75Po5s qeYKHwwAeSlJwzVvzghXAkUnMVvBLu/3lSYCClj031U3/Heja6iU54ufXNcH6G/2iwnTA12Cy bXxw1IaIjNJaccdpwF6wZIxRS4VloIznwkKKBEYVLY2+qftf+uIRMz9MoyrgpM/AdpB6DVKuX rbw91LOaOyKg7J7ndthqhraWjV4FSfMGxAWbG0kOZrbBlXEORFEj7BHPzLeg+N61tzIoOVsCB xH/qQstreXvkAg2sMYA2lmXMadM9Y1TBVO2wsQ4mSX5vVncwSn4+MhyCAiwaS/5k8wK+16nYK Em3eNe0AXH52kDvb6Mt2YlSmz5OSL9JMW41rc4vii92nQudH32JWgRZFqRLwwl5UPgCkOKxeq 7riz0YcV/+DvL1hVfjSSNl9WJEPzFmr5jaQ3R3d9l4Oepi6JNl2g+sxt6lbSFRuTAKCmo2Cc2 0h9eHMnNgkXZi/TEYQoJd9woSsHjiwXN1HEXslFy/In0ifQYPFHXyRgbPaU0TQS4ljeT5J57G eds8PbX1Ck+s5CT+/9D/OjwjYxlpTUOF5vAOTT5hQpdyCqWk+EoLP7tVgZ5hTVL2HlYNbDkx2 dhMBK1XXpGuirQJfPrnT69luslGgheJ0sjrfRLh0TrtbYkbZGRL+1bPyyiVTds+LjqcHeWzhc TVrrrT91LDj0VLpMlScZXyKM6CRtZPdXg1lBLQ== Sender: linux-api-owner@vger.kernel.org X-Mailing-List: linux-api@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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(-) 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; -- 2.9.0