From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A61CCC433ED for ; Mon, 12 Apr 2021 10:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7716561244 for ; Mon, 12 Apr 2021 10:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239677AbhDLKxs convert rfc822-to-8bit (ORCPT ); Mon, 12 Apr 2021 06:53:48 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:57745 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239385AbhDLKxr (ORCPT ); Mon, 12 Apr 2021 06:53:47 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-281-A9xhWcd5M3KabBODPhuZXA-1; Mon, 12 Apr 2021 11:53:26 +0100 X-MC-Unique: A9xhWcd5M3KabBODPhuZXA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 11:53:25 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.012; Mon, 12 Apr 2021 11:53:25 +0100 From: David Laight To: 'Christoph Hellwig' , 'Catalin Marinas' , 'Will Deacon' , "'Thomas Bogendoerfer'" , "'James E.J. Bottomley'" , 'Helge Deller' , 'Michael Ellerman' , 'Heiko Carstens' , 'Vasily Gorbik' , "'Christian Borntraeger'" , "'David S. Miller'" , "'x86@kernel.org'" , 'Arnd Bergmann' CC: "'linux-arch@vger.kernel.org'" , "'linux-s390@vger.kernel.org'" , "'linux-parisc@vger.kernel.org'" , "'linux-kernel@vger.kernel.org'" , "'linux-mips@vger.kernel.org'" , "'sparclinux@vger.kernel.org'" , "'linuxppc-dev@lists.ozlabs.org'" , "'linux-arm-kernel@lists.infradead.org'" Subject: RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Topic: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Index: AQHXL3nAXViKKuH90kqxIUkBtWSuL6qwmWXwgAATjVA= Date: Mon, 12 Apr 2021 10:53:24 +0000 Message-ID: <5c3635a2b44a496b88d665e8686d9436@AcuMS.aculab.com> References: <20210412085545.2595431-1-hch@lst.de> <20210412085545.2595431-6-hch@lst.de> <15be19af19174c7692dd795297884096@AcuMS.aculab.com> In-Reply-To: <15be19af19174c7692dd795297884096@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org From: David Laight > Sent: 12 April 2021 10:37 ... > I'm guessing that compat_pid_t is 16 bits? > So the native 32bit version has an unnamed 2 byte structure pad. > The 'packed' removes this pad from the compat structure. > > AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just > adding an explicit pad for the implicit pad the compiler > would generate because compat_pid_t is 16 bits. I've just looked at the header. compat_pid_t is 32 bits. So Linux must have gained 32bit pids at some earlier time. (Historically Unix pids were 16 bit - even on 32bit systems.) Which makes the explicit pad in 'sparc' rather 'interesting'. Actually the tail pad can just be removed from the compat structures. Just a comment that mips and sparc have extra fields in the uapi header is enough. The kernel never needs to read/write the pad. userspace must provide the pad in case the kernel writes it. oh - compat_loff_t is only used in a couple of other places. neither care in any way about the alignment. (Provided get_user() doesn't fault on a 8n+4 aligned address.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,PDS_BAD_THREAD_QP_64, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49CAFC433ED for ; Mon, 12 Apr 2021 10:53:58 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0A3F61029 for ; Mon, 12 Apr 2021 10:53:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0A3F61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FJlwN2zQDz3c0q for ; Mon, 12 Apr 2021 20:53:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aculab.com (client-ip=185.58.86.151; helo=eu-smtp-delivery-151.mimecast.com; envelope-from=david.laight@aculab.com; receiver=) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FJlvz20Bvz2yZR for ; Mon, 12 Apr 2021 20:53:33 +1000 (AEST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-281-A9xhWcd5M3KabBODPhuZXA-1; Mon, 12 Apr 2021 11:53:26 +0100 X-MC-Unique: A9xhWcd5M3KabBODPhuZXA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 11:53:25 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.012; Mon, 12 Apr 2021 11:53:25 +0100 From: David Laight To: 'Christoph Hellwig' , 'Catalin Marinas' , 'Will Deacon' , "'Thomas Bogendoerfer'" , "'James E.J. Bottomley'" , 'Helge Deller' , 'Michael Ellerman' , 'Heiko Carstens' , 'Vasily Gorbik' , "'Christian Borntraeger'" , "'David S. Miller'" , "'x86@kernel.org'" , 'Arnd Bergmann' Subject: RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Topic: [PATCH 5/5] compat: consolidate the compat_flock{, 64} definition Thread-Index: AQHXL3nAXViKKuH90kqxIUkBtWSuL6qwmWXwgAATjVA= Date: Mon, 12 Apr 2021 10:53:24 +0000 Message-ID: <5c3635a2b44a496b88d665e8686d9436@AcuMS.aculab.com> References: <20210412085545.2595431-1-hch@lst.de> <20210412085545.2595431-6-hch@lst.de> <15be19af19174c7692dd795297884096@AcuMS.aculab.com> In-Reply-To: <15be19af19174c7692dd795297884096@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "'linux-arch@vger.kernel.org'" , "'linux-s390@vger.kernel.org'" , "'linux-parisc@vger.kernel.org'" , "'linux-kernel@vger.kernel.org'" , "'linux-mips@vger.kernel.org'" , "'sparclinux@vger.kernel.org'" , "'linuxppc-dev@lists.ozlabs.org'" , "'linux-arm-kernel@lists.infradead.org'" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: David Laight > Sent: 12 April 2021 10:37 ... > I'm guessing that compat_pid_t is 16 bits? > So the native 32bit version has an unnamed 2 byte structure pad. > The 'packed' removes this pad from the compat structure. >=20 > AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just > adding an explicit pad for the implicit pad the compiler > would generate because compat_pid_t is 16 bits. I've just looked at the header. compat_pid_t is 32 bits. So Linux must have gained 32bit pids at some earlier time. (Historically Unix pids were 16 bit - even on 32bit systems.) Which makes the explicit pad in 'sparc' rather 'interesting'. Actually the tail pad can just be removed from the compat structures. Just a comment that mips and sparc have extra fields in the uapi header is enough. The kernel never needs to read/write the pad. userspace must provide the pad in case the kernel writes it. oh - compat_loff_t is only used in a couple of other places. neither care in any way about the alignment. (Provided get_user() doesn't fault on a 8n+4 aligned address.) =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35A52C433B4 for ; Mon, 12 Apr 2021 10:55:30 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBAA361029 for ; Mon, 12 Apr 2021 10:55:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBAA361029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iRJcbkJ4+2jbvmEafIhxKL6T/v0KUhffbs6P6De8BuY=; b=iDlVUO+7A5YXg3PTkhMP99nQc 8SRFsHvQZGiqjjOQmhvDHyg9GhtGLyVPswccvmpWJpnqzbs6FcnfaHYpzWVYJeUP5Wef31qSE4Gmj JSxohOWt/DDQudIt+aSBmqpIaoMJpNIlNwFqVzo2hMQPZEaBHSfBl6nNSXBiVobHvkLcZWpKuEKNn sASi2PQYsHhrWPVU1sFPQ1jU3ciPqgiWHnSIdLOn9kjbb/aHI9i+lqNkqnU7s2Jktjy5E72A4Y8er MxrlgxpxWOUnXj+OcfdYtn1k7TAUc+yjI6GUFb6N5PKWfcanSFP5C1zil1JfvLGfUoFtiN4vf5dxG /dyP6i0WQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVuCG-006Thl-SB; Mon, 12 Apr 2021 10:53:37 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVuCD-006Thc-Tw for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 10:53:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:In-Reply-To:References:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=CQlsr82cX2ddpCPLBF9jAKjZgos8raEJMMgFw2HaX/U=; b=XJYe6JrmCgOiDzxdVJTZl97IF5 nxySx/4VKNOA0sRTRflG/d7g3PomP39vVetuuWGeIfyZ/lZNiMzXMSxX07fecxpfdNOmrbwA27FTl +OfXTx+8o3vzCmCVWUFQecQYPVzLOed6z0MbBwHxWPL74hZlj5gVaBKKNShSppB4a/+9pxe0Ndcb/ qMBb0jjApeAOXuZbzPtX7hANQhP2Af8o4kFAlmciOu2Ow5+2tVtV28sY+q7ckV6RGocj+KNafkpOg hVa/V/uDlKt9CmbMdAr6ETbmTKz9zMtBtgbDf/y1Ahly9Wsh2hQ6Rblx0HMWbgIG/+QEuTe2+wV4k FCs2mUgg==; Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVuCB-0069N6-37 for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 10:53:32 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-281-A9xhWcd5M3KabBODPhuZXA-1; Mon, 12 Apr 2021 11:53:26 +0100 X-MC-Unique: A9xhWcd5M3KabBODPhuZXA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 12 Apr 2021 11:53:25 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.012; Mon, 12 Apr 2021 11:53:25 +0100 From: David Laight To: 'Christoph Hellwig' , 'Catalin Marinas' , 'Will Deacon' , "'Thomas Bogendoerfer'" , "'James E.J. Bottomley'" , 'Helge Deller' , 'Michael Ellerman' , 'Heiko Carstens' , 'Vasily Gorbik' , "'Christian Borntraeger'" , "'David S. Miller'" , "'x86@kernel.org'" , 'Arnd Bergmann' CC: "'linux-arch@vger.kernel.org'" , "'linux-s390@vger.kernel.org'" , "'linux-parisc@vger.kernel.org'" , "'linux-kernel@vger.kernel.org'" , "'linux-mips@vger.kernel.org'" , "'sparclinux@vger.kernel.org'" , "'linuxppc-dev@lists.ozlabs.org'" , "'linux-arm-kernel@lists.infradead.org'" Subject: RE: [PATCH 5/5] compat: consolidate the compat_flock{,64} definition Thread-Topic: [PATCH 5/5] compat: consolidate the compat_flock{, 64} definition Thread-Index: AQHXL3nAXViKKuH90kqxIUkBtWSuL6qwmWXwgAATjVA= Date: Mon, 12 Apr 2021 10:53:24 +0000 Message-ID: <5c3635a2b44a496b88d665e8686d9436@AcuMS.aculab.com> References: <20210412085545.2595431-1-hch@lst.de> <20210412085545.2595431-6-hch@lst.de> <15be19af19174c7692dd795297884096@AcuMS.aculab.com> In-Reply-To: <15be19af19174c7692dd795297884096@AcuMS.aculab.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_035331_409593_80036BA8 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: David Laight > Sent: 12 April 2021 10:37 ... > I'm guessing that compat_pid_t is 16 bits? > So the native 32bit version has an unnamed 2 byte structure pad. > The 'packed' removes this pad from the compat structure. > > AFAICT (apart from mips) the __ARCH_COMPAT_FLOCK_PAD is just > adding an explicit pad for the implicit pad the compiler > would generate because compat_pid_t is 16 bits. I've just looked at the header. compat_pid_t is 32 bits. So Linux must have gained 32bit pids at some earlier time. (Historically Unix pids were 16 bit - even on 32bit systems.) Which makes the explicit pad in 'sparc' rather 'interesting'. Actually the tail pad can just be removed from the compat structures. Just a comment that mips and sparc have extra fields in the uapi header is enough. The kernel never needs to read/write the pad. userspace must provide the pad in case the kernel writes it. oh - compat_loff_t is only used in a couple of other places. neither care in any way about the alignment. (Provided get_user() doesn't fault on a 8n+4 aligned address.) David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel