From patchwork Sun Apr 22 20:17:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 26902 Received: (qmail 4673 invoked by alias); 22 Apr 2018 20:17: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 4662 invoked by uid 89); 22 Apr 2018 20:17:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f196.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=yuVRF9qkSzb1K/ULzAFo8OAgna4w5IsHqAaDsAjc0cQ=; b=sd4QYwrPag2HcrW8s6jiSC+bk+hLSIkhGPIYltwK4PyNYSniNYO51BZom5mP3J+C7E eMhchevc4R5xixFIgTGhHy9lM45MaDR3YRKyB5/JCYf2JVDAkixjD3kyYeFJ04W3mnjN NMfFKr74f57Nqm1k5yLfcoldjQMuQtXHZ0j/dbOLkbbmN97yTEm50mkCwXCc12AL1y7K anV9EjftykPR7KoAy/L9sPtxW0ZV4A3MCyHGh0E8eCBRDF5GWPHDVQE7rky546AMif6m 0/HzwbkuYIKw2iYipR5j9+24RrNixDaiGiyhdrQbXeY21q+U8tOl1eQh+lhRqqy2ZSSL 8NjA== X-Gm-Message-State: ALQs6tAa+8luHy7zhXk07LjXtWbtoiKmHpJOYDPBs1vlbo6b4SEhTth1 x69vA0WdTd+6lH+iAtfcjepLvCR4+7ox3x6XqOA= X-Google-Smtp-Source: AB8JxZrMTSFoS+FuhqmEh/VcyJJZbgHPDVmpcebPUO/P3VyspvSKJEv6Mzy+PvKFatkiB1La3sRynJf36WmMc4TxEfo= X-Received: by 10.55.76.146 with SMTP id z140mr20804120qka.224.1524428239312; Sun, 22 Apr 2018 13:17:19 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20180420130346.3178914-1-arnd@arndb.de> From: Arnd Bergmann Date: Sun, 22 Apr 2018 22:17:18 +0200 Message-ID: Subject: Re: [PATCH] x86: ipc: fix x32 version of shmid64_ds and msqid64_ds To: "H.J. Lu" Cc: Jeffrey Walton , "the arch/x86 maintainers" , Thomas Gleixner , Ingo Molnar , "Eric W . Biederman" , y2038 Mailman List , LKML , Linux API , linux-arch , GNU C Library , Deepa Dinamani , Al Viro , Albert ARIBAUD , linux-s390 , Martin Schwidefsky , Catalin Marinas , Will Deacon , "open list:RALINK MIPS ARCHITECTURE" , James Hogan , Ralf Baechle , linuxppc-dev , sparclinux , Ben Hutchings , Daniel Schepler , Adam Borowski , John Paul Adrian Glaubitz , "# 3.4.x" , "H. Peter Anvin" On Sun, Apr 22, 2018 at 2:38 PM, H.J. Lu wrote: > On Fri, Apr 20, 2018 at 7:38 AM, Arnd Bergmann wrote: >> On Fri, Apr 20, 2018 at 3:53 PM, Jeffrey Walton wrote: > > Glibc has correct header files for system calls. I have a very old > program to check if Linux kernel header files are correct for user > space: > > https://github.com/hjl-tools/linux-header > > It needs update to check uapi. Simply running 'make' on a regular distro shows this output: This seems plausible, the statfs structure clearly has the same problem as msqid_ds/shmid_ds based on its usage of '__statfs_word' which is now defined as '__u32' rather than '__kernel_long_t'. It should be trivial to override __statfs_word from arch/x86/include/uapi/asm/statfs.h I've checked the other uses of __BITS_PER_LONG in the uapi headers now, and all the others are either not relevant for x32 (either definition is fine) or it has to be __BITS_PER_LONG=32. Arnd --- kernel.x32.out 2018-04-22 22:10:16.053432423 +0200 +++ glibc.x32.out 2018-04-22 22:10:16.073432838 +0200 @@ -10,9 +10,9 @@ size of daddr_t: 4 size of __ipc_pid_t: 4 size of struct ipc_perm: 48 size of mqd_t: 4 -size of struct msqid_ds: 144 +size of struct msqid_ds: 120 size of struct semid_ds: 104 -size of struct shmid_ds: 136 +size of struct shmid_ds: 112 size of struct shminfo: 72 size of struct timeval: 16 size of struct timespec: 16 @@ -22,8 +22,8 @@ size of struct mq_attr: 64 size of struct rlimit: 16 size of struct rusage: 144 size of struct stat: 144 -size of struct statfs: 64 -size of struct statfs64: 88 +size of struct statfs: 120 +size of struct statfs64: 120 size of struct timex: 208 size of struct msginfo: 32 size of struct msgbuf: 16