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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 BAE95C433EF for ; Thu, 9 Sep 2021 08:59:14 +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 3F98B61051 for ; Thu, 9 Sep 2021 08:59:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3F98B61051 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 E26AD832C4; Thu, 9 Sep 2021 10:58:29 +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="iq20pPSb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E889D83116; Thu, 9 Sep 2021 10:57:55 +0200 (CEST) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 8AF9F83246 for ; Thu, 9 Sep 2021 10:57:41 +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@google.com Received: by mail-wr1-x431.google.com with SMTP id n5so1410017wro.12 for ; Thu, 09 Sep 2021 01:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iZkgEwCH5KdnCP+KKKjKSIOG2IVsWQGqiuH2i1fF+LE=; b=iq20pPSbLNbBfmakhXKPTthxQh2328mJmxVTH2abhoywpSL33npRLlXCb1w+xdWdt0 sMVyLIAaf6hiiHXBE0bwT1gPMmutOG70EaP18uziYcnVfuIk533HmqBXzzXHFhHWmzMk a4Od4aPZtn1dlfMXYpOpK8Kwx74Ugl4hkeg68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iZkgEwCH5KdnCP+KKKjKSIOG2IVsWQGqiuH2i1fF+LE=; b=4C0rwO69zGIQP/NPw7BCO9I3dCQZ5JfWS4f8w3i1oss1LF/OGWHz0eqehzNnfuAvCW B7ZBcYQsVwWap8+ozddwZEvNAzgVsYdqcHR4m3yB23JVNmFW/hAaGuenh7eM17p/ysX7 QWPO4gR8lQ4OWHKPVx5t/bh12MMdXGSzu4MrSi/IdUVCMOLyrtePdNLJA8gNym47Z2Rr Mj9D22AxLEymMESx3ow9yU/bTv1FnjDwM+inuddO+RB8Kg/rMedEUEso036YAtKSxmUe 7ZXLGdNIkgAGLjo4QfR+mX/sv2a+eeQhjtCFV0FfGQLNHg/OZ9p5AXot9UXHOOWnX/9k xCQg== X-Gm-Message-State: AOAM530BuXujQBMqg8dfGzbz7bwO2WZQIw/Bsxui7Xuz28mufpGfN+2k CGCQQOE3rJhErVyOg4A8NO2uaKT2k1oHKWYT7W70yQ== X-Google-Smtp-Source: ABdhPJzOKdN74HN22wibJyITge7VBRV+WGofgoJ7369LrR5uDU4NuyN8evAfYnrX7iE0GUHBiTQMB8KOOr81wyafyj0= X-Received: by 2002:a05:6000:92:: with SMTP id m18mr2166723wrx.293.1631177860591; Thu, 09 Sep 2021 01:57:40 -0700 (PDT) MIME-Version: 1.0 References: <20210908133405.696481-1-sjg@chromium.org> <20210908133405.696481-9-sjg@chromium.org> <2d41cecd-a8e9-51d9-6dbc-ac0edf8f1eb4@gmx.de> In-Reply-To: <2d41cecd-a8e9-51d9-6dbc-ac0edf8f1eb4@gmx.de> From: Simon Glass Date: Thu, 9 Sep 2021 02:57:28 -0600 Message-ID: Subject: Re: [PATCH 24/35] x86: Allow booting a kernel from the EFI app To: Heinrich Schuchardt Cc: Ilias Apalodimas , Bin Meng , Tom Rini , Christian Melki , U-Boot Mailing List Content-Type: text/plain; charset="UTF-8" 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 Hi Heinrich, On Wed, 8 Sept 2021 at 12:22, Heinrich Schuchardt wrote: > > > > On 9/8/21 3:33 PM, Simon Glass wrote: > > 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 > > --- > > > > arch/x86/lib/bootm.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c > > index 733dd712570..ff0e9f6a085 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. > > Did you test launching an EFI application with EFI_LOADER from the EFI > app? If you get it working, please provide a defconfig and a testcase > that runs helloworld.efi. No unfortunately that cannot be built at present. This is just for kernels that don't use EFI_LOADER. I am pretty sure it could be made to work, perhaps by passing the original UEFI system table through to the kernel. Regards, Simon