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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 5C9FAC43461 for ; Wed, 9 Sep 2020 20:52:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21A7A20768 for ; Wed, 9 Sep 2020 20:52:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="aYA2xAEl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbgIIUwz (ORCPT ); Wed, 9 Sep 2020 16:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbgIIUwz (ORCPT ); Wed, 9 Sep 2020 16:52:55 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56CC3C061573 for ; Wed, 9 Sep 2020 13:52:54 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id m5so2933400pgj.9 for ; Wed, 09 Sep 2020 13:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=PtXzKIm23zRtpuuZ6ilAcjx2516RE2gxhsCv7WC6GB4=; b=aYA2xAElEsVNsIm8zIjfEUq1XOOrrHdFmq3Npts8cQkZZmm1R4FWaqkHUlt3OUzc5V 1UAJLfVo+X8HW6b3oKeJdd2ojpERZ30EVy5lNuJXEIm5fOIog6B3ntH9Xr/OvKxbCSKw xFHYAYbjy3X80U2DAtVaA46kkwoiyFABj0AyRtChOsp0cMPbR/rIj1KPFIO0jaJNRAhi tAPaUi4Dv3nr+JRwnFqqGUDbKGkPr/lG6gXnT04apN5PFuczpdELUiP1BHxM6+I29mDs aECOsRo+sAipniUvwvyr5nBUTqbiSDs1fuh6ISK4+7lz8UwkAl9agBNZjMGQ/dfzT0RR nSwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=PtXzKIm23zRtpuuZ6ilAcjx2516RE2gxhsCv7WC6GB4=; b=RIMfqtJ/alBr74SEntLOA//8pJqbuUKni4PJW2Fnh93xg5vDJqshI7xT/kxzGwaczX ouYG7Pj2oTfGBNm+CPLtUoIDgWcyCCDvZNCpqkAghtY1GZoAJo+/AUzr5UrC19ergePC Vw3uzoeMna0UtJXLqKxq7DbqCvC7gZtzqRUGg5iIEqy8ZP1sK/I/EvsklNQq+MHySPTl Q1EEZy8/UG5M0LazszF+oixBCJpmOKarQWTCG9j08eRd8FxW0SIUFSKYxPjde2xfEiOh VMwA5sDfKd38FfzOOdMFKbYFneRzkR6Gi2yDKVcJ8AnU2Fq8EsfAI8L7Q9+2ZpFA/dBY cztA== X-Gm-Message-State: AOAM530fJRTyRXxAdqCImrBAhJXvq5SsyoGaNdAdHIpjEgT/8ZZh48Qs Pc9ysAieGL6O+ZJoafpqEpemnWY4dTvWmT6D X-Google-Smtp-Source: ABdhPJxIkM60LhoRwBkumw7TyEYGP8+pANRD/tXAlO+U7HJ6Qa12lLibyeMtceMdRqNBoeXnlPTjXw== X-Received: by 2002:a62:3641:: with SMTP id d62mr2315115pfa.82.1599684773346; Wed, 09 Sep 2020 13:52:53 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id j19sm3576058pfi.51.2020.09.09.13.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 13:52:52 -0700 (PDT) Date: Wed, 09 Sep 2020 13:52:52 -0700 (PDT) X-Google-Original-Date: Wed, 09 Sep 2020 13:52:50 PDT (-0700) Subject: Re: [PATCH RFC/RFT 0/3] efi/libstub: arm32: Remove dependency on dram_base In-Reply-To: <20200909151623.16153-1-ardb@kernel.org> CC: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ardb@kernel.org, maxim.uvarov@linaro.org, xypron.glpk@gmx.de, Atish Patra , jens.wiklander@linaro.org, francois.ozog@linaro.org, etienne.carriere@st.com, takahiro.akashi@linaro.org, patrice.chotard@st.com, sumit.garg@linaro.org, Grant.Likely@arm.com, ilias.apalodimas@linaro.org, christophe.priouzeau@linaro.org, r.czerwinski@pengutronix.de, patrick.delaunay@st.com From: Palmer Dabbelt To: ardb@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Wed, 09 Sep 2020 08:16:20 PDT (-0700), ardb@kernel.org wrote: > 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. Looks like we're using dram_base to derive two argumets to efi_relocate_kernel(): the preferred load address and the minimum load address. I don't see any reason why we can't use the same PAGE_OFFSET-like logic that x86 uses for the minimum load address, but I don't think we have any mechanism like "struct boot_params" so we'd need to come up with something. > 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(-) 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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1EAA1C433E2 for ; Wed, 9 Sep 2020 20:55:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C28BC2074B for ; Wed, 9 Sep 2020 20:55:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qYITFq0p"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="aYA2xAEl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C28BC2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:Message-ID:To:From:In-Reply-To:Subject: Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=s66zgoSnyHrf39p0T3xFKMex0i88taIA5vM58uC15sU=; b=qYITFq0prwuAUdsSkhrp3bgrU RqGMnTli/MbZSqhU6tWvN6ACJ/hwqhi3kzBu+VkBz1KwSfgTKTHZAZWhck+iYqcG+6MxaJk+F9kjZ 8GRbei6rftJduM8UFZvwaI3jW4o9zROm5T3YRohrdpttajEL0OmFfRJPWBRTFIrBqk1aD8o/0LawZ l/obpeQ+6EkTvNenLSPcOly8PSRg1r6tNe4ZroMiNEYNnvLo9f3c/x9QL70aTydLWpvVV7fUcRJ4C dECsL1uz6rC46AC92W+OaD6Gc3oBjaleR9FiMhGjpBqF8pxJKLa+C84omvWJssxkRi9yzuH9mG+0e Lnfusy3wg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG75Q-0001qS-95; Wed, 09 Sep 2020 20:53:00 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kG75L-0001ov-OL for linux-arm-kernel@lists.infradead.org; Wed, 09 Sep 2020 20:52:58 +0000 Received: by mail-pg1-x542.google.com with SMTP id 67so2926996pgd.12 for ; Wed, 09 Sep 2020 13:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=PtXzKIm23zRtpuuZ6ilAcjx2516RE2gxhsCv7WC6GB4=; b=aYA2xAElEsVNsIm8zIjfEUq1XOOrrHdFmq3Npts8cQkZZmm1R4FWaqkHUlt3OUzc5V 1UAJLfVo+X8HW6b3oKeJdd2ojpERZ30EVy5lNuJXEIm5fOIog6B3ntH9Xr/OvKxbCSKw xFHYAYbjy3X80U2DAtVaA46kkwoiyFABj0AyRtChOsp0cMPbR/rIj1KPFIO0jaJNRAhi tAPaUi4Dv3nr+JRwnFqqGUDbKGkPr/lG6gXnT04apN5PFuczpdELUiP1BHxM6+I29mDs aECOsRo+sAipniUvwvyr5nBUTqbiSDs1fuh6ISK4+7lz8UwkAl9agBNZjMGQ/dfzT0RR nSwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=PtXzKIm23zRtpuuZ6ilAcjx2516RE2gxhsCv7WC6GB4=; b=sRmWeBqx2SJTFZbPEaQQBrMJOblMF03usj4ALB7yKBrq39yG3WGFpf007UDBDB18bz QyALVUU6IPH0NteP1QzuLMZPNtZQZIr8+o/7Ng7ZFBEDpPdQIbQEuPA+FCI2RHiWWgc0 aQj0Q/xwYSF/KUrh2YObTjctSlfwRp559hEbvRIHSy4mkcU7OziVglCZZ7HtvJLQk9JX 6tq19X/iVtAKLHZrWIj54/IuVUhkdwslJMwMAxWPtu+eiUw0fg0FTC9YdCW3d7waI7PX fyZHL5XYquwW/xY7MYmkbtCOdAIcrUW8Jux/mzWqvgyDbRl2V4hbRGJzzUILZpVGu+VV sHUQ== X-Gm-Message-State: AOAM533MNfFLrk0aHJsz2i5gDzO5FnLjY1b0vdZYh5ZncNhjr6KJ8dfl ftcf4osF2kydltFV/XavCt0Waw== X-Google-Smtp-Source: ABdhPJxIkM60LhoRwBkumw7TyEYGP8+pANRD/tXAlO+U7HJ6Qa12lLibyeMtceMdRqNBoeXnlPTjXw== X-Received: by 2002:a62:3641:: with SMTP id d62mr2315115pfa.82.1599684773346; Wed, 09 Sep 2020 13:52:53 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id j19sm3576058pfi.51.2020.09.09.13.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 13:52:52 -0700 (PDT) Date: Wed, 09 Sep 2020 13:52:52 -0700 (PDT) X-Google-Original-Date: Wed, 09 Sep 2020 13:52:50 PDT (-0700) Subject: Re: [PATCH RFC/RFT 0/3] efi/libstub: arm32: Remove dependency on dram_base In-Reply-To: <20200909151623.16153-1-ardb@kernel.org> From: Palmer Dabbelt To: ardb@kernel.org Message-ID: Mime-Version: 1.0 (MHng) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200909_165255_930116_F8A7BB7D X-CRM114-Status: GOOD ( 23.11 ) 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: etienne.carriere@st.com, francois.ozog@linaro.org, maxim.uvarov@linaro.org, Grant.Likely@arm.com, takahiro.akashi@linaro.org, r.czerwinski@pengutronix.de, xypron.glpk@gmx.de, ilias.apalodimas@linaro.org, patrice.chotard@st.com, patrick.delaunay@st.com, jens.wiklander@linaro.org, Atish Patra , linux-efi@vger.kernel.org, christophe.priouzeau@linaro.org, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, sumit.garg@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 09 Sep 2020 08:16:20 PDT (-0700), ardb@kernel.org wrote: > 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. Looks like we're using dram_base to derive two argumets to efi_relocate_kernel(): the preferred load address and the minimum load address. I don't see any reason why we can't use the same PAGE_OFFSET-like logic that x86 uses for the minimum load address, but I don't think we have any mechanism like "struct boot_params" so we'd need to come up with something. > 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(-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel