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 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 50449C433F5 for ; Sat, 4 Dec 2021 15:57:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 85E91830CF; Sat, 4 Dec 2021 16:57:35 +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="kO2Z0w/Q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B205C830BA; Sat, 4 Dec 2021 16:57:26 +0100 (CET) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (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 ED94E82FAF for ; Sat, 4 Dec 2021 16:57:19 +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-x330.google.com with SMTP id a23-20020a9d4717000000b0056c15d6d0caso7585001otf.12 for ; Sat, 04 Dec 2021 07:57:19 -0800 (PST) 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=feqBhel/n31VBCitu9V1wqOg7pJIRk9P5buB2aX9LLo=; b=kO2Z0w/Qss23zCx2F42AoYeigys59gMqJ6YWhMNXLL+VPgFpwzqsAVx2Dm79Yl1oR9 9Gly2JlCi9GPviAoZvgulW0Y+IKXb3HoPWhBWnRq5PxLWLUhxJ/ScI7si7mRQWvzSxF+ o0BAa910l4Tuqnc82enAK+1/tVwvrN+IszcPs= 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=feqBhel/n31VBCitu9V1wqOg7pJIRk9P5buB2aX9LLo=; b=IuWd554l8HsXhm3L6X5BvyoQp0mgX0J9McozyRh5p9RFbpqxwrVF1+3JxYNzubygwN B4r1BtiK1KV8QNmEwLews4bbcAnrADkF5/qthYn7iaetBo1SMZWeDOAuwjI8Uwvjuix5 Vy9fDGbnr3EhwiP9iIlp8qn9wo00h4HHCzVBLSDoSWPUOrbwf0VKDxOCPxeEbpoBMTUa n1x8jGiPFA3DaCP1ikWJR8JkRcZJPcGyABcq6bLlITLWbm3WSoA43EhfGveJPN8Ff5XX Ji51txTDhthv9pMAyR0Cn7POrwmdK1LxC/aw3KZV0DHGEHSsLkweQYuhkRjtcTUDdquo vhrQ== X-Gm-Message-State: AOAM53275jaCmPQGPBNy6SUa2iO3xwpFJ1ncZAUukKRZVgoqrtzi8k4b pZ5SbbiFtcZvU4BCNI7lo0y4Sc9qcmr8jg== X-Google-Smtp-Source: ABdhPJxjoWt3UUZisp3Se0jK3lX4hqcQ4cE/6bPL21Z132dH1rthcnF1RZ8vGXTSAR9F8DYR3Sl42A== X-Received: by 2002:a05:6830:3195:: with SMTP id p21mr21022834ots.56.1638633438384; Sat, 04 Dec 2021 07:57:18 -0800 (PST) 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 a12sm1230513otk.35.2021.12.04.07.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 07:57:18 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Ilias Apalodimas , Christian Melki , Bin Meng , Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH v5 07/28] x86: Allow booting a kernel from the EFI app Date: Sat, 4 Dec 2021 08:56:36 -0700 Message-Id: <20211204155657.2913911-4-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog In-Reply-To: <20211204155657.2913911-1-sjg@chromium.org> References: <20211204155657.2913911-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.1.400.ga245620fadb-goog