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 514C4C433EF for ; Mon, 28 Mar 2022 14:16:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1C1A583C05; Mon, 28 Mar 2022 16:16:04 +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="qv2aR/mV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF78583986; Mon, 28 Mar 2022 16:16:01 +0200 (CEST) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 EC7E083961 for ; Mon, 28 Mar 2022 16:15: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-qt1-x82b.google.com with SMTP id s11so12417425qtc.3 for ; Mon, 28 Mar 2022 07:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=y80z88i0R+Mr66D4DXTAWSt9euZss3PBAXXf3qHLAZU=; b=qv2aR/mV98FRpbVLT7BJNyO1ERkO1dcm9TiUkXvnUk47zX9dtMguiOGBtk28ShIVtd WmMWA8WtkeKFbIIx/ml5vtbyvxdZy+IWnwuFinPdRpvSxDJ0NvQGF104G8ir4nNoTrbS 38XhPNphi18+cLazQmjC7A5WxBlAH3ZKpWnoE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=y80z88i0R+Mr66D4DXTAWSt9euZss3PBAXXf3qHLAZU=; b=Ib6YXlCpB43J4PTSKK5V7jLy30LYjPx6H/VMjhdKOpK2ft6nYW5qJJFxcAwNNQ/GzC qDOmqpqSOA1eXyjzxPHQMVOmzMKjF0KZi9aujBXTdru8UssVqT7Yc7u1/Gl0HdGewjmE VXte3u6wxK6S1QDkBkMUUknmjsvf3e8kbAmFnLbxLuKABdKjczYiK1rJMInYaPSn28Pv Ebw4ObDzeCCM+W/07sS7uHGVYaWugnSuEHhNeSybW/ERt4Myv+BwBy+G6RMO9VhaUpZ8 V1hPgLx7l8anmhrLgR28q/lcnXW57Pt0vnFM4k5H9Qm1ax+q+bVXte4f0jzCKUqgbniY j8QQ== X-Gm-Message-State: AOAM530zT0S9aKSQDxE0iytuu1nYahAINch3omXFTl2/2LfAdJPqHoVt W5KL3bu0cpOecuGSbfdRCg1I6Q== X-Google-Smtp-Source: ABdhPJyjreDbOQsMTMKozaY9xu6fsTzzut20EfpDED8EB4Q/QX+J+s9m+d7bnpaeArm99oZpwd4XFw== X-Received: by 2002:a05:622a:191:b0:2e1:a2c8:b295 with SMTP id s17-20020a05622a019100b002e1a2c8b295mr21928727qtw.652.1648476956383; Mon, 28 Mar 2022 07:15:56 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id u11-20020a05622a14cb00b002e1fd9dce3dsm13059527qtx.60.2022.03.28.07.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 07:15:54 -0700 (PDT) Date: Mon, 28 Mar 2022 10:15:51 -0400 From: Tom Rini To: Simon Glass Cc: Heinrich Schuchardt , U-Boot Mailing List , Ilias Apalodimas , Pali =?iso-8859-1?Q?Roh=E1r?= , Mark Kettenis Subject: Re: [PATCH v2 7/9] Make EFI_LOADER depend on DM and OF_CONTROL Message-ID: <20220328141551.GT2284289@bill-the-cat> References: <20210726220735.GA8013@bill-the-cat> <5dba1547-37cc-14f0-1514-1dc337b0d25e@gmx.de> <20210728235513.GJ9379@bill-the-cat> <20210729135247.GO9379@bill-the-cat> <20210730213300.GE9379@bill-the-cat> <20210730220812.GF9379@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2qwbT0JTInWqknst" Content-Disposition: inline In-Reply-To: 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.5 at phobos.denx.de X-Virus-Status: Clean --2qwbT0JTInWqknst Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 28, 2022 at 12:35:09AM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Fri, 30 Jul 2021 at 16:08, Tom Rini wrote: > > > > On Fri, Jul 30, 2021 at 03:48:15PM -0600, Simon Glass wrote: > > > Hi Tom, > > > > > > On Fri, 30 Jul 2021 at 15:33, Tom Rini wrote: > > > > > > > > On Fri, Jul 30, 2021 at 01:02:18PM -0600, Simon Glass wrote: > > > > > Hi Tom, > > > > > > > > > > On Thu, 29 Jul 2021 at 07:52, Tom Rini wrote: > > > > > > > > > > > > On Wed, Jul 28, 2021 at 07:44:37PM -0600, Simon Glass wrote: > > > > > > > Hi, > > > > > > > > > > > > > > On Wed, 28 Jul 2021 at 17:55, Tom Rini w= rote: > > > > > > > > > > > > > > > > On Thu, Jul 29, 2021 at 01:45:49AM +0200, Heinrich Schuchar= dt wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > On 7/27/21 12:07 AM, Tom Rini wrote: > > > > > > > > > > On Fri, Jul 02, 2021 at 12:36:18PM -0600, Simon Glass w= rote: > > > > > > > > > > > > > > > > > > > > > This feature should never have been made available wh= en driver model > > > > > > > > > > > or devicetree are disabled. Add these as conditions, = so that we don't > > > > > > > > > > > create even more barriers to migration. > > > > > > > > > > > > > > > > > > > > > > Add a note about the substantial size increment assoc= iated with this > > > > > > > > > > > option. > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Simon Glass > > > > > > > > > > > --- > > > > > > > > > > > > > > > > > > > > > > Changes in v2: > > > > > > > > > > > - Split out new patch to make EFI_LOADER depend on DM= and OF_CONTROL > > > > > > > > > > > - Note the approximate size of this feature in the he= lp > > > > > > > > > > > > > > > > > > > > > > lib/efi_loader/Kconfig | 4 +++- > > > > > > > > > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > > > > > > > > > > > > > > > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/= Kconfig > > > > > > > > > > > index 6242caceb7f..466abfed300 100644 > > > > > > > > > > > --- a/lib/efi_loader/Kconfig > > > > > > > > > > > +++ b/lib/efi_loader/Kconfig > > > > > > > > > > > @@ -1,6 +1,6 @@ > > > > > > > > > > > config EFI_LOADER > > > > > > > > > > > bool "Support running UEFI applications" > > > > > > > > > > > - depends on OF_LIBFDT && ( \ > > > > > > > > > > > + depends on OF_LIBFDT && DM && OF_CONTROL && ( \ > > > > > > > > > > > > > > > > > > Didn't Tom eliminate all boards without CONFIG_DM? Should= n't we get rid > > > > > > > > > of this symbol? > > > > > > > > > > > > > > > > No, but I did send out a message about that today as we're = very close. > > > > > > > > Much closer than I had expected us to be. > > > > > > > > > > > > > > Note we will still have SPL_DM, I think. > > > > > > > > > > > > Right. > > > > > > > > > > > > > > > Are there boards using DM and not OF_CONTROL or OF_CONTRO= L and not DM? > > > > > > > > > > > > > > > > Yes, a few. It's vexpress_aemv8a_semi, warp (fixed by > > > > > > > > https://patchwork.ozlabs.org/project/uboot/patch/2021040218= 0552.1075997-2-pbrobinson@gmail.com/ > > > > > > > > so false positive), cm_t335, devkit8000, armadillo-800eva, = kzm9g and sniper. > > > > > > > > > > > > > > > > > Why are these separate symbols? Isn't this symbol to be e= liminated, too? > > > > > > > > > > > > > > > > Simon? > > > > > > > > > > > > > > If we do eliminate DM it will be in a separate series. Like T= om I am > > > > > > > pleasantly surprised at how close we are. > > > > > > > > > > > > > > But please let's consider patches on their merits. It is fine= to reply > > > > > > > with a wishlist but even better to reply with a follow-up pat= ch. > > > > > > > > > > > > OK. So, build-wise, EFI_LOADER does not require OF_CONTROL. > > > > > > > > > > I strongly believe it should (and it should have 5 years ago too)= =2E New > > > > > features should not be built on pre-migration stuff. > > > > > > > > Well, what legacy interfaces is it using? That's something to figu= re > > > > out and address as needed. > > > > > > It was built on non-DM and I believe it still has code for non-DM > > > (e.g. look for DM_MMC). Without DM, OF_CONTROL has no purpose IMO. > > > > > > Perhaps Heinrich has cleaned a lot of that old cruft out now? > > > > Now that DM_MMC and DM_VIDEO are mandatory, there is some cruft that can > > be removed, both there and probably tree-wide. But that's not the same > > as OF_CONTROL. Not all DM_xxx requires OF_CONTROL support. > > > > > > > > > Somewhat related, I think we need to create a separate symbol= which > > > > > > > means (OF_CONTROL && !OF_PLATDATA) so we can just check one t= hing. > > > > > > > > > > > > > > Also I think we should push of-platdata, since otherwise we'r= e going > > > > > > > to hit the same problem of migrating SPL boards to DM one day. > > > > > > > > > > > > Note that we don't have CONFIG_OF_PLATDATA just > > > > > > CONFIG_(SPL|TPL)_OF_PLATDATA. > > > > > > > > > > Indeed. But we haven't defined it because we don't want to permit= it. > > > > > It is just for constrained environments and we assume that U-Boot > > > > > proper has enough space (how else could it load Linux?) > > > > > > > > If OF_PLATDATA for U-Boot itself makes sense or not is a separate > > > > discussion to have. > > > > > > OK, I'd love to hear the reasoning on that one day. > > > > This might come up again real soon now in the context of nokia_rx51 and > > migrating away from the very old MUSB gadget driver and to modern > > DM_USB_GADGET. The platform is DM=3Dy and OF_CONTROL=3Dn and hard space > > constrained. >=20 > Oh I see. Well I don't believe it would be that hard to enable it, but > if it is just for one platform, is it worth it? I'm a little lost on context at this point again. We should be able to make EFI_LOADER depend on DM+OF_CONTROL as today nokia_rx51 does not enable EFI_LOADER. It's also behind on its USB migration, which is its own thread I should bring up again. > > > > > > > > > lib/efi_loader/efi_disk.c is the only place where we main= tain duplicate > > > > > > > > > code for DM and non-DM. A dependency on CONFIG_BLK (which= itself depends > > > > > > > > > on CONFIG_DM) would make more sense to me. But only in a = patch > > > > > > > > > eliminating the non-BLK code. > > > > > > > > > > > > > > > > I just know that off-hand, partition + disk + block has som= e corner > > > > > > > > case, but maybe that corner case is unintentional in terms = of usage > > > > > > > > today. > > > > > > > > > > > > > > > > > > > ARM && (SYS_CPU =3D arm1136 || \ > > > > > > > > > > > SYS_CPU =3D arm1176 || \ > > > > > > > > > > > SYS_CPU =3D armv7 || \ > > > > > > > > > > > @@ -25,6 +25,8 @@ config EFI_LOADER > > > > > > > > > > > will expose the UEFI API to a loaded appl= ication, enabling it to > > > > > > > > > > > reuse U-Boot's device drivers. > > > > > > > > > > > > > > > > > > > > > > + For ARM 32-bit, this adds about 90KB to the size = of U-Boot. > > > > > > > > > > > + > > > > > > > > > > > > > > > > > > There is no unit ISO prefix K. Do you mean KiB? > > > > > > > > > > > > > > > > > > 90 KiB may be the value today. Will you update it regular= ly? Otherwise > > > > > > > > > don't put a number here. > > > > > > > > > > > > > > > > > > I can't see that the effect on size is truly architecture= specific. Why > > > > > > > > > do you refer to 32bit ARM? > > > > > > > > > > > > > > > > > > Such a comment would better fit into a documentation chap= ter on > > > > > > > > > downsizing U-Boot. > > > > > > > > > > > > > > > > Yes, we should probably drop that specific note. > > > > > > > > > > > > > > From my POV I really like these notes in Kconfig. They appear= in a few > > > > > > > places and provide people with rough guidance. I'd like to se= e more of > > > > > > > them. I don't know how we can keep them up-to-date, although = I'd argue > > > > > > > that they should stay constant, if we are holding to our no-b= loat > > > > > > > ideal. > > > > > > > > > > > > I feel like EFI gets a bit of an undeserved reputation here. I= t's not > > > > > > growing any worse than the rest of the world is over fixes and = error > > > > > > correction (which is to say, 16/32/40 bytes here and there). A= nd > > > > > > there's not "big" new default features coming in. > > > > > > > > > > We can agree on the 'reputation' bit but I can't think of a more > > > > > deserving feature :-) > > > > > > > > > > I keep getting the capsule-update series in my inbox, for example= and > > > > > I know there is TPM stuff in the works. > > > > > > > > Yes, but TPM and capsule-update won't be default enabled for all > > > > platforms. I run every PR I get (and branch I make and merge) thro= ugh a > > > > before/after world build and use buildman's sizes tools to check (a= side, > > > > I'd love some csv output format for that, but I haven't gotten arou= nd to > > > > thinking on how to do that) and that's where I'm coming from on thi= s. I > > > > am keeping an eye out for default new features everywhere, and defa= ult > > > > new functionality everywhere. > > > > > > We could have buildman output some stats file as 'artifacts' in gitlab > > > perhaps, then have a script that picks them up and stores them > > > somewhere for analysis? > > > > My first thought would just be to somehow put the output of --show-sizes > > as a CSV so I could then figure out a way to filter out that I've seen > > for example simple_strtoul changed size on every platform. What else is > > there? Today I page through the output and am good, but not perfect, at > > spotting the outliers (for example, I had to tweak "Makefile: Move phy > > rules into drivers/phy" because a few platforms did not enable > > CONFIG_PHY before and those stood out from the rest of the size changes > > due to different optimization due to changed link order). Tooling > > around making that less error prone would be good. Perhaps outputting > > all functions and sizes and platform and full/spl/tpl to a csv or json > > would be the first step to being able to compare builds. >=20 > Sounds like something that could be added to buildman, yes. I'm not > sure if there are other people willing to take this on? I'm pretty sure you're the only person with a good working knowledge of buildman, so unfortunately not. --=20 Tom --2qwbT0JTInWqknst Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJBwxcACgkQFHw5/5Y0 tyx6Sgv/UH4nC7Jg7LdvUuUOhXUox1pN+WFqLDo0BfDzApV/Y9zTnHjkKoplf0EU d6gxnYrlN7BdRky1V5a/aLe1IWi/RUmlSBVvpXdFk1nh8MqlMPrf9Rp1OjjJfR0S WKlw7lFFeCMAQnjnrsopNmtn1ancxNAYb4OL3hQsMvr4cvOx5Yd6ux0Tjncdc0t8 M4mF+2g9ty4stQ/d8YVmIYKfJVG5qqkFPktC0Vl01Nz8adTBTwK2PLyrLsaUXgXr coThWJoyqT0JvjJ0lN+7HQdRRLux4W7BFNVuuS9yZFtSRKCIHIFZcZ+dBn7Jf9Aa lVarwQxHrNWw1AkCeLMt17vGM7sPwzBDFofRJPxK0H4oRbVwVikAiA/gWCLGIPEj dBSeP/q2rqOaOp7SVquD+T4q3IMUQ3zQf1LqRm86stC7VWZYAcnHkCJf7lk3FA1f eCeG0Jnn8mQUFRhG1KHpoGuxuE2A8cLs+ODTWiuTnEvKRr0noO24hhW2BrW8rmum A/Dle4CO =JJlp -----END PGP SIGNATURE----- --2qwbT0JTInWqknst--