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 58966C001DF for ; Thu, 3 Aug 2023 21:47:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51C5B86CDB; Thu, 3 Aug 2023 23:47:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="OrsT0adf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 980FA866BD; Thu, 3 Aug 2023 23:46:59 +0200 (CEST) Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) (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 5285886CD5 for ; Thu, 3 Aug 2023 23:46:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-583f99641adso16237557b3.2 for ; Thu, 03 Aug 2023 14:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1691099216; x=1691704016; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5CxAOldVzrFmEQU17vmgCmOIIMIWn/wb7vWUpUxYVgM=; b=OrsT0adf6GxLmNy4K9Zv+5yiCq+wKqo2+o6zPgM6eOzzsdodHABPQyc65zgsCFshGb 5/yI4n/lGEGdXZX9UO+Ya2SnDGUisRi84+Jj9xQyYJEsjPjkrSsoyc8f23foM8MhuFkC CxWyvne2gO8a95RnALoICPCkLT5H3OdRXLW/o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691099216; x=1691704016; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5CxAOldVzrFmEQU17vmgCmOIIMIWn/wb7vWUpUxYVgM=; b=OUKjFLLAnf2F25e6neFzRVSI2V2IhjgVGSoo6L6H2Cos4BNLkClJ0PCIjztJn64SvB uetZItMX9aAYtYQjSAl2kN2YpyPw135xzkTA6im511aLBHSSSNdpnH5nnJcFNO1QO5DK xbAFqu5lOkSs5Q8st83Hi+oGaq9QwCBAlx4S85czdX73NCbIGiJP5oMWlAs6JAjhDLFQ FXem5mRMsdsgKhbyLM7hVMb3Lkim/2m/En0t+9tdfokSzpiTXmAld/TuSe5FdfJ+ksuD dp6Fc/0d8EH55+UqHhdqvioEnjfu6wLsgdDlslOsbAQMDk8kIaw0kbY9JFXeekE28Dos D9qw== X-Gm-Message-State: ABy/qLaVTOZ1kLOdRtyQZnBKpRWquj1Zo1ZwEVXRls4HqzZDU5hIFlPf It4dSejOT45AlpOzlqlBZs587QNo2sp7jI3c0YTTwA== X-Google-Smtp-Source: APBJJlHhADXjGtgLSUknogOjuNcx/EG8hH1t5qayUoHycEZFY5M56L8atJC7+JCO3K64jbH1ndjmyg== X-Received: by 2002:a0d:db14:0:b0:583:e92c:e3a8 with SMTP id d20-20020a0ddb14000000b00583e92ce3a8mr19341547ywe.42.1691099215993; Thu, 03 Aug 2023 14:46:55 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-68ac-3ac0-af0b-6541.res6.spectrum.com. [2603:6081:7b00:6400:68ac:3ac0:af0b:6541]) by smtp.gmail.com with ESMTPSA id x21-20020a81a015000000b00579e8c7e478sm255422ywg.43.2023.08.03.14.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 14:46:55 -0700 (PDT) Date: Thu, 3 Aug 2023 17:46:54 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Da Xue , Vincent =?iso-8859-1?Q?Stehl=E9?= Subject: Re: [PATCH 3/5] bootstd: Avoid allocating memory for the EFI file Message-ID: <20230803214654.GI3630934@bill-the-cat> References: <20230727030128.459760-1-sjg@chromium.org> <20230727030128.459760-4-sjg@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9wvZtVwQZsI/+TlK" Content-Disposition: inline In-Reply-To: <20230727030128.459760-4-sjg@chromium.org> X-Clacks-Overhead: GNU Terry Pratchett 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.8 at phobos.denx.de X-Virus-Status: Clean --9wvZtVwQZsI/+TlK Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 26, 2023 at 09:01:23PM -0600, Simon Glass wrote: > The current bootflow-iteration algorithm reads the bootflow file into > an allocated memory buffer so it can be examined. This works well in > most cases. >=20 > However, while the common case is that the first bootflow is immediately > booted, it is also possible just to scan for available bootflows, perhaps > selecting one to boot later. >=20 > Even with the common case, EFI bootflows can be quite large. It doesn't > make sense to read it into an allocated buffer when we have kernel_addr_t > providing a suitable address for it. Even if we do have plenty of malloc() > space available, it is a violation of U-Boot's lazy-init principle to > read the bootflow before it is needed. >=20 > So overall it seems better to make a change. >=20 > Adjust the logic to read just the size of the EFI file at first. Later, > when the bootflow is booted, read the rest of the file into the designated > kernel buffer. >=20 > Signed-off-by: Simon Glass > Reported-by: Da Xue > Reported-by: Vincent Stehl=E9 Applied to u-boot/master, thanks! --=20 Tom --9wvZtVwQZsI/+TlK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTMIE0ACgkQFHw5/5Y0 tyx54gwAhSw2WWOchRDsSYJwqlC4T3db2wlDt0GAGVz5PLpJKTal+o14DfRt0JsN 8974BTDESYou4vqK4g+dtT7feJSM3adaD6osE24e2TJX5dvOXQsGcg+ekkD7UVi8 zdvWkO5+qgvidTps69F6Lkh5lz1NRQKYCGUNg7tzrRvszYTplWpCvrJpqao+FAuC HE3flYr0iIu90wGP0o3a3nVRKOSWc8ge+WhWw1azJHIeKpg20PWo1/DONdoW3Rv0 nAecSLDCOQ4DitCtDNxRqtmeyc7tqHLqQ4Y8XG6m2HCAe0Px9/Ma8k7m/jRGtL67 BdqixJqAEEiolcKsOOqTic+3B1ph81nRg/HP5s9I/ZhoGUbiLTVhAfzqEvlNz2lR fO+symRhAWBuVSpJ1TT5Tb8c/c1cooWRH0BXI56Q/r14zl/BCXMwnMnw7s9BVQJm lie8RXgs1BDj61yHCh85N1hHhsckdF70Ai/vgNGWTvBdZlBa467sZCV21OHYjiyP wV5tZ+6Y =h5LE -----END PGP SIGNATURE----- --9wvZtVwQZsI/+TlK--