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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8037AC433F5 for ; Sun, 27 Feb 2022 14:13:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4860383B49; Sun, 27 Feb 2022 15:13:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=csgraf.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2849C83BB3; Sun, 27 Feb 2022 15:13:17 +0100 (CET) Received: from zulu616.server4you.de (mail.csgraf.de [85.25.223.15]) by phobos.denx.de (Postfix) with ESMTP id 3B0EA83A6B for ; Sun, 27 Feb 2022 15:13:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=csgraf.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=agraf@csgraf.de Received: from [192.168.106.118] (dynamic-095-118-033-200.95.118.pool.telefonica.de [95.118.33.200]) by csgraf.de (Postfix) with ESMTPSA id B6F6360805FC; Sun, 27 Feb 2022 15:13:13 +0100 (CET) Message-ID: <4cb0752e-3fad-cdf3-98b6-4fd42917de41@csgraf.de> Date: Sun, 27 Feb 2022 15:13:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] efi_loader: Ignore DT when ACPI is on Content-Language: en-US To: Mark Kettenis Cc: u-boot@lists.denx.de, xypron.glpk@gmx.de References: <20220227121856.34995-1-agraf@csgraf.de> From: Alexander Graf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 27.02.22 14:07, Mark Kettenis wrote: >> From: Alexander Graf >> Date: Sun, 27 Feb 2022 13:18:56 +0100 >> >> For targets that enable ACPI, we should not pass Device Trees into >> the payload. However, our distro boot logic always passes the builtin >> DT as an argument. >> >> To make it easy to use ACPI with distro boot, let's just ignore the DT >> argument to bootefi when ACPI is enabled. That way, we can successfully >> distro boot payloads on ACPI enabled targets. > I've never understood why it is bad to provide both the DT and ACPI > tables. Several TianoCore EDK2 based firmwares do this or at least > give you the option to do this. And it works fine. If both are > provided, you just leave it up to the OS to decide what it wants to > use. Which makes me think the text was put there in the standard by > people with an agenda... It's much more profane :). Upstream Linux went with "DT first, ACPI last" while RHEL had a downstream patch that went "ACPI first, DT last". And then people were confused why RHEL and upstream kernels had such vastly different behavior on their systems. Long story short, the best way to avoid this ambiguity is to only provide one of the 2 to the OS. And that's what the BBRs dictate now. They don't dictate what firmware does internally though, so we're free to do whatever we like - and I think "if someone went through the effort to enable ACPI on this system, they probably want to use it" is a fair assumption with U-Boot. So we should prefer ACPI if available. Alex > > I think it would be good for U-Boot to give users a choice here, with > all possible combinations (only DT, only ACPI, both DT and ACPI). But > this is a step in the right direction. > > Reviewed-by: Mark Kettenis > >> Signed-off-by: Alexander Graf >> --- >> cmd/bootefi.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/cmd/bootefi.c b/cmd/bootefi.c >> index 94d18ca73f..2c9bc0dcd2 100644 >> --- a/cmd/bootefi.c >> +++ b/cmd/bootefi.c >> @@ -265,8 +265,8 @@ efi_status_t efi_install_fdt(void *fdt) >> */ >> #if CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE) >> if (fdt) { >> - log_err("ERROR: can't have ACPI table and device tree.\n"); >> - return EFI_LOAD_ERROR; >> + log_warning("WARNING: Can't have ACPI table and device tree - ignoring DT.\n"); >> + return EFI_SUCCESS; >> } >> #else >> bootm_headers_t img = { 0 }; >> -- >> 2.32.0 >> >>