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 A5800C433EF for ; Thu, 4 Nov 2021 03:16:30 +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 3078660F56 for ; Thu, 4 Nov 2021 03:16:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3078660F56 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 C281C83669; Thu, 4 Nov 2021 04:16:22 +0100 (CET) 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="gELBwJpT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A87E08365E; Thu, 4 Nov 2021 04:10:27 +0100 (CET) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 27DDA83657 for ; Thu, 4 Nov 2021 04:10:05 +0100 (CET) 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-ot1-x329.google.com with SMTP id l7-20020a0568302b0700b0055ae988dcc8so3208385otv.12 for ; Wed, 03 Nov 2021 20:10:05 -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=9lOV+kv6Zq++R1fdRyrWhEjIyGk6gBLj9QVrE0z+jac=; b=gELBwJpTuTBwAuXfrSiz07zWe5BPFFZdZ0xzKmhRdOQMH/xH56xaU4JARSyuz/0kjV pMGxDNjJobFET7EySQEDZ/6IosU7vFeblgvE/nOBjMzqB/v30UBmLxpv193v8K6TiDb2 GixgG8LwmoZaCC5wmAPFxOUywbrayTyzAblrI= 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=9lOV+kv6Zq++R1fdRyrWhEjIyGk6gBLj9QVrE0z+jac=; b=VQTU0TZrNYZT56Y29+JFoOHfuOjFrnuyJhrx1H7nJF00IaIF0lWtA3UgJovZqnlJcj 9RSqcDxOWH455NJpkVizHNl1eSlhvlVckcqnYSOxElPKWl+9KqbY/OIN6KRwO4zuQRZs xHgrjku6uolPmv5HjsQQ7HaXy/PmLrWX4pBK+mFXZbAWZkrCpIrjj6gg1ZHfJZNyuE/L YguIVBOeUi92lbVyBboKoGf8T39Se1iE7UIQXCLKzXfdGmve+2yTNZMNvUA0X/LnmC9F mwnTdBai4PylgWCVtGhra3n1vX4hxkercg8mCoP4lJsQDhhok709hXZj9khgdj8Vy7sz Bvlw== X-Gm-Message-State: AOAM531s/buO1Z7/HjudNC5723wD71ldl5e8ex4yWVwbpNg6y3NK+W/8 uHBPjtYZ+DC18IGfqKPODhf3lv/NVmSu6Q== X-Google-Smtp-Source: ABdhPJwhLk0Tor/E01y/zt+EgiMX2qh2dmWv4EmfZ4WGqIx4jEqw2cahXQ8WYq+wQtqRrw5JhYvvFw== X-Received: by 2002:a9d:19c1:: with SMTP id k59mr35840248otk.348.1635995403895; Wed, 03 Nov 2021 20:10:03 -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 j25sm1050197oos.23.2021.11.03.20.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Nov 2021 20:10:03 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Tom Rini , Christian Melki , Heinrich Schuchardt , Bin Meng , Simon Glass Subject: [PATCH v4 19/34] x86: Allow booting a kernel from the EFI app Date: Wed, 3 Nov 2021 21:09:21 -0600 Message-Id: <20211104030936.2446706-9-sjg@chromium.org> X-Mailer: git-send-email 2.34.0.rc0.344.g81b53c2807-goog In-Reply-To: <20211104030936.2446706-1-sjg@chromium.org> References: <20211104030936.2446706-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 8f81b799072..acad6397e81 100644 --- a/doc/develop/uefi/u-boot_on_efi.rst +++ b/doc/develop/uefi/u-boot_on_efi.rst @@ -269,7 +269,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.34.0.rc0.344.g81b53c2807-goog