Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp123511pxy; Tue, 20 Apr 2021 14:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzwasKac2zry2g7RKPBbfiR1xyCR3mnuieZlOSiQ0DksYqgatW+FpG1wgN1WmxCh1unRVH X-Received: by 2002:a63:ab05:: with SMTP id p5mr18781214pgf.149.1618953682753; Tue, 20 Apr 2021 14:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618953682; cv=none; d=google.com; s=arc-20160816; b=Nkjfqog7iwa+XzRkvxnlHGT2pyAfQ6+NHUBis5Tk1vLZbEirAv9GQA58URBFiRpyDj AwulkDirRETV7QbsPIXvVGHgf4mLBPOywMRxQh9U23KFaxDZ1+OFf2dhxFQAQ0RFhrbJ XAtBV8xB5NkXwojgWonZnUyx+iO9Jtopz4jdhU1CKguFCKqSn3fVT6SN10fdw+lm2YKH tB0MLpVe30MSFDs1U6GB+cIFQ5ceSN6bvv25AmJR3K16bfeKmj6u9NWyF7HVr0DEHRwn JBapXh9pKgcEfudveldZA8jxurqrE/I7VIKA9XFpbxcWIMmgh7oAEphP+oSuze3SHFky TbVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uNQ4B07ow0uHEA97N3A90TkRt7nsbqDUOE9+zR7Q87E=; b=wQ+Aw655XWG9hJLGJlByPasnoC9yjrYOu8yMEvgfRhVffU3mKkGX5gFhAUUw3yM9H3 mMUPpgh7CAAjHGZkXI7Q+tQb0CjszIuCPkKdnKxVo0uRcW9hcLgLZblFmXz+fON/ae38 kcU3AMJ+7k6HmpDyu2OgXCfzWoSt29aVK9VRHWXzt2MJdepmWLuS86rOGmwlCZd12RiW 7yjALzr2nIpwgLq1hVdNWZMevlX9QTzKmswYs43HpPMVCtcPWeJd4ULF/5RoMkyrE9Pv rN5juaf09oVAD5hAwwuk+Q19L7yv06nJvps+YHUfQ1smPviR96PZU/oW8P2WvBiYOL2C WDWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pArvFq3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si17360plj.213.2021.04.20.14.21.10; Tue, 20 Apr 2021 14:21:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pArvFq3B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233964AbhDTVVK (ORCPT + 99 others); Tue, 20 Apr 2021 17:21:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233724AbhDTVVJ (ORCPT ); Tue, 20 Apr 2021 17:21:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5654D613FD; Tue, 20 Apr 2021 21:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618953637; bh=D/HoBu+aWo6sy7+88V9ZJnpot0ZpiBRBCM4AzeXp6I8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pArvFq3Bg0eznwDb5FJ1AJDg4uGehP2ZXKHtXg7aSehY89wKEHnhCX/mVatOV6ryT nDf/2gvwWh2BDXh18chg97cOw9UActFB0apxymDDRvGmAtrI+L2MxaIEWgzX7jpw9/ I6JLRl8kn9AQ6J9IvmQAviE14HNt8N/LqXSJX6Yc8z5xS4zHK7FHiFEETtVwkWVrGB ni8KvuVndFviPLslG4RxcSW6KHg6Ja1EsEaatvDzQRx4T0hna0qzuUDlgNWehOQjdA mm7h1tAH/Yrc26ZqgFuXReHd0eXJu3ggmg3bvbxA6/Qfv+QEPBu4PF73L18ZgMJocn /MnvOs1utGgKw== Received: by mail-wm1-f43.google.com with SMTP id f195-20020a1c1fcc0000b029012eb88126d7so115272wmf.3; Tue, 20 Apr 2021 14:20:37 -0700 (PDT) X-Gm-Message-State: AOAM5312J0QYU+bOC90W0DFl9gFz8T+LnEYF+cEW0ihhc70CIoOM4GHc eqcfnT+1H3Xsbpk105GPXqYrmh8K2m6ju7cgPpI= X-Received: by 2002:a05:600c:4149:: with SMTP id h9mr6135531wmm.43.1618953635407; Tue, 20 Apr 2021 14:20:35 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <8d0fce1c-be7c-1c9b-bf5c-0c531db496ac@synopsys.com> From: Arnd Bergmann Date: Tue, 20 Apr 2021 23:20:19 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems To: Vineet Gupta Cc: Matthew Wilcox , "grygorii.strashko@ti.com" , "netdev@vger.kernel.org" , "ilias.apalodimas@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-mips@vger.kernel.org" , "mhocko@kernel.org" , "linux-mm@kvack.org" , "mgorman@suse.de" , "brouer@redhat.com" , "mcroce@linux.microsoft.com" , "linux-snps-arc@lists.infradead.org" , "linuxppc-dev@lists.ozlabs.org" , "hch@lst.de" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2021 at 11:14 PM Vineet Gupta wrote: > On 4/20/21 12:07 AM, Arnd Bergmann wrote: > > > > which means that half the 32-bit architectures do this. This may > > cause more problems when arc and/or microblaze want to support > > 64-bit kernels and compat mode in the future on their latest hardware, > > as that means duplicating the x86 specific hacks we have for compat. > > > > What is alignof(u64) on 64-bit arc? > > $ echo 'int a = __alignof__(long long);' | arc64-linux-gnu-gcc -xc - > -Wall -S -o - | grep -A1 a: | tail -n 1 | cut -f 3 > 8 Ok, good. > Yeah ARCv2 alignment of 4 for 64-bit data was a bit of surprise finding > for me as well. When 64-bit load/stores were initially targeted by the > internal Metaware compiler (llvm based) they decided to keep alignment > to 4 still (granted hardware allowed this) and then gcc guys decided to > follow the same ABI. I only found this by accident :-) > > Can you point me to some specifics on the compat issue. For better of > worse, arc64 does''t have a compat 32-bit mode, so everything is > 64-on-64 or 32-on-32 (ARC32 flavor of ARCv3) 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. Arnd