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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3834C433EF for ; Tue, 26 Oct 2021 03:34:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4A92F60E74 for ; Tue, 26 Oct 2021 03:34:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4A92F60E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B53718357C; Tue, 26 Oct 2021 05:33:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XZSFbAzq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AF9B83598; Tue, 26 Oct 2021 05:31:40 +0200 (CEST) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 15A4E835A3 for ; Tue, 26 Oct 2021 05:31:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd31.google.com with SMTP id s20so4647418ioa.4 for ; Mon, 25 Oct 2021 20:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bgbIH+QNpED5qNhnP+K7NX36NdIKTIkPAC4K+ieEHBs=; b=XZSFbAzqMEP2rc8iV4wLoYkqwxPVuntyUSv2EV3hd8ZAPjDFF01BMLSlOyRZPYg4UM eNjrvVi2MIJ6gt4NMyzdWsQkvpPbEPGd/MifBuYmRjY/armCwQkncs/hGBGWVyaCwQyC RrRJs/HiudGJYevB5NStNVEGlKCP++d1MqZeQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bgbIH+QNpED5qNhnP+K7NX36NdIKTIkPAC4K+ieEHBs=; b=VS81TWeDh7dSSYOoLBXCPUdx4jLw0RfP07PNQSZDPRNX2m/yBav+NQPU6a1fXudwNt vDgXfc/wsonEz3XOfpiDPgnwk8cHrSvpkUtO7BzZs7hrE+8406+713YtozkykJkC0WLv PFmeSdb0G16Pjz1p5HTQWnfGLfe8zH/7QpeqDb3TA+oOVhbpxef08Q2q9a8KrmMd8zHV L+QFayJMvG3KWCAw2xxOkEBU9euhEAj3yChwF6sgSQm0Hv/dhzbr48VDK7Y+RvRVljoz HTquKVtdfLlrumBwimkkgJe1odH/wPN6tDVFVdB/JkJYX8OBrqQfGreposZZGsYqwQbQ O1LA== X-Gm-Message-State: AOAM530BRabjgp1M0xGSK2GpCLSEvcXY3wLOqyaGaTef0m63X0NInCym 9Il36s6BIXvKUxUgXbaJiJlFZpPK0vwNPA== X-Google-Smtp-Source: ABdhPJzuwP7ye0sd1iQfU/gifk9YV2Ry2iMnROj1au3+JA+UQpCrXiY0nJGN6HcImveP6gD2zx9WrQ== X-Received: by 2002:a6b:8ed1:: with SMTP id q200mr13326308iod.165.1635219084610; Mon, 25 Oct 2021 20:31:24 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id s10sm10127203ild.78.2021.10.25.20.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 20:31:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Christian Melki , Bin Meng , Tom Rini , Heinrich Schuchardt , Simon Glass Subject: [PATCH v3 20/35] x86: Allow booting a kernel from the EFI app Date: Mon, 25 Oct 2021 21:30:43 -0600 Message-Id: <20211026033058.430010-9-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026033058.430010-1-sjg@chromium.org> References: <20211026033058.430010-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean At present this is disabled, but it should work so long as the kernel does not need EFI services. Enable it and add a note about remaining work. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Update documentation arch/x86/lib/bootm.c | 11 +++++++---- doc/develop/uefi/u-boot_on_efi.rst | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c index 667e5e689e3..57cba5c65d3 100644 --- a/arch/x86/lib/bootm.c +++ b/arch/x86/lib/bootm.c @@ -179,10 +179,14 @@ int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit) * U-Boot is setting them up that way for itself in * arch/i386/cpu/cpu.c. * - * Note that we cannot currently boot a kernel while running as - * an EFI application. Please use the payload option for that. + * Note: this is incomplete for EFI kernels! + * + * This can boot a kernel while running as an EFI application, + * but if the kernel requires EFI support then that support needs + * to be enabled first (see EFI_LOADER). Also the EFI information + * must enabled with setup_efi_info(). See setup_zimage() for + * how this is done with the stub. */ -#ifndef CONFIG_EFI_APP __asm__ __volatile__ ( "movl $0, %%ebp\n" "cli\n" @@ -191,7 +195,6 @@ int boot_linux_kernel(ulong setup_base, ulong load_address, bool image_64bit) [boot_params] "S"(setup_base), "b"(0), "D"(0) ); -#endif } /* We can't get to here */ diff --git a/doc/develop/uefi/u-boot_on_efi.rst b/doc/develop/uefi/u-boot_on_efi.rst index f39be4a1ed9..7bd757ca645 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -267,7 +267,7 @@ This work could be extended in a number of ways: - Avoid turning off boot services in the stub. Instead allow U-Boot to make use of boot services in case it wants to. It is unclear what it might want - though. + though. It is better to use the app. Where is the code? ------------------ -- 2.33.0.1079.g6e70778dc9-goog