From patchwork Wed Sep 9 15:16:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 254233 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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 1AD38C433E2 for ; Wed, 9 Sep 2020 17:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEBEE2166E for ; Wed, 9 Sep 2020 17:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599671994; bh=vLcbpNnan0Q9ikoYUFHXD8BV6Bv0VtlMkv6yFnjnxqo=; h=From:To:Cc:Subject:Date:List-ID:From; b=JX5faDDML2PZftSw6HwLoEnYPD1wofAb3J1sce/ITmNqR6o680HfjFLZFVvYOdcx2 lCce8SgHK5fRTyAVdHnlLB9zpHdmZ4RTiTvvKeMToema8sYw9V5ZPPWR3dAW3YBbXz BfPFiM5ciy+amXgy7HKvDQuXIV1lr9z+QqMmWOgA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730116AbgIIRTv (ORCPT ); Wed, 9 Sep 2020 13:19:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:54044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729529AbgIIP1W (ORCPT ); Wed, 9 Sep 2020 11:27:22 -0400 Received: from e123331-lin.nice.arm.com (adsl-204.109.242.29.tellas.gr [109.242.29.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B6BA22240; Wed, 9 Sep 2020 15:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599664602; bh=vLcbpNnan0Q9ikoYUFHXD8BV6Bv0VtlMkv6yFnjnxqo=; h=From:To:Cc:Subject:Date:From; b=bC20eOwYllY4VpagoF1zjyK8WcH8S9wOtNszc9xFAJvY1uyGUUDUGkYzgNa4og026 EhZXztxmYuG4m/x6HWyrpkGtF3oJinzLDcTyozTaa21LsPHEwAQGdBuptkfOgpdUL0 6Vsl13MHMhZ09SnVu5jdZYxT/xZ50Jz7Ub0Dyd/I= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Maxim Uvarov , Heinrich Schuchardt , Atish Patra , Palmer Dabbelt , Jens Wiklander , Francois Ozog , Etienne CARRIERE , Takahiro Akashi , Patrice CHOTARD , Sumit Garg , Grant Likely , Ilias Apalodimas , Christophe Priouzeau , Rouven Czerwinski , Patrick DELAUNAY Subject: [PATCH RFC/RFT 0/3] efi/libstub: arm32: Remove dependency on dram_base Date: Wed, 9 Sep 2020 18:16:20 +0300 Message-Id: <20200909151623.16153-1-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Maxim reports boot failures on platforms that describe reserved memory regions in DT that are disjoint from system DRAM, and which are converted to EfiReservedMemory regions by the EFI subsystem in u-boot. As it turns out, the whole notion of discovering the base of DRAM is problematic, and it would be better to simply rely on the EFI memory allocation routines instead, and derive the FDT and initrd allocation limits from the actual placement of the kernel (which is what defines the start of the linear region anyway) Finally, we should be able to get rid of get_dram_base() entirely. However, as RISC-V only just started using it, we will need to address that at a later time. Cc: Maxim Uvarov Cc: Heinrich Schuchardt Cc: Atish Patra Cc: Palmer Dabbelt Cc: Jens Wiklander Cc: Francois Ozog Cc: Etienne CARRIERE Cc: Takahiro Akashi Cc: Patrice CHOTARD Cc: Sumit Garg Cc: Grant Likely Cc: Ilias Apalodimas Cc: Christophe Priouzeau Cc: Rouven Czerwinski Cc: Patrick DELAUNAY Ard Biesheuvel (3): efi/libstub: Export efi_low_alloc_above() to other units efi/libstub: Use low allocation for the uncompressed kernel efi/libstub: base FDT and initrd placement on image address not DRAM base arch/arm/include/asm/efi.h | 6 +- arch/arm64/include/asm/efi.h | 2 +- drivers/firmware/efi/libstub/arm32-stub.c | 177 ++++---------------- drivers/firmware/efi/libstub/efi-stub.c | 2 +- drivers/firmware/efi/libstub/efistub.h | 3 + drivers/firmware/efi/libstub/relocate.c | 4 +- 6 files changed, 47 insertions(+), 147 deletions(-)