From patchwork Tue Nov 22 17:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13052574 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9CFB7C4332F for ; Tue, 22 Nov 2022 17:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=LRFOceLUtK/q+lTIbPi//s7g5eX1pqnDcWFKmqezoAw=; b=edToOi8TguTW4o opCiMBIDX+kZp38JoAwj0e2gwJy3wAHfNn6PuV4c57SOzacFOiWZLqnD3v1pmLhzsuc7W1oQTc7SB yr0n8GJFnA7GHT7AeGZTtxEA/Ycjn2ASuxY6EInTSZizeULtFENSYIhj9oRebhq0MPGvao4fhK+BI 9newy+MwmtFW3ihgi+mKBisIZPpAk+AGJO6GIVobIQOdD1gUsNLb5lMIP3RUE54/014ZM77h4f7Z/ jgeMV5Vhhh6lzQT6LJriEInIrmk0Mk6d+B4Jvc1rLrr0Qm6aRrwhdn8xYz65GYpKI3aN4KQDNkACO 1jUHt8FFY9ZRYLo9UoJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxWfm-00Av2D-BU; Tue, 22 Nov 2022 17:03:02 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxWfj-00Av0a-0Y for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2022 17:03:00 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 681D1B81BAB; Tue, 22 Nov 2022 17:02:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD4F6C433C1; Tue, 22 Nov 2022 17:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669136576; bh=dV/pEqNzcTziJnRV0mLXAD85emax8Cgo/x2Gxs2Bp30=; h=From:To:Cc:Subject:Date:From; b=WwJo95T+ey35yLmiEavbyQ90YPMQ4Cqg6kr572FIhr5usam10sWACdmbmUQNMvtLh yecUjzMwTR7MC4Gu/QMQuQFif69RkKqer/yGM3Zzg8R3YCDiw5iHCFQ4aU+RcXFrlZ MQfc1pPeK30nM21+CaJ1oNLwbNd4UyDnLzRRxS/mINPDCfuVJCYp5/uspVy+vg2OWF ZLu+bUFB5Onu41eFjlpZX7kUQExgTKgfGUIHTqmfuTDpKh8vCwtkPXAMwwq3p/UojT tvhDXG0ZkhN8G8uoLMiwIejCuDJRWmAYg9nEjAoXfIehWoD5PEn/6bfSsFCzdejM8s Q7XZvuhTIR8vA== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Ard Biesheuvel Subject: [PATCH] arm64: booting: Require placement within 48-bit addressable memory Date: Tue, 22 Nov 2022 18:02:49 +0100 Message-Id: <20221122170249.2453853-1-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1566; i=ardb@kernel.org; h=from:subject; bh=dV/pEqNzcTziJnRV0mLXAD85emax8Cgo/x2Gxs2Bp30=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjfQC4xANqGYgFsyQWnxRASSe6+dqFqttYQlmk/t5q t693Qm6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY30AuAAKCRDDTyI5ktmPJLOJDA Cu5ahQ787ymOYmZbxzy0b+87WHviEUGt9/7emATqXmr4mgwgo7mKnc799+40rCMi8fov+Xz0TsrsWa zYgOzx5GP1Cf4sH4s9/RXkh3oVUUcdHAvniosT3kqWR4MR4xD1T0nTVYUEbsBWYZQOnHOc+GZXDI12 pDIUKPNbzC9RWrLXpXPmtD6fiapFI/mCn2vs61md1p2eaFxmjxOlYyAMXmg+Gu0tMANknd5YxC14YL ZpAfGDvyFsHMAYvgSvF82xc1OSNVjJ+NYPPmlflx51feAvfGTLYtjhxQL5FZcGjYr2F++scG192Lbe OWSLO3DrTrOQ6FLJa+hHfnxbV2xfXwlq84F6ED7zGV4Ybh8GVAQyIDNpe/Ea89KJrdcN2FGujH1ODL VpVBhQ7QetQjHwpU0NnurJ/tjD50/uOUKerLWo/HteX6gywgbQgKVjzTKpBQ9NQg8t/aGaxlsTjCEu fKIsvQll8do2W/SWg2uIXhlbasPwrfODPMUDPjFdu5Hks= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221122_090259_216562_C8391AD2 X-CRM114-Status: GOOD ( 14.37 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some configurations (i.e., 64k + LVA/LPA) can tolerate a physical placement of the kernel image outside of the 48-bit addressable region, but given that the loader has no way of knowing whether or not the image in question supports LVA/LPA, it currently has no choice but to place it below the 48-bit mark. Once we add support for LPA2, which allows 52-bit physical and virtual addressing when using 4k or 16k pages, but in way that relies on increasing the number of paging levels, there will be more variety in the configurations that may or may not support this. So redefine bit #3 in the Image header as 'must be placed within 48-bit addressable memory', as this is the current de facto meaning. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Reviewed-by: Anshuman Khandual --- Documentation/arm64/booting.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/arm64/booting.rst b/Documentation/arm64/booting.rst index 8c324ad638de2b27..5a764fabfea821f0 100644 --- a/Documentation/arm64/booting.rst +++ b/Documentation/arm64/booting.rst @@ -121,8 +121,9 @@ Header notes: to the base of DRAM, since memory below it is not accessible via the linear mapping 1 - 2MB aligned base may be anywhere in physical - memory + 2MB aligned base such that all image_size bytes + counted from the start of the image are within + the 48-bit addressable range of physical memory Bits 4-63 Reserved. ============= ===============================================================