From patchwork Thu Apr 19 14:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133810 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp714799ljf; Thu, 19 Apr 2018 07:39:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rU0twHWuKjLQQsJNYlLevbLDrJaxx5IqSdLQVDSr3tK7EaDlEw2LFQQC6XI6A/B71T5PP X-Received: by 10.99.124.21 with SMTP id x21mr5360114pgc.209.1524148763375; Thu, 19 Apr 2018 07:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148763; cv=none; d=google.com; s=arc-20160816; b=lkfzS/DTspZJ52mhS71AGjXHSK212yYIObxs5VlZrn2lm+PsB6EkEXV8hfEB9Hz0SG hg+NqLwee4MuJ09EZSTSMcw5gLDxyPia39X3iazNNqhsUjiLR6+wOpZ/p/+4Uq/byvdD vcl0msWP6gm58hRwOku0huPLFom68VwrSoIVtwKO3cmsG/F5bDOOXPvxmy7nsqtpKKGl S46WwTl2bUWIrHh1tJVmGnyNKvyyk5mX4gZ3V4c4y6OZkdBUYiEEI3Eo8R+X/vPZFzeM igqb8pvYTnlBLW/UM2XUTG1mkAkkmM3Y4ih1wvAprOLbRyK8e1UU1rpOyrdxmd8DhZBV ccOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=wTF/NSXpokogOCl5Z1RFJAPc7io7ZijEsJLhVDS1daY=; b=enOhA/RQxPu3chfQ+vkxn6AMvzGXn5gJCF4lRJ7gCtglVqC0bySi8OR22CRgzWFfN5 UrU/TMnBKAI3FLDAuIgfsNnZw1NDGMyMcfJh4ENj9CgQvLEDz4/HvvcVbd0fz3fAtL0P t3fq2ZT/XRBUtXeM983+qyIJeU2SgPIRkFMsz7LCWMa7h34w2424UK7JA1tcri0s8Py7 VxgBziK2TEGzGR/1bBcL3U097tSySxx9NRVAnPxoYs+mNsnHOz6gdMQzHss6UdECxEg6 TPnsS7GOMiz/Z/D2srbbYfvfT7L2IayJHlzr+SnMGZ+vdq73JbOzLrxUxy8k6TQE/7bb sI8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BfjEqBUd; spf=pass (google.com: domain of libc-alpha-return-91705-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91705-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y87si3299536pfi.141.2018.04.19.07.39.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91705-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BfjEqBUd; spf=pass (google.com: domain of libc-alpha-return-91705-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91705-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=lOqw2S63YFzC809ieCi/GFZ46mFGrKA 27H8dOxi8BPwIfWjLZ/PCMj2gRAPo5NwnQGXM+ZKwv1qKbT4MD3ppivKV+v+fdFJ AFE3NcJdpRdBCozofwzdycNYThZe9o4i7tPUdswvzO7N9/hehPx7kGN0xZ+Ap+2S x4qtY8wre+uc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=tZ/i8WRz0gRB9RWKgDKw4Mv2lxw=; b=BfjEq BUdaGRTJx1k05N4TUkaJOd+Z70GeIKS5U3ocTbUSIJYI5RpM1f+wQ7OeQ9kMFwR6 1AS71AEgnYpC+0XRmvviknkpZ6RflVkNIlH3zcxDjWw3tvqlUNfT725t3d5xodni aAGnwNwV53x3a0efu5ZJUmiS0wNQc/LkkAG/M4= Received: (qmail 110638 invoked by alias); 19 Apr 2018 14:38:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 109837 invoked by uid 89); 19 Apr 2018 14:38:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Pad, H*Ad:D*org.uk, Hx-spam-relays-external:ESMTPA X-HELO: mout.kundenserver.de 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 04/17] y2038: s390: Remove unneeded ipc uapi header files Date: Thu, 19 Apr 2018 16:37:24 +0200 Message-Id: <20180419143737.606138-5-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:J32XI7yflj0=:bTG6RbenhvfmIM5bDstiIO SavGxK8VJrirMariKnvfOH9wYz51SN5yWSmS0DfAge73SpM3FWVI6WMzJm4+DuOcTjC3K5ewM 73ledxuDYyARuM6mkhtcXr7adDu0px+u29DAKYoS3EvoIFwy6O/n3eF0YZJDT48fKW1f+PO+E JUE6nQzCthahIWL4QjWiI6lCYTx6TCir5sm2cZ4TMNmLTIP5V2XLh3FePDR4WhF30UcSwVgoO 6GrKKwLIIjEoFdL0nuDNlgJ//4wTpp9MC6n5mH7XDGRNRdFzLCDyERBY1NGwfCe7YDEm2D1HN ht4yDYwbvDGscdFh9i9AJJ7klGlh4CSmyCi7DIEQiiT+4l69mQgyXW61BDttj/fnBk6JzMSSN D2sQFMOu2/0IKUli0HgT8XAHSWSfAjtWIS450fov6W+yCttNC2lKMP/B/bgAsCuHcZ6UuM/g5 YeWtcHQFp7n4zsbo44fzZwI2tP4jBp+LUfRSkEzAXvyaHnXo9e0ENchvpFMXHlH96gMF2pT0i jd9h9rOnDcifKCZSG1SrVAMPg0V2L+obY36zaiZq+Kj7GhkKYr9DaiB1EFrwq6li1yEemdIsh GWbRRtZ8deRjCVrPfe2PbrUzsTRoZ4GNitcFpfJz10wlkkpzPNNYPSVvXJpWKImC4aVWBGuud P1vW1uPQ+Jirgqa3I1DrAR0T8AzsQU0ubjKsKqCq8jSfCyZQOoI1bsJjm8asJRJ75vvh8oK27 rNlYuzlvdAPTO/iE2NLZcFpDG2WV6sWSQWj/AQ== The s390 msgbuf/sembuf/shmbuf header files are all identical to the version from asm-generic. This patch removes the files and replaces them with 'generic-y' statements, to avoid having to modify each copy when we extend sysvipc to deal with 64-bit time_t in 32-bit user space. Note that unlike alpha and ia64, the ipcbuf.h header file is slightly different here, so I'm leaving the private copy. To deal with 32-bit compat tasks, we also have to adapt the definitions of compat_{shm,sem,msg}id_ds to match the changes to the respective asm-generic files. Signed-off-by: Arnd Bergmann --- arch/s390/include/asm/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 Thu Apr 19 14:37:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133816 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp881691edd; Thu, 19 Apr 2018 07:40:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+c6VDQ2nZeMjBOssM/Q7rs4eBP3tA5bjE6hN/kWyBug7i0IR2hOa9E6RRZzA6Xp2mJrQXL X-Received: by 10.98.133.15 with SMTP id u15mr6056044pfd.160.1524148816426; Thu, 19 Apr 2018 07:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148816; cv=none; d=google.com; s=arc-20160816; b=c22FWlQ+yBEcHIkd1xohOUX98ZpJz9LToU1VuayxvbKeufhcXurUAvMb6fckdNGimh kJDyF1sUIW4ac0dsSgrYYmYkWa9VyrxRgoYS300GJxCz2R73chrxZi94EmoRTilKIGk6 kyozaOPU0yGcwGcRFpU6ug9DG5JoLU6esYzPauPIKeME52zPBsYnrkZfuym41zGIpTfE WnFAWt3X9A5GnOypj/rAHVBeO1r31L7v9d9WgVXPF52kuLCUM905+HJWgm+xq0/L7rMA GD1F5UhUzKryG4jVag5+IEik2CRpS3kayPL9atc7VdRtC+M4kmnJGKtAnm6FtMeFniTB 5nNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=15SVco5QnoxEbj1na1GDw8PFl3LCtQIeCla91vOMdXQ=; b=PceJrfad04yBUEDxBUlxEqzsVXp4vy9OvUvJ+uWSTbBYbUY/CDvsXK9/0X3lSDbSil O6RAzC/EBLWAqvO0cGUVYl8GtGLpLPaYagMokvHVRQXI6/K2fNGBTt0AIXgnx2GHorLo Q9ZM7qHNxe7YQu8bWJveBVVj7viK6YDPcdEWS4UMXPBxmkbqP9KyIKSX7NtExWnucGIM i18wCI9eyOfpjLGK8JU2hcTScHyWmGHQdAC+50rinVV2vEQs2RSD965kivdLmEB8TskL nEW9pc2XokDdqj7cMFtykjn9tOQ90oeGg9q3mCTcp5vZgF98pcX4T4WSaEQnEUEtUc1U iRPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VVk6qMg/; spf=pass (google.com: domain of libc-alpha-return-91710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91710-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q5si3149528pgc.620.2018.04.19.07.40.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VVk6qMg/; spf=pass (google.com: domain of libc-alpha-return-91710-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91710-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=sYSQbXnirO4o9WwGk7y/Z4vCujItbfL WBdTldobLvhEqbpWlUS9m0tItNPfi0ehonqF3Ctd1DegBmdLIms4VYaW0UXocny0 P7026PfY2KbC3dI2+O7Tt0fpGM5A+S48B9e/5OIpa6nwOTk0MWSGQooW5DD3TuiY Q+NS2CVVdDcQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=y6mC2rWhfBhEAVGRFP3AE0Sa17A=; b=VVk6q Mg//LL7w9AnTOijc/X6rmM17c5KTmmwBf6TMJAUdCrFqCdJZE2ETau+GbgCE3hP4 2sFv7eLnwMqokXuVMVIHahdgCvvtGcSA9d6XVU1qPk/5wBrr1zuqXv42F7ZdkXWd zoRWL/ty9hG/Uqaiq9JwCY0vwVv/8P7H3YuC10= Received: (qmail 114298 invoked by alias); 19 Apr 2018 14:39:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113805 invoked by uid 89); 19 Apr 2018 14:39:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 05/17] y2038: arm64: Extend sysvipc compat data structures Date: Thu, 19 Apr 2018 16:37:25 +0200 Message-Id: <20180419143737.606138-6-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:yqv5fC47tG0=:pnVW2fG3BmXOs6HCM/g/Fi kaWsTJEz6m3QVPtBL+1rMrb/IWI3iJc24yNU9uM7fgC5tshukHsB5u7DFEgE4dBu5/afNgvit JubdB2GJHb+C0IMhPRWlg7WQxlFF/wo3DurvbPpYvuFWDJFYQ+eqdEKtrfyCBmD8/ztCeDUWY MABvtlTPUNlXzajX7Bj/XPF8s6wPNaUMXBHd24E4wtAwqQnah0WI5W/C4jqv9Y8oLa620ShEc ObzDvuoxm1fkaJBEKaSat7pP162+r0pF5T3BuuVtaJfBR39XojRYXuNuiTG8gePnRfaWqf99K XA0idEDa4WNW6tIFoh9SXQyhoDbXPskOMdZrJj3xAON5IdTi4rh5aWwKaZ4RVhs80El5WHDZD Yj5jutOkcGUjw904K3RXhginebeUVy/tBny9elvakEt3tMKZgTYr9aK0ppSNrrc1rH9R3Csmq MUZrWRt+uSKJUZJKpaezFKGxD9bf/PFVBoCAdfnsJVJ8qOiK+oR7+0pJKhZR/L1wg7/4xYlzU /bo+4e4sWK2UiREfL16ll4Qq5p57Omqm0j5+zH1fnTADBp0Y8jG1654xluyDQn7AxzXflJf29 sSiLnCRHV2G+CmNIiV+tSNWvGbVxuSC3pjmFccCJwzcqVLiHpdULQn5WFFp0jNCGRILvlKLWV djUwOvdXzN798OtHSlo9GnACZfgGU6BfP24DztxUeVlKX1hg5/sS/vF5joRP1Cr5fvAmjOSS7 svQXWOUUGmfMqYn47kAV+ti4RbBUuCQ4sofKiw== Both 32-bit amd 64-bit ARM use the asm-generic header files for their sysvipc data structures, so no special care is needed to make those work beyond y2038, with the one exception of compat mode: Since there is no asm-generic definition of the compat mode IPC structures, ARM64 provides its own copy, and we make those match the changes in the native asm-generic header files. There is sufficient padding in these data structures to extend all timestamps to 64 bit, but on big-endian ARM kernels, the padding is in the wrong place, so the C library has to ensure it reassembles a 64-bit time_t correctly. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.9.0 diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 0030f79808b3..1a037b94eba1 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -181,10 +181,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - compat_time_t sem_otime; - compat_ulong_t __unused1; - compat_time_t sem_ctime; - compat_ulong_t __unused2; + compat_ulong_t sem_otime; + compat_ulong_t sem_otime_high; + compat_ulong_t sem_ctime; + compat_ulong_t sem_ctime_high; compat_ulong_t sem_nsems; compat_ulong_t __unused3; compat_ulong_t __unused4; @@ -192,12 +192,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - compat_time_t msg_stime; - compat_ulong_t __unused1; - compat_time_t msg_rtime; - compat_ulong_t __unused2; - compat_time_t msg_ctime; - compat_ulong_t __unused3; + compat_ulong_t msg_stime; + compat_ulong_t msg_stime_high; + compat_ulong_t msg_rtime; + compat_ulong_t msg_rtime_high; + compat_ulong_t msg_ctime; + compat_ulong_t msg_ctime_high; compat_ulong_t msg_cbytes; compat_ulong_t msg_qnum; compat_ulong_t msg_qbytes; @@ -210,12 +210,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; compat_size_t shm_segsz; - compat_time_t shm_atime; - compat_ulong_t __unused1; - compat_time_t shm_dtime; - compat_ulong_t __unused2; - compat_time_t shm_ctime; - compat_ulong_t __unused3; + compat_ulong_t shm_atime; + compat_ulong_t shm_atime_high; + compat_ulong_t shm_dtime; + compat_ulong_t shm_dtime_high; + compat_ulong_t shm_ctime; + compat_ulong_t shm_ctime_high; compat_pid_t shm_cpid; compat_pid_t shm_lpid; compat_ulong_t shm_nattch; From patchwork Thu Apr 19 14:37: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: 133814 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp715427ljf; Thu, 19 Apr 2018 07:40:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EaDY9ulMCatQcnj1wtaBM9n1wrxDrz/eWgx8sMoTeEKSJK/b6cM9IkGoehCV51u1S2bPa X-Received: by 10.101.72.140 with SMTP id n12mr5438484pgs.155.1524148803743; Thu, 19 Apr 2018 07:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148803; cv=none; d=google.com; s=arc-20160816; b=tjPkEAUF1KXnFB78tV0W0qAzuYGW6EWGsbJVI4i+VFu4oK+fMPY6Ui+FklvHvvVz1D MlTSa5vcU441j3XIdfT+2/A+/RtMQUE7IKgD9Bj7EqddpNc7uuq8LHOod+m0tAqCF0di MlvGAeFe6ZFkkO6115fEsvhD6a4Qprl11VPQnu8jnngTQ5yBKIqb7PGo18ErWZcOZcfV Hfnyq8649dJSvN3tlW3BN1naxTBvquk+ocM603UDHdfYqvCr+h8T/6ycsac1IBkbvyVH nc6SJPOeyl0L/01Nn+L9hYlQksfTZjNmR9djvqMSohjrsL0FSj8x3pl9Xbs2WZG7Y2aH tSbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=Zyy+4cXFhgVVK8I1kRuewmcD1U57zCk+1InHA5hMdZ8=; b=gtoragg2/mcmicGYnSfjsNfdsJr0oWit6ilm6olfKkU6ud6Rnp+IfH2EcN8W30W+qO T8AZSDQexWkw7RY8wYiYRkdAtwWcCTjnt1nCb7gcTQpT7VsUsY7wJceS8oV92bBqqxu0 P4OLuvnbJuBHQy2s5VaLBTCgbBt+OuXn2UqLvpnwPghfewFNecUW8O2fK/Dn8MVQqL13 KFtFLlG9aQPrBJplPjdHweQktMs2iAtol7ICmaCxE7trHO+0fFNG6rtaAIhPVOQYiKz1 WRkEZbFyQ2eiwVC9bd+EAlBBy2wUdcKe+FEStgYayGoYWPE1D6Wr58sJ5Wa0+bL8tu5c 2zEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=HEbb9h2a; spf=pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91709-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w9si3336680pfl.268.2018.04.19.07.40.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=HEbb9h2a; spf=pass (google.com: domain of libc-alpha-return-91709-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91709-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=JmB16x7kLJ3mA4rZMSYmPq/oW2pGWF+ MtipCDzM9qBITBGmqMMVQQWmbZE50qkPX3fUeGYrPei/JS9mOHWHicQIXB1fgURE tJzzuuWUsnnwqED+CkMgtBuP51ieOLRQDotxaOdfVXizMXeCYvd1SZYQl3wahtIG FrfVUI9ZcrJ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=FzkR6oWMFDCY967NqihUPxrPaCY=; b=HEbb9 h2aO5PpzFRuRvT/5AzkAv37lPy9wjxpnKRO34yKPQHkXboL1c+H4i1MAePrxuJma G6PEDMgSUAT7RKPIPnt3MSKTs4wfEeY0UCqxQPRfZzZUEQNTxchHMfo8XZ+HHsY7 O3TOKLW4hLGyaUDbN2JuTCBqtDHzjMt6DbnBPg= Received: (qmail 113394 invoked by alias); 19 Apr 2018 14:39:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113237 invoked by uid 89); 19 Apr 2018 14:39:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 08/17] y2038: parisc: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:28 +0200 Message-Id: <20180419143737.606138-9-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:vD4RPaVT6R0=:0O6PVWnhY80zW8xGWOVbjv 6HK08EPQq4k3wxVLiyh5nZHy0mBKzvaj4HEcu60UiHfdOxa1XsMIOuj2p5OdANSlvuW/CV/aX iRKbM5AMqsvBMPsSTeIVyxfSl3dzaUTKNnjHm7T4D67jrCAJeXZN4RmQBrAa3vv7S5etL6v5z NWTGjVLPJK3eUKJNa/EKj1rTjg7gwscmiYjLVjmxRVpHJ0AIthrJDOh4qlkrHZ6LJmH2YVtJh hX33hkMOsWnbgsg612fdcAT+Z6mw4jaZqgkwFCx9/m8KXoLRHED68u2D0A0TZafe02hRakXq1 aVw6t3LHmrqMZb0wgSjsNvARVWqLJh+o7C6TIcOkf2tomhJwv0y+SLMvkrMVsfRuyRQ3E1HEC whv+8CNaN3mn3vndIYq8MN/vVqgnnh7ayl6hbtQU7dx4N3lbT9QW2fGNSqeYGImCUMaTI+PMN g5JtV9LJQCTcnsIn6KOBxKi7bJhfB4zCTM2k4ZCeIQLZ6cSELWm02QY7C00uFjMAePj+mHTuK lUQ0CyGZCr3eL0mrHhd7NC4Z0jS/hPd3d2tY2awaQt01+qid5pfq4BygLU+OSWWZ1aN4VKCf0 0k/zGaQIGxonV4Wh2Zq7hnIqPMjVTBptoLbjkzrcH+Xkh/luLQN6zo1TumCMJC0VJ4A9OgSva XzZhplU3A3Cd0bDgVphQyvy8+dxNfQy61ktpAIgElHvkmXQPjIgMoBg2v+8Sx8/oJin7M9qM2 kPoZa4F8+wG2FBJiI1t+OdckKzBf4THwl+daDA== 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 Thu Apr 19 14:37: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: 133822 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp882238edd; Thu, 19 Apr 2018 07:40:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9vjijm4kCrwk8IC40hanC1W2CgttEhssgT6acdnmGMU/zpaKN5aMFtPu0pXyeGrjsRKhp X-Received: by 2002:a17:902:8f86:: with SMTP id z6-v6mr6531952plo.316.1524148848424; Thu, 19 Apr 2018 07:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148848; cv=none; d=google.com; s=arc-20160816; b=D4ROtEmQHSayLO0L5PVc4SZYzmfOxA5+PgHqaLlPtFhc3i84hZNkOo79hIMX+1RrW+ qMntNS7Ka5tCP16XVZt/9FAr6dKIVzX+L7gCzcwn75816PSlkyUU8I6Rle4Hk24MVoEA Mv+XFTbGgRwwDY1BhNSJo05JZsMob9q7mPJkz6C7ENfQcphjRl3gxpUDYCnk8O23SP59 AiD3JMGQfjQbv7XIyUUs68+k6DkvKNRcQeaSRfUSzQ07qJlpckpIW1q1GfOwedT2rz+b iGEW36OyFM9MlXmLNMXGGnGMgsAOC4EVR2Ba+yOqE+ZsUeQ2R2R46uR3pA2qDdh9CoM5 wm6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=l6l8hBD1LwMEc8rPECkl+yH6jwVWAzXXcGJGNxvajns=; b=VkhIOswts4DnNqqUrvXQBK3Vl82L9paoZ0X6sX7YKdvE3KhW2kv3wNCRfFcQqX8MS8 lVJQLyCcE+ES90ABaRSr8xZMRb4UpVMzEhEXSWvY71YsAUapWPui9TLKPDcjB3dk+Ftv k9nL14jHTGVDpgFEdTqpvYVH22lCx54SGkBLvk2GW0SMH1bI3rL4/cSIgV6ZDroKYqOg HSbH8LumKrsb5IoclFymBWXo1F8GSmqjTjQatbjj4A36Bw5mZ0JpSlDyB0tIRjQzr0dU bKVsQd9vMo1bj3GglxDT8J22ebxnKn3fIkrm2LL7YypEGnd3aFv8bneAawHXlCvwaL5Q a4Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sGyShwoq; spf=pass (google.com: domain of libc-alpha-return-91713-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91713-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id n66si2675876pga.299.2018.04.19.07.40.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91713-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sGyShwoq; spf=pass (google.com: domain of libc-alpha-return-91713-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91713-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=MLsWib0/0gtaL6f6lgsHOrzCMgRpZeT CoBleEnKGYjjBsKgaLUS+GK8QdVyavHMc87B8cR6TNq3TGNjgO5rOY3gYbLCJSXJ 734g/jglmbotZi1TbsFNTOIg+1OEfnwUfKB+/Bf8HU8dYA/SsmZypYFz1tfF1CWD 0OiNOALtopAA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=WzFCdhXG/KupnfNewxAJL5y1h5A=; b=sGySh woqQL+TMS2WxImIQvr+eSH80CQgoApT8SPOohGCjIdarAcIBjaSeMVil5SfCnqNl uPiJCN+gaxJ52LpkY/7b4A2r8XKjTj5XFq4ko7w49N2CpgxMpB2DGDpypNASv4BX CgKf5BvINiMMQbvoy2alSXhzDHfIT/Qab8SSIA= Received: (qmail 114517 invoked by alias); 19 Apr 2018 14:39:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 114318 invoked by uid 89); 19 Apr 2018 14:39:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 09/17] y2038: sparc: Extend sysvipc data structures Date: Thu, 19 Apr 2018 16:37:29 +0200 Message-Id: <20180419143737.606138-10-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:tjx1+eikukE=:Slz+bhRUHETkkn0fu6Yz+T zlm3HMb0f2eiL1n7nMnE66+dnT0+kodfO9CE9zFhcjggmTnNky/uXNH7cWkaTq4ncvBaNn7PY QwR7/Rne8xmQFEekwu+rhYXZ4ZiuIp1j+YakxTSakv0LmsfNSsK+C82EVDoCDHWxlZZ+1ycgy BSkRvgQ30iMFGxw8TGQwhZezM0cX0gR8BTVpAIcUdGSz57tPIfJBGIr2TwMzHClAQ6kyu4RNZ o7kfPYv76cit+UcP/Ira7IV4r2klbI7XIrpo96WHKnq5OzUWaceoKKPWgMH9/jeXWMLk/H/8H nRoH/H5gKp0s42LQzrDMqIdrzvmb9GQnk2V1CfRFUOqAMFcAaNFdKzXxfFYwgsMg0YGcfnCyY m3A8imOoAZT9g3MdUZ2xNw1SjJVvwgdZLkXpHBxm4C9JOUDCVJnL4iyPhtrRjnEnVVUkZqiO0 LVdcFmnNy8gYTpENMNe+Syhbd+3ZS7/dF1GwjLEIuAVf5zFTmnzmhYBIGhwHzxB07+ipSrb4u 0VZddSZ3fbfftJjQkMzk6MLkTWJBUV1Vwmqz1FcrdsDF8KjMxNenvfshQmA6IXYGCaYZ/J8dv HHDBOEbTorKtmFOFGF6NlCIluwJugCYUkzAcs8af9A2Ys3VhTrCohTUUbNQJDiFOL4daE0IeI t8CdSuP3hfR3w9PqZt+xsEixRQcgEZPITcCS5olHmG4dNJpAg/N/ODVkoxrfAdoGlYnyBRDJ5 FAZCsyXfR4KyfgOS2c9jCC66hD1rRhdxZSpeLA== sparc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. Unlike most architectures, sparc actually succeeded in defining this right for big-endian CPUs, but as everyone else got it wrong, we just use the same hack everywhere. This takes just take the same approach here that we have for the asm-generic headers and adds separate 32-bit fields for the upper halves of the timestamps, to let libc deal with the mess in user space. Signed-off-by: Arnd Bergmann --- arch/sparc/include/asm/compat.h | 32 ++++++++++++++++---------------- arch/sparc/include/uapi/asm/msgbuf.h | 22 +++++++++------------- arch/sparc/include/uapi/asm/sembuf.h | 16 +++++++--------- arch/sparc/include/uapi/asm/shmbuf.h | 21 +++++++++------------ 4 files changed, 41 insertions(+), 50 deletions(-) -- 2.9.0 diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index 1910c44521e3..4eb51d2dae98 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h @@ -192,10 +192,10 @@ struct compat_ipc64_perm { struct compat_semid64_ds { struct compat_ipc64_perm sem_perm; - unsigned int __pad1; - compat_time_t sem_otime; - unsigned int __pad2; - compat_time_t sem_ctime; + unsigned int sem_otime_high; + unsigned int sem_otime; + unsigned int sem_ctime_high; + unsigned int sem_ctime; u32 sem_nsems; u32 __unused1; u32 __unused2; @@ -203,12 +203,12 @@ struct compat_semid64_ds { struct compat_msqid64_ds { struct compat_ipc64_perm msg_perm; - unsigned int __pad1; - compat_time_t msg_stime; - unsigned int __pad2; - compat_time_t msg_rtime; - unsigned int __pad3; - compat_time_t msg_ctime; + unsigned int msg_stime_high; + unsigned int msg_stime; + unsigned int msg_rtime_high; + unsigned int msg_rtime; + unsigned int msg_ctime_high; + unsigned int msg_ctime; unsigned int msg_cbytes; unsigned int msg_qnum; unsigned int msg_qbytes; @@ -220,12 +220,12 @@ struct compat_msqid64_ds { struct compat_shmid64_ds { struct compat_ipc64_perm shm_perm; - unsigned int __pad1; - compat_time_t shm_atime; - unsigned int __pad2; - compat_time_t shm_dtime; - unsigned int __pad3; - compat_time_t shm_ctime; + unsigned int shm_atime_high; + unsigned int shm_atime; + unsigned int shm_dtime_high; + unsigned int shm_dtime; + unsigned int shm_ctime_high; + unsigned int shm_ctime; compat_size_t shm_segsz; compat_pid_t shm_cpid; compat_pid_t shm_lpid; diff --git a/arch/sparc/include/uapi/asm/msgbuf.h b/arch/sparc/include/uapi/asm/msgbuf.h index b601c4f4d956..ffc46c211d6d 100644 --- a/arch/sparc/include/uapi/asm/msgbuf.h +++ b/arch/sparc/include/uapi/asm/msgbuf.h @@ -8,25 +8,22 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ - -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif - - struct msqid64_ds { struct ipc64_perm msg_perm; - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t msg_stime; /* last msgsnd time */ - PADDING(__pad2) __kernel_time_t msg_rtime; /* last msgrcv time */ - PADDING(__pad3) __kernel_time_t msg_ctime; /* last change time */ +#else + unsigned long msg_stime_high; + unsigned long msg_stime; /* last msgsnd time */ + unsigned long msg_rtime_high; + unsigned long msg_rtime; /* last msgrcv time */ + unsigned long msg_ctime_high; + unsigned long msg_ctime; /* last change time */ +#endif unsigned long msg_cbytes; /* current number of bytes on queue */ unsigned long msg_qnum; /* number of messages in queue */ unsigned long msg_qbytes; /* max number of bytes on queue */ @@ -35,5 +32,4 @@ struct msqid64_ds { unsigned long __unused1; unsigned long __unused2; }; -#undef PADDING #endif /* _SPARC_MSGBUF_H */ diff --git a/arch/sparc/include/uapi/asm/sembuf.h b/arch/sparc/include/uapi/asm/sembuf.h index f49b0ffa0ab8..f3d309c2e1cd 100644 --- a/arch/sparc/include/uapi/asm/sembuf.h +++ b/arch/sparc/include/uapi/asm/sembuf.h @@ -8,25 +8,23 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif struct semid64_ds { struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t sem_otime; /* last semop time */ - PADDING(__pad2) __kernel_time_t sem_ctime; /* last change time */ +#else + unsigned long sem_otime_high; + unsigned long sem_otime; /* last semop time */ + unsigned long sem_ctime_high; + unsigned long sem_ctime; /* last change time */ +#endif unsigned long sem_nsems; /* no. of semaphores in array */ unsigned long __unused1; unsigned long __unused2; }; -#undef PADDING #endif /* _SPARC64_SEMBUF_H */ diff --git a/arch/sparc/include/uapi/asm/shmbuf.h b/arch/sparc/include/uapi/asm/shmbuf.h index 286631db705c..06618b84822d 100644 --- a/arch/sparc/include/uapi/asm/shmbuf.h +++ b/arch/sparc/include/uapi/asm/shmbuf.h @@ -8,24 +8,23 @@ * between kernel and user space. * * Pad space is left for: - * - 64-bit time_t to solve y2038 problem * - 2 miscellaneous 32-bit values */ -#if defined(__sparc__) && defined(__arch64__) -# define PADDING(x) -#else -# define PADDING(x) unsigned int x; -#endif - struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ - PADDING(__pad1) +#if defined(__sparc__) && defined(__arch64__) __kernel_time_t shm_atime; /* last attach time */ - PADDING(__pad2) __kernel_time_t shm_dtime; /* last detach time */ - PADDING(__pad3) __kernel_time_t shm_ctime; /* last change time */ +#else + unsigned long shm_atime_high; + unsigned long shm_atime; /* last attach time */ + unsigned long shm_dtime_high; + unsigned long shm_dtime; /* last detach time */ + unsigned long shm_ctime_high; + unsigned long shm_ctime; /* last change time */ +#endif size_t shm_segsz; /* size of segment (bytes) */ __kernel_pid_t shm_cpid; /* pid of creator */ __kernel_pid_t shm_lpid; /* pid of last operator */ @@ -46,6 +45,4 @@ struct shminfo64 { unsigned long __unused4; }; -#undef PADDING - #endif /* _SPARC_SHMBUF_H */ From patchwork Thu Apr 19 14:37: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: 133813 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp715114ljf; Thu, 19 Apr 2018 07:39:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zmezxXxTQdxuXmPgvDnSagw0utYvGmD/I19mWB0xye69Cre9LJcsVa0oX+8fMQwHECQR/ X-Received: by 10.98.210.134 with SMTP id c128mr2093882pfg.240.1524148783707; Thu, 19 Apr 2018 07:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148783; cv=none; d=google.com; s=arc-20160816; b=mGJ1XzfKGHbwDNidUCw2vWUmNmyptvHY5lCyeD/BYLiq5zXB6SM3kyjlnfHJxXvHQU zyfNtBAlrifXi77uRE15b7Tuqcqj4G3uVTbIDWJCrsz7VQ3glgRLiw0mgNMBsqSCBBEJ hzSUh4LTzGkqDRYvmy3C2aszvoBfm+JCELpq2voUsfHSw+gvgEBiu0wXcP59QgFX96qH wC3cBzHLQlLPdexfmaRvV6VtrAbyjcRGhAe5sN1S75Y/Cvofzbt4O5aRItxdLAKcQ2MO Jbyy3PVXnevIdOkkT5oyhrICD8akB6rcvftix5VyzPCzZBtralU+D0niUC4egihSy1q1 56uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=FNvNZqL1QVz9jPezmoJv0nLyoBHEtt5FGAOH7Fqlq3E=; b=K6XSrcjg/MGpDIcqKE2acppNZAU/9/Cc4bSpA3IYlCH+UJOxsQHFVRcRDLWcP55Fbk asAsTAYvra4ycIz29TzVl6/+hiqePdiCvljGjsqwLzVgFOwmsGLQaoPt9rjgQVvOBMQq 9Pf2JW8D9xhqt0YquQJp/mZbobKiLd6Sek6beHSxp3jIxitELXy57Cbkowa1DZIw1MTd LDsx+QTBXeJT5fM7CvqjCuWtflKuvjmVXNldmLQC8bWLOn3DGd4rYNYCXvEdY3seGuKh gb7cspOd40yalAGPkYrrpJUoGCODCZOR5csQyQlxzQY0WPD8pBY35sAIcX0jp9sOG31J gD2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ycUxVGQ5; spf=pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91707-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s10si3067070pgq.162.2018.04.19.07.39.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ycUxVGQ5; spf=pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91707-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=slzc7XgzpzBZS9+TeJ47iCmY/CQ5Gi/ 3IqwC0UZPHCl6PCGX2zkRo06GpC6P3KLBy7OmVXCL7yauFRF3s1h6h9TifJGlOZt h25LC8UgDk2T3ZaZClDcL0EhRSZKInON3SzwTirQ6e7bcSD+EOZDew6IcrTPGCat 4SWGKAt1seUw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=q9icjhybE9xwgfSYwzjHhuyay+Y=; b=ycUxV GQ5C/whnWj7Jjpke430ZvX45UxV8uVWcWzekp0+IOW1chhamWx0OB5K7dvi3Tu2L h5+xRY+n28mJvhC0IR5jIbOqYDOui5+kLetV10Lz1sax1cSkWb6cs8EhT4luf+Lv SalCSwCQbEhFukz/uujMoiRlnUSybPvhcUBTyA= Received: (qmail 112874 invoked by alias); 19 Apr 2018 14:39:05 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 112702 invoked by uid 89); 19 Apr 2018 14:39:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=alter X-HELO: mout.kundenserver.de 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 12/17] y2038: ipc: Use ktime_get_real_seconds consistently Date: Thu, 19 Apr 2018 16:37:32 +0200 Message-Id: <20180419143737.606138-13-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:gamAfTntK3c=:Y84ZIW/sL96pFrxVIiQxKO XNl5i4VA4tAsRztW5MVcW+5deXMPX0mrHYEiLkvXiSj+GTVhULDHEF2GWRr8LMSS/hc6DNHpA IeQzVzt/Ll5oqCYy38voBTLGp25VUAjylYt+SeHGdgH+a57/egjuscZkdYAI+D5XwyluuFr5T Ojl/XSRa8EhSChMa3xqUQZ+dlILqEgsrHNwa8Z39muGttZ/gtjbCL3pAQsGDR8RUjgrU93oKW pFNxje4WDtcrCdEciG7IQ2dzi3Kgp/r0+QhyD0gUVnJtRs7dq/Qtuq9VoSQ3WVpSuqrfNZP0x o0iOBlpHjtaSpQpHMVoxQykWwrba/JqgNVUKZCfEqnOlGK3CMZ5JJvNulR14jB+VKo9I513my GPYV97Bp0D/XkIiDkIPxz86q2f52i25Apbgw/tGf7NhtkbLcBrD/HhJ5rQuhvJaFbb/xANGzc KNL2YOBI5AzAOS+pmXaw5H4Yl2B8mGR6eeo4dTsWwpfn0rucp/KsyZe4METvgRzZKRifZ/Qzq VqR9uPfbb6xwR7zvthg4PjiZoTft/+1hLwivufStEK+ImMs/L5Z1vswGnRxUgARynKUyX4h6m tvt7ZDRocyxgQA7jGpubGxAOaTaYTmYiE47roivgLYT/5Nv9f5PNNhT99xtBkevS3jBtDc61E B4+vGQt3Gg2vlZFmOSpNSsXGSRsHmwoB5hrm02R2B+r59sD79iuCaQ0JFGCwqQTfcSARGPMft 4AverK4XmyzeEH81Wl7xyNo8oeJFWUMt9EYEVw== 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 Thu Apr 19 14:37: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: 133818 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp881875edd; Thu, 19 Apr 2018 07:40:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JPvb2SuF8KcbCAd/OEH7IH1iRRFPYLjlMwWmTkz20hl8uqEuAZJkBSH33V86OANZ8bJwx X-Received: by 10.99.174.6 with SMTP id q6mr393526pgf.350.1524148827154; Thu, 19 Apr 2018 07:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148827; cv=none; d=google.com; s=arc-20160816; b=kWkUxvXeoBsvu2LQMlbI75iiP2kE0BhBMB+MTkHn612fcoCo9QUTavBDf+dz0nY5Rn 5v53GL2PNU3yIdG4ZfVhW5IZMTIrW1Bd+dW6rlqNGnmZVQ8XFNhQy9WoqjbsB0CwB6Br Ovmqifseuiy/r9nXtWHX8KVkD7VqsaTdCn1+hcvEsnNPQfcI9SD/F+ASDFT7DR2do8IA iflZ//EQdf11SLBsV5n15ynfhMQcXArI9xk9ADA9uKaYwU9L6cjy53weCPkV5Wn/vRQT NY2xy2urHMOIBJly6s7Qp6FgR0ZK1mSC9hxZ2+PuZaXI7kEsfg5SoUxjjHo0w+P64c9x eFSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=UBzRDlwPHIQ409lkdhtVRYuqTq2/VtvTzjteyodxr5Q=; b=0Gwf4nhMOjVbzqwNBzaOEw2FlVTjtdaZ+pLMPKfSXQflABxyqK9/95Img0Yxo82qSG oZ+Kr1Zek+pl5A97l5Tpt9lNVXwCaE9R7wRaR6TkP67TAOekRgy3qNX9u9tYLKO25VMs YoUf3qpOuiR56nIqOVCqVQDnpeqInetOW9FTueOajyqujI/x0PvyxiqcqV6LZRLt1xVf sMaNGLjnCbzO7bNXh+4selW51XGASY2PfizncYy+PPQ8rxtfNBsIfuPVVqKnGsaBsuEs BvIyHrOpapVC2Fm+oUXld1Q3j7XJE4JO84t7691wY7gKpNDCbU5QO7AAfxbE1AWs6q1/ 3XhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=O7e74nz5; spf=pass (google.com: domain of libc-alpha-return-91711-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91711-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q3si3143495pgs.516.2018.04.19.07.40.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91711-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=O7e74nz5; spf=pass (google.com: domain of libc-alpha-return-91711-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91711-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=y3WPna56NuNW85f2rPCSd9gsTzElIyc 8BoWSlo2o1S61k7w6H3OAkfraOBkfyhl+IRedZZsWh2zm1meSKbsluXLpspFeAUW A1S+ARb8vCSAwrydw9eYNi3mmbmIa5+yWK08LHDXz1bQo3XmtOhlmIxUwzYw5wtJ RkeAAlTd/k2k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=LTP2UIANVjSLvuRmlyjpqGY/KUI=; b=O7e74 nz5IVH0Cd8La1hFEGEk061J7UStX97ZSdA/Og1YFkIqs3/vE2AMDyR3WEQz0wBDk uzGsq44nrsR9sU75ilCweSYcE3bFJ/W6Ui2V7F2HTQ2Ye9rc41hZQPy4Q8DaSfqc 6c27u9IVRxP/wdqdi63NplDDvoQErUSKQIy+m4= Received: (qmail 114340 invoked by alias); 19 Apr 2018 14:39:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113790 invoked by uid 89); 19 Apr 2018 14:39:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 13/17] y2038: ipc: Report long times to user space Date: Thu, 19 Apr 2018 16:37:33 +0200 Message-Id: <20180419143737.606138-14-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:gxdyLn+WgI8=:QrwmH4QYo+vDf32UyJdn7U GSXwOq8Z1P7oZctcw2SmS9F5NIQmA0QoW4HwdLoapUoWwk/u8gl7dIE1rRkTMnaHq4j/fGxPo hOk4JleURV63Logc0B8S1Cg40e4uLjhoQb18E27t0iANqBK6qEIYhQBAFt/1v1Uf08kG2PFF2 jerMAjzenIdfTTE2EPhmO0I/q9a7+K+JH6t49M2eEwV+KnEPvip8TROI6rrgheWzfYTspKmZv oM3PjuC7K8J9PBGzlbyUC1Sbh5+c4uTdJpLR/1FP3PFCChiCP3+5aidqaKeksqFaQLlKZKHwA oKcXDoJ/VvjVfodTK0nC5V75BAkAzAsSAcfJZ57jU0jZgQ7NSJPiuUzrRO+flHJhgvwZWUKcz OqrkZR9cA6dn8Ixql3KIAGaFJQ+EgMsDxJIbjtJrm8aAMN6hzkL8CtGSS44JUx3Uut+nAJVXq zFn8dlpNU+5Q7RBIm9/uYgAJU+Tn9Iw2vOxrQrJQd9HrkgqTCwdKgJSYi+Ln7BRP2Njg54f3P gFgTEKRnrCf/3ipwryqF+06ElwS5qGmKFhUL1Lb+YKsyqgwMJ28krqyHeje9ZTYIe1wQfH2c1 zgGOg7RQd9CWXv4b8OKcv+BS+8IXsCi9pLW3AxaC2S64mz+5Fb9ymNfbH0GnQuyCTRO5FSu1R 1zHcMUlI33FRxF6KJmfI6q3XHKaFgG1XRS820YwMaFhxt2bTgWie/p3f0wWuDk6sCRdtde6/0 op3uJXKZvCvI42H8ci3022Ijj8oeqLWvpdeOow== 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 Thu Apr 19 14:37: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: 133823 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp882405edd; Thu, 19 Apr 2018 07:40:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SFFKusaWotGwHQCO4QvmX2myPajO7XuAIO//1AKA1Q/oiwtU9sUgqwXv7r3cZm3KyZkTx X-Received: by 2002:a17:902:1e2:: with SMTP id b89-v6mr6492373plb.389.1524148859052; Thu, 19 Apr 2018 07:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148859; cv=none; d=google.com; s=arc-20160816; b=Kiwm0ip1HUhM3v/rrjNPNQO7BhaCcvxZZJ8GSbtqUHuGV+yIP7ItRIzYzgsi+l1e6C INqBU7X7HfnVODVAR+E9QSNk9PodZSdn5Je0HjgPvKJTihaEIZl6DM+xVKUVYSFNAxC6 IIJTmVUxEZiNkhIqX26uFJB+FUgQRz8Jb++rEVCocZVpvzaj07lNfTNB4Twuwa3CssxM WksfECPkFwRIzQrxVyTvcd008Vxm/REBEL2MJsWJr77g1pezuqj0n9iQQ6ZmtF7oCAhB HZbuUZlYCZsPOoa9Ybeotef3Ag2qESuuS0FCs0xBl5NR1PC1pq0f8zC8ZX9yiTrUjDaj qOEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=CLZOfbiWuiHqC0BeAcR402aTnRNG5tOEtrsqLfrGOcE=; b=dM9WwyMhElIUg/RiqQVa4YVOIigDkhAA4+EOqGjnLmbIZvnt+KrZIM+s2sq/eE4/5J oKUEHIXohW7HZwUo5SLf3LKDGFmSlgrtGuCn6+c3DxahMownJd+ZjM1P56tIUq6lGai7 D2Gu9yhEO3ylPQIf/i6e8m/3oRd1vWSIVwnQ0k3rJjuXj4IQN+vqa7QRWdzYt63pGAv4 T/t27V2CNcsRrR+lDjWfrYecUQkVuBJQfDQXNnEiLbhB7FEy4vCrRvzzXdUddr+jxq81 azTRm71QjKOX00V37xYosWREBfrtRtzAG+DZo3aK2i1LnR6bHNhFVY9LdT+6zKqTW6EB 1TQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=jPZ6axLW; spf=pass (google.com: domain of libc-alpha-return-91714-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91714-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l28si3255952pfk.38.2018.04.19.07.40.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91714-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=jPZ6axLW; spf=pass (google.com: domain of libc-alpha-return-91714-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91714-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=sbIGoyp9xAEQcPMbV1ApAT0RbqTRQv8 6VPOBN0rtoA8QcvBDVYz8G5/dNd8asTuOWpY7WRTWIkNLLxTF4cq8Z5WIn3oQoPo IPDZ90NJZxk62VTjS/uy7YOOtLMp4Qck7XogheTz6c4q3oFP6WIH8jwF/C9+y8Gu gJS3wmeofuQ8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=vYCyqrcdCyHZrtSS3fnisIu9TL4=; b=jPZ6a xLWK4CCWGzg2ss8MuLem8kfLqmFxs7xerv9Bw+D8BZKaIwych86Uvyuyde0lhhcK ySnMjIwLDzoZpxV/6U1gRtVRMV4PlBHdAQAIEyCO+kNkjfFdV8vSw34wkTYy+dfo r2MM4BeEIQbF36tQje54wt2s4R8mzCxaZY9FiQ= Received: (qmail 114611 invoked by alias); 19 Apr 2018 14:39:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 114368 invoked by uid 89); 19 Apr 2018 14:39:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=useing X-HELO: mout.kundenserver.de 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 15/17] y2038: ipc: Enable COMPAT_32BIT_TIME Date: Thu, 19 Apr 2018 16:37:35 +0200 Message-Id: <20180419143737.606138-16-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:28YI5D+IHS0=:xWOSR6zBUn8BQ/UqyYRXhL 2jZ4Ua5Tfz9y0nGYuNgtJ9AoCf9UVNlxLpbksG0+sz62morHm8WPh3bFcloBjOtBrSOUr/vPG DhWUmefNuknVVKQuU4o/SKwwfiH7kMuQX+ZjQP2U7OmH+OnsrEUi4pAU/GpmJDw1+qXMb8M5F W/gGGNG0MmcZT6KcXRkibJFlATILysA2vPaIC9NFHW18BEoIvPdnRMW/IdbxxuzO1KJl0Kpvw LA+SsUdEVQqcAZYYv2QeM7MpebnMa9uzx8iGyyOqpQODHQ5zsJbm+057hZLmy4BcDVwvJgegB p7ttbRHoJxZmSuD+hSWZQAXSoLqRHJ1fAzLcrROj0F7D7XmgC7Nk9duydcz2tasnKj5ewVXn1 VITs/xOJttlXqNsGlFsw2dzpOG7SlDOuQ9Ufo0iS0sCj+xqFCEVdlSjB/KmPTS7aEeZU2jnib tyDfbE5G2DAt7k6CngpfxCGzCvSIi/QnhVRFJfLoTm4e+a78viD7ju8kMhUGx8IMijdKR89Tk sG4xFXBUB2v2iQ/4IzISz2jPK67F5LyVl2AY7dyE1dunUwbATjPl6OAdKVp7Sb03hin35+S52 pqzB073jE4UpbbeZWd/xK6Xlv0xmOWQooe1DptZpGLTJpg1JvjE1+cvVF3AnA+S6AglSphNXY ehylfKumwMRdgYeuwfQGzJ7KEy+QNKGtTQh37Q8B+2nMycuNvNE/VU4vX1BmlewA11eET4EmW 3JshkqEEpZa2OxYUdnRuu9OsKgy5C8SQB1uUfw== 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 Thu Apr 19 14:37: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: 133819 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp882086edd; Thu, 19 Apr 2018 07:40:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Oc4wdmpDyYRhcmDkV62QJHbKoTEisyHWsPMz7dcBWLTg0F/xO9uFlAKIDxm3Qc/zoTcBT X-Received: by 10.99.121.14 with SMTP id u14mr5401173pgc.111.1524148838265; Thu, 19 Apr 2018 07:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148838; cv=none; d=google.com; s=arc-20160816; b=YWmF07hAZWhEGI4aUR5G+hTgDu7yN4R9KqLKLvf3oPMnhyk2wfGfE17uWS6i6TXP7d Sj9wUVpr7aombTrz3TVRy39KaVuDWuXLBOYJwUnbZ6StUl4NOipzDb9mc6+GcXEgayEX +4pDZjRELy+LKZHPtT/LeMfX8TDC73axwxpd+nqM7SfgnPrKLQbPrWtIgSWpbxndPQ+J pVcDlJDTjbooH0UVt7YgqBuDpEqoFIguPWnVCGi8RjLBQlKW6j0yAttnLeHvFCGlkic/ 2GgOkVXuNTQUFzS1D1Nk/xuZ19B/UtHIFhAve7cKtrrJBu23DXkhsUO9G1Wu/EBlgJxb rYHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=39/1bDfRnc2X5xw7srZoxuOsBDHzOzoOVHiQ+A0iwOk=; b=tska9mYZn8ym7yZn1/8m1O3qs5A9DdbvXTVu/YmBSnzDDyyeBUjgEcLpcLQtPaJsvi Px8oHvVqbvUGTruszvcUhHjKU+aJV1UtMoCxcL+qdlW2aJmcvjAhoiYW0jyBtjWkLrbc qSTHY4MQ6Ld4gB6/0Pxg/BeJsJQPCBEciQ4PvA5xclQa72rGaElJkI6JNQ1x6+sKRGDw a1ciZmENl0RkMPxGR3ubZCWlw9ykef0CP2Eqm9cI8sGrtUV7OmDwuEI1/mmXgjfsj3JH 1rvA6xPJiNYLsp5rwhZbmR3xcdGHyfssoae+z8vn++AON2S5zKEuz5Cid2ssGJ9BObV0 NowQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=m1S0krQo; spf=pass (google.com: domain of libc-alpha-return-91712-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91712-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b23si3100781pgn.459.2018.04.19.07.40.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91712-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=m1S0krQo; spf=pass (google.com: domain of libc-alpha-return-91712-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91712-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=tJnHmkZr3I6CxdXoQNHus5oGm4/GcDF FTBcVxFDyJdxIB+QgZuczD3FndrxJFkhQyicHjFrqCrc8V0/chpgqvIwjYlOYZCX ZHpOCvRJNFV5VHRg/RzqomTHDqY8G5Iiqws/Gcx/DQdKc5PTkaznkXH9TlsM9TuU T9wOqAh6X34M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=rMW8ob9KDX/zhNo9us3625nDdgc=; b=m1S0k rQodJSOu+nb7boLKIY6Y13nApWnutEL1bja8PrlCx8FMUGvEuWUWFmV/skPgID33 fSn0YiWeTyakXTa+PwIkYUhVCMcGJWrVlT2+NRynfJ7V80TtIpQCYL6+qX3hzv86 rppkdT9tnov3VlDBLySkmob9GBYhHwB9GmvEHg= Received: (qmail 114452 invoked by alias); 19 Apr 2018 14:39:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 114206 invoked by uid 89); 19 Apr 2018 14:39:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 16/17] y2038: ipc: Redirect ipc(SEMTIMEDOP, ...) to compat_ksys_semtimedop Date: Thu, 19 Apr 2018 16:37:36 +0200 Message-Id: <20180419143737.606138-17-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:wQXGZSTpe0U=:a/xBmS8XT/fFtn9/F9/ipp Y6bU55DSx34IJD2DR9vhY8W4gBLt1pQBF4swNmKRid5DyoGpkQkSSBuq3clFURdvSdreXTHPd o5cp4UrAdU8UHRZa4ePr04Igj1dJodu1ZjeIyfdREmGyTw66ND8BTVcEDQETzxEdn5ro8nIn1 urhbE7cqq1GADF5lprGO1TV6azwqVdKM9Vtt6+A38DWb1jGMGx3baOHN+qsJaP4r2L6xqAPcd rJ6BaIhL1mzeg7nmWfzcyghexZB0H6+XAEuH3AMu9jqEjnLql9HCBGi1+YUnBKj1jzQYPObFp EJV2ERi/VPG+uB3/Mw/deLcTw/+wFdb+QFs8NnJTamZSeBa25aVEf8jfHoW7Lg51QBUQ1Eu+S rUrkiQJnrC8TVvrORGJFg/IdRu1LaYVQ2vcbrYy9f33278zFJ2/VGSWwg+koCfW+jRL2JiO7Q 7weOL93sEVrqIZKYKxQ4QLTovcEfPT8P+Yh6yVqQnhguSKpPmQ2VPgNkEqHHzrvD2Ob7QbilG 0uUK91A3w24KSn+Z9kAviq+nMVKe+2JXfhg7p42OqZY/utJ1OBuwrpxglMNYYiPmN6rjc4jiY pZ6JKIRt/BiMOpTA+ggj6mQKha71uNHr+zBMh8vBa6/vQ08oHxAsnyEnk+ozKocaL2RbGBuvF aQskQF2J3Kb0E3/esu5wGPlYsSAezYR29Wkc7Gy1WjESEzub8U8lx1qqZzu9wRvanhw5B/Fae DHMfIVamC4m3HSXx9c+8SZeh+uq64aLi7u3E8g== 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: From patchwork Thu Apr 19 14:37: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: 133824 Delivered-To: patch@linaro.org Received: by 10.80.173.174 with SMTP id a43csp882992edd; Thu, 19 Apr 2018 07:41:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx482i+W2j55rpf7JWMjrdIUfxNuzUX6OyMs7Ctb+mG5QDIHnefKos/Tvi095CdpZQv5W3+f8 X-Received: by 10.99.109.65 with SMTP id i62mr5371128pgc.233.1524148890292; Thu, 19 Apr 2018 07:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148890; cv=none; d=google.com; s=arc-20160816; b=dYqhiYvhKqkLkeVGAwXUeTGjDqUS8bTu0d6GDaic76hlkzCHkNz1tYmcztKLlFpXT2 7Z0mrYtHTce/yfS9q5RzCKL4hg3X62EfHyYOKfLJPM1xi0fb1OnoAG2yaCHWZxgBSRX/ IkZWZ9iuwbE4AZVkgpKiubL8gqO3wOV8fKGieEo1Lxxa03RLqNHXRAQwYv7T7o23FHrH +Vvd1xuL6YoqOHASWeHQiiP97PaPFPRs7G0iNvcDCPbov3StmEOCYNddK5Ag3zwdt3IY R3Rq2vt0RysS9hYjzRlljrFqx1aX6S0EfqYE6oWqswpzHyZ6AslroWp5Ua2nkkruJlfY H5jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=GzB6AhYB5j5t6ZqMs+/ZXiFhVR1Q+VaZdHFKnV5LYLs=; b=geFQ+v+I4/qHKlt3t4XSJyq40PA5aidfyocNRau11zP6mBJJe78osIobDRPUuasRhI QH9RbmmKfabdCKyFIHjWF/71PpAMgTMy22NpIxIaa4xdwFz55W23wBKYUA9YNxPgavkE WqRyqDm+hcEn0kk6oL39Gv3FhZiBge8eWmvV1mhSK75uUFt44d44Xb8j9Gsfl31KiWVo wrBcA1gHn5V7yICnTuJdL8f8CuJI6DBGpu5RGFng4noIH2+6BYxQZuxlOz7WIf5kaB4K TtcP9RAuI82y6GleaL616HpBTvpMFiUWEfG76JVYni9gvlYSwpnrcpls1WylIK6ZlTMV /plA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=heJEWrc9; spf=pass (google.com: domain of libc-alpha-return-91717-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91717-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a8-v6si3534118ple.222.2018.04.19.07.41.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91717-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=heJEWrc9; spf=pass (google.com: domain of libc-alpha-return-91717-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91717-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=OhXVyt0JUA4UHYVlFBMSaeiGiNcNq97 ltQ4NZqOx6kY7XcA9eJTgo1uisfw+9ppjf83UG8X2JXrWul+oHF85mXREgvyZRMR vbdEyTHN483zkoxZzw8bu4IurJOzpumquCkz1N4aT7F8c0NOfrAtDUD4ByhK+B5a O9CJmD0Vmp0M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=ADgZvlwwB79HqOSPCqnjetbaUkE=; b=heJEW rc943r6t3qNFXTNDzPK1F8C7P+rUG0USb4GF1ik6E1EIny6B0RlIO+ujgb7CriSD ztemukGszrRsgKa4WtWhrVEu5TstDe1bGK7M7AGllCzXbdpqavGiueZetNfmdl9W YbeKXuzV9KblGy0+M6rORkWHundT99jH60lyZ0= Received: (qmail 115971 invoked by alias); 19 Apr 2018 14:39:23 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 115792 invoked by uid 89); 19 Apr 2018 14:39:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mout.kundenserver.de 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 17/17] y2038: compat: Move common compat types to asm-generic/compat.h Date: Thu, 19 Apr 2018 16:37:37 +0200 Message-Id: <20180419143737.606138-18-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:UBOPPLYyKfk=:Dz0Ql6rTRjW8IToON1HW7Q 1YCso3T5kfGA+u8M2xasX2QKvLa1Jb2/xA7spFoWcjfE6Z4+pFJIcyHHaJaZFaxkb+pKoV9r+ HLKyqhOx4kY4UP2eiuaDmSgj4MZ6960H1MprP4wedEiixSHsXLG5BwNmzX88IZry7ElLzKUnQ H6OJsSadjEwGCxpDi0cNFE99nj4Dqt2XJdHVsK9ApF3Mbvn1FYicrh4W2cfJzjM3gR/shosLy QzssK2HluAUm2LZwA1AW33wlOav/mS7qrsp3Dic0Dd33kO3v44llXV+nIm3CS2Ih4IEfk4mw5 7HdTsFTc5E4aqCB5Ft9V78CCZEon3wQrtCdc4PEgTr9GiPxxZpz/+R4EW4WgjJGquxwY6gbca 3Go9VQhx3vezGGltDFrYKPAc6yNZLFx0crsTqF82HJ45rgJUDGuXACu8s48ry85ZtQeKsy1mF dY9L7C3e5ddiGtjhs0X8sNEY6IGN7R1F3hWUF3x224JljZxiAr1D7tjuXeTl7wxj1o9pCSZho byc3HqxDdz9c3axRna37TOGCBNlZBXXw12/y9FpgS2pyEz8Cb/1H8AlQOztQ/Wyk7fi5ACUtD tw2XinCQyxEwOSXkoUdKcl/G35MrbRmAS2aQVKCsanGXzmxhddYaCR3rXeej3/bY7zbvA68XM fxMM3KmuGqOAZCXkubLkMRYRLGyynqbeH5umICcgh+v66XmBAKjZzzXs6coVFFpZZQkyEtn2t QlGvpK3ckgeJ1ugNVYb0rS50OlF4Gb6mGA477A== The architectures that support 32-bit compat mode define a number of simple types for use in compat handlers. About half of those are identical between architectures, and some of those are also required now by handlers shared with CONFIG_COMPAT_32BIT_TIME functions on 32-bit architectures. Let's move all the identical ones into asm-generic/compat.h to avoid having to add even more identical definitions of those types. For unknown reasons, mips defines __compat_gid32_t, __compat_uid32_t and compat_caddr_t as signed, while all others have them unsigned. This seems to be a mistake, but I'm leaving it alone here. The other types all differ by size or alignment on at least on architecture. compat_aio_context_t is currently defined in linux/compat.h but also needed for compat_sys_io_getevents(), so let's move it into the same place. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 20 ++------------------ arch/mips/include/asm/compat.h | 22 ++-------------------- arch/parisc/include/asm/compat.h | 18 ++---------------- arch/powerpc/include/asm/compat.h | 18 ++---------------- arch/s390/include/asm/compat.h | 18 ++---------------- arch/sparc/include/asm/compat.h | 19 ++----------------- arch/x86/include/asm/compat.h | 19 ++----------------- include/asm-generic/compat.h | 24 +++++++++++++++++++++++- include/linux/compat.h | 2 -- 9 files changed, 37 insertions(+), 123 deletions(-) -- 2.9.0 diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 1a037b94eba1..a4c79f9e856d 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -25,6 +25,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __AARCH64EB__ #define COMPAT_UTS_MACHINE "armv8b\0\0" @@ -32,10 +34,6 @@ #define COMPAT_UTS_MACHINE "armv8l\0\0" #endif -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u16 __compat_uid16_t; @@ -43,27 +41,13 @@ typedef u16 __compat_gid16_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s32 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_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; -typedef u32 compat_uptr_t; struct compat_stat { #ifdef __AARCH64EB__ diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 78675f19440f..7033a7c93b48 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h @@ -9,43 +9,25 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "mips\0\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_suseconds_t; - -typedef s32 compat_pid_t; typedef s32 __compat_uid_t; typedef s32 __compat_gid_t; typedef __compat_uid_t __compat_uid32_t; typedef __compat_gid_t __compat_gid32_t; typedef u32 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u32 compat_nlink_t; typedef s32 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef s32 compat_caddr_t; typedef struct { s32 val[2]; } compat_fsid_t; -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; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index ab8a54771507..f707e025f89b 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h @@ -8,36 +8,22 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "parisc\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u32 __compat_uid_t; typedef u32 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; /* dev_t is 32 bits on parisc */ diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 85c8af2bb272..036b210b1582 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h @@ -8,6 +8,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __BIG_ENDIAN__ #define COMPAT_UTS_MACHINE "ppc\0\0" @@ -15,34 +17,18 @@ #define COMPAT_UTS_MACHINE "ppcle\0\0" #endif -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u32 __compat_uid_t; typedef u32 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u32 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 97db2fba546a..63b46e30b2c3 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h @@ -9,6 +9,8 @@ #include #include +#include + #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \ typeof(0?(__force t)0:0ULL), u64)) @@ -51,34 +53,18 @@ #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "s390\0\0\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; typedef struct { u32 mask; diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index 4eb51d2dae98..985286b79891 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h @@ -6,38 +6,23 @@ */ #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "sparc\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; - struct compat_stat { compat_dev_t st_dev; compat_ino_t st_ino; diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index fb97cf7c4137..0ce6f452d334 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h @@ -12,38 +12,23 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "i686\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_timer_t; -typedef s32 compat_key_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 __attribute__((aligned(4))) compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; -typedef u32 compat_u32; typedef u64 __attribute__((aligned(4))) compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h index 28819451b6d1..a86f65bffab8 100644 --- a/include/asm-generic/compat.h +++ b/include/asm-generic/compat.h @@ -1,3 +1,25 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_GENERIC_COMPAT_H +#define __ASM_GENERIC_COMPAT_H -/* This is an empty stub for 32-bit-only architectures */ +/* These types are common across all compat ABIs */ +typedef u32 compat_size_t; +typedef s32 compat_ssize_t; +typedef s32 compat_clock_t; +typedef s32 compat_pid_t; +typedef u32 compat_ino_t; +typedef s32 compat_off_t; +typedef s64 compat_loff_t; +typedef s32 compat_daddr_t; +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 u16 compat_ushort_t; +typedef u32 compat_uint_t; +typedef u32 compat_ulong_t; +typedef u32 compat_uptr_t; +typedef u32 compat_aio_context_t; + +#endif diff --git a/include/linux/compat.h b/include/linux/compat.h index cfc1b6383ae0..af5ac9de4bdf 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -104,8 +104,6 @@ typedef struct compat_sigaltstack { typedef __compat_uid32_t compat_uid_t; typedef __compat_gid32_t compat_gid_t; -typedef compat_ulong_t compat_aio_context_t; - struct compat_sel_arg_struct; struct rusage;