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=-10.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 3AF10C433E0 for ; Fri, 12 Jun 2020 11:50:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 065EC207D8 for ; Fri, 12 Jun 2020 11:50:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RzICvHYM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 065EC207D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g6qX5guTHuyZRRpfRyi7MdwiKpWAMDdBUVqJt7NfomM=; b=RzICvHYMAb1ILw VyxXpE8+yB1a+yJT72Y3B1Uo0MRjvXfbYDCX/nyGvCrisvuUHKhaKhe72EVFQQ4PQynWXuZ8NmoHy wM5i0iQYBGxzHm35zR/bFbKFLbe+3lrSQD9+tKM7RGxRLKDSjpVP4kusehebUzMrWYbRizqiRzNyU WwQXTPMnewVirDCmDazBt9O+X4ybpbvni+pvMRB/CNBXAagmxu259sb5mOWesZ2m2Gf/yqypToxS/ R+rx7VnaVz+rl0aDTOJD/fFiQE4Fl9ZpJtvRUphtJTpTT34b1lkOZcAGPzdySgufU6kschH/MrItQ JvgcsHwF9y6yAldu37cw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjiCP-0003AP-5m; Fri, 12 Jun 2020 11:50:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjiCL-00039q-2r for linux-arm-kernel@lists.infradead.org; Fri, 12 Jun 2020 11:50:14 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3232431B; Fri, 12 Jun 2020 04:50:11 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CD363F6CF; Fri, 12 Jun 2020 04:50:10 -0700 (PDT) Date: Fri, 12 Jun 2020 12:50:08 +0100 From: Catalin Marinas To: Arnd Bergmann Subject: Re: [PATCH v2 1/6] ARM: Use PAGE_SIZE for ELF_EXEC_PAGESIZE Message-ID: <20200612115007.GB19739@gaia> References: <20200611134914.765827-1-gregory.clement@bootlin.com> <20200611134914.765827-2-gregory.clement@bootlin.com> <20200612083510.GB1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200612_045013_171639_EA65710B X-CRM114-Status: GOOD ( 21.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Gregory CLEMENT , Russell King - ARM Linux admin , Thomas Petazzoni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 12, 2020 at 10:46:17AM +0200, Arnd Bergmann wrote: > On Fri, Jun 12, 2020 at 10:35 AM Russell King - ARM Linux admin > wrote: > > On Fri, Jun 12, 2020 at 10:22:17AM +0200, Arnd Bergmann wrote: > > > On Thu, Jun 11, 2020 at 3:49 PM Gregory CLEMENT > > > wrote: > > > > > > > > Currently ELF_EXEC_PAGESIZE is 4096 which is also the page size. In > > > > order to be able to use other size of page than 4K, use PAGE_SIZE > > > > instead of the hardcoded value. > > > > > > > > The use of PAGE_SIZE will be also aligned with what we find in other > > > > architectures such as arm64. > > > > > > > > This is inspired from fa0ca2726ea9 ("DSMP 64K support") and > > > > 4ef803e12baf ("mmu: large-page: Added support for multiple kernel page > > > > sizes") from > > > > https://github.com/MarvellEmbeddedProcessors/linux-marvell.git > > > > > > > > Signed-off-by: Gregory CLEMENT > > > > > > IIRC using page sizes above 16KB here also requires using a > > > non-ancient linker in user space that places sections on > > > ELF_EXEC_PAGESIZE boundaries, right? > > Correction: I was thinking of SHMLBA, not ELF_EXEC_PAGESIZE. > SHMLBA is defined to 16KB in arch/arm/ at the moment (based on 4K > page size), or (4 * PAGE_SIZE) on arm64, which can blow up to 256KB. > > AFAICT, SHMLBA should now be defined as "min(16384, PAGE_SIZE)". Good point. We should do this with the COMPAT_SHMLBA on arm64 (we didn't bother since COMPAT had a dependency on 4K but you can override it with EXPERT). > > Doesn't that mean that this change breaks all existing userspace when > > ELF_EXEC_PAGESIZE is not 4k? > > I think a lot of older user space would be broken with page sizes larger > than 16KB, but would still work with 8KB or 16KB. Larger page sizes > would only work with user space that was linked in the last five years > or so, using a toolchain that has the workarounds for running on arm64 > with 64KB page size. FWIW, Debian armhf now boots fine on an arm64 kernel with 64K pages (it wasn't the case some years ago). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel