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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 EE011C433B4 for ; Wed, 21 Apr 2021 05:50: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 36C116101D for ; Wed, 21 Apr 2021 05:50:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36C116101D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de 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 4FQ8mc6Ls9z30DG for ; Wed, 21 Apr 2021 15:50:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 4FQ8mD3VqLz2xYx for ; Wed, 21 Apr 2021 15:50:35 +1000 (AEST) Received: by verein.lst.de (Postfix, from userid 2407) id 7324868BFE; Wed, 21 Apr 2021 07:50:28 +0200 (CEST) Date: Wed, 21 Apr 2021 07:50:28 +0200 From: "hch@lst.de" To: Arnd Bergmann Subject: Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems Message-ID: <20210421055028.GA28910@lst.de> References: <20210416230724.2519198-1-willy@infradead.org> <20210416230724.2519198-2-willy@infradead.org> <20210417024522.GP2531743@casper.infradead.org> <9f99b0a0-f1c1-f3b0-5f84-3a4bfc711725@synopsys.com> <20210420031029.GI2531743@casper.infradead.org> <8d0fce1c-be7c-1c9b-bf5c-0c531db496ac@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) 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: "grygorii.strashko@ti.com" , "linux-snps-arc@lists.infradead.org" , "netdev@vger.kernel.org" , Vineet Gupta , "ilias.apalodimas@linaro.org" , "linux-kernel@vger.kernel.org" , Matthew Wilcox , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "mgorman@suse.de" , "brouer@redhat.com" , "mcroce@linux.microsoft.com" , "mhocko@kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "hch@lst.de" , "linux-arm-kernel@lists.infradead.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Apr 20, 2021 at 11:20:19PM +0200, Arnd Bergmann wrote: > In that case, there should be no problem for you. > > The main issue is with system calls and ioctls that contain a misaligned > struct member like > > struct s { > u32 a; > u64 b; > }; > > Passing this structure by reference from a 32-bit user space application > to a 64-bit kernel with different alignment constraints means that the > kernel has to convert the structure layout. See > compat_ioctl_preallocate() in fs/ioctl.c for one such example. We've also had this problem with some on-disk structures in the past, but hopefully people desining those have learnt the lesson by now.