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 414D5C433F5 for ; Thu, 21 Apr 2022 13:14:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E5B2883A95; Thu, 21 Apr 2022 15:13: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=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="GreMinY2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2C5B83AD0; Thu, 21 Apr 2022 15:13:55 +0200 (CEST) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 0A44983894 for ; Thu, 21 Apr 2022 15:13:53 +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-x831.google.com with SMTP id ay11so3182508qtb.4 for ; Thu, 21 Apr 2022 06:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wIlsvrQxMTkbrCxAP8RO4flxcodTSqLbgmggPvAHI3g=; b=GreMinY2jCKl6nnpRbyBDq2QnBsKGoxR5WYlHeT2yOiKq3BVqeKTz9yae0kqOs41qj BrxwWnS3panZfJDo4SYbfi8pQ1WX9ynMBrL9cZ3H6vatc6wNgY7fwyeVxtJIrtsBw2ZS AEvmq8mV2WE5eY+uR7tAd2e6PFAk34wi34x2o= 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wIlsvrQxMTkbrCxAP8RO4flxcodTSqLbgmggPvAHI3g=; b=b/jvhOjiuV2CttHIyww2vBqaGM0FmEjkC6F95cqG170guchj1blqUzJpCc4JcPM0xI U6jjVx725pQdrB6ERQaJ6ay/+2dd6Q3HtXZFBNr2i/Z3ubKnb1MzR0Er4NT9EmidSVVH wL2hmsM0IvJlbtiVaOBqgwu2lJ17VSjaCplCHZjwtzkeeJ18NMLUd88XSFFFnVxyhZXr EiOdWup085V2u6Z5k4cFPwwcxnFiSjRay4R1W3WvS8zVYY/tX/nnInxhAWTpvIpEmMyV 9+UpT7xZW6Y7f0qXnosFY1b7d1vPQyl+gUXHRqe8pK4ci88uXp0XA7RV2thDHAqyBx4v rWgQ== X-Gm-Message-State: AOAM531cz80+YJwLoubf1OqL2bXRelwQraX1Bbb0ByubWxyQHlx0KQxb G/JKzJmMo2LLvRiGYqSnvA/PRQ== X-Google-Smtp-Source: ABdhPJxNGOHRfO4kTQF2qINZ6Lh7u7jAdRvyUnI/3ze9PWqkNIIcaTd+BE/sEFWok9AN0A/HqwW6JQ== X-Received: by 2002:ac8:58c9:0:b0:2f2:67d:9a87 with SMTP id u9-20020ac858c9000000b002f2067d9a87mr10678175qta.407.1650546831733; Thu, 21 Apr 2022 06:13:51 -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 c22-20020a05620a201600b0069e8e5f1c84sm2785557qka.35.2022.04.21.06.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 06:13:50 -0700 (PDT) Date: Thu, 21 Apr 2022 09:13:49 -0400 From: Tom Rini To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, sjg@chromium.org Subject: Re: [PATCH 5/7] efi_loader: PARTITION_UUIDS should be optional Message-ID: <20220421131349.GZ3045430@bill-the-cat> References: <20220419010158.47034-1-takahiro.akashi@linaro.org> <20220419010158.47034-6-takahiro.akashi@linaro.org> <20220421004011.GB7584@laputa> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c8bPn4FL4u+7TADa" Content-Disposition: inline In-Reply-To: <20220421004011.GB7584@laputa> 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 --c8bPn4FL4u+7TADa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 21, 2022 at 09:57:50AM +0900, AKASHI Takahiro wrote: > On Wed, Apr 20, 2022 at 09:37:39AM +0200, Heinrich Schuchardt wrote: > > On 4/19/22 03:01, AKASHI Takahiro wrote: > > > In the current implementation, partition table support (either GPT or= DOS) > > > is not mandatory. So CONFIG_PARTITION_UUIDS should not be enabled > > > (selected) unconditionally. > > >=20 > > > Fixes: commit 17f8cda505e3 ("efi_loader: set partition GUID in device= path for SIG_TYPE_GUID") > > > Signed-off-by: AKASHI Takahiro > > > --- > > > lib/efi_loader/Kconfig | 2 +- > > > lib/efi_loader/efi_device_path.c | 11 ++++++++++- > > > 2 files changed, 11 insertions(+), 2 deletions(-) > > >=20 > > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig > > > index d50cd2563d3d..bc518d7a413b 100644 > > > --- a/lib/efi_loader/Kconfig > > > +++ b/lib/efi_loader/Kconfig > > > @@ -15,7 +15,7 @@ config EFI_LOADER > > > depends on !EFI_APP > > > default y if !ARM || SYS_CPU =3D armv7 || SYS_CPU =3D armv8 > > > select LIB_UUID > > > - select PARTITION_UUIDS > > > + imply PARTITION_UUIDS > > > select HAVE_BLOCK_DEVICE > > > select REGEX > > > imply FAT > > > diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_de= vice_path.c > > > index 0542aaae16c7..01fb53ae8c40 100644 > > > --- a/lib/efi_loader/efi_device_path.c > > > +++ b/lib/efi_loader/efi_device_path.c > > > @@ -864,11 +864,20 @@ static void *dp_part_node(void *buf, struct blk= _desc *desc, int part) > > > break; > > > case SIG_TYPE_GUID: > >=20 > > This can only be reached for CONFIG_EFI_PARTITION=3Dy. >=20 > I know, but the code won't be exercised anyway if !CONFIG_EFI_PARTITION. >=20 > > > hddp->signature_type =3D 2; > > > +#if CONFIG_IS_ENABLED(PARTITION_UUIDS) > > > + /* info.uuid exists only with PARTITION_UUIDS */ > > > if (uuid_str_to_bin(info.uuid, > > > - hddp->partition_signature, 1)) > > > + hddp->partition_signature, 1)) { > >=20 > > uuid_guid_get_bin() does not write any byte if info.uuid is not valid. >=20 > What matters here is that "uuid" in struct disk_partition is defined > only if CONFIG_PARTITION_UUIDS. >=20 > > > log_warning( > > > "Partition no. %d: invalid guid: %s\n", > > > part, info.uuid); > >=20 > > > + memset(hddp->partition_signature, 0, > > > + sizeof(hddp->partition_signature)); > >=20 > > dp_alloc() already has zeroed out the memory. Please, remove the > > superfluous code. > >=20 > > > + } > > > +#else > > > + memset(hddp->partition_signature, 0, > > > + sizeof(hddp->partition_signature)); > >=20 > > ditto. > >=20 > >=20 > > This does not conform to the UEFI specification. Why should we support = it? >=20 > As I said in my previous comment at patch#6, > CONFIG_EFI_PARTITION can be seen optional under the current implementatio= n. >=20 > >=20 > > Shouldn't we select CONFIG_PARTITION_UUIDS if CONFIG_EFI_LOADER=3Dy and > > CONFIG_EFI_PARTITION=3Dy. >=20 > Unfortunately some platforms enable (in other words, "select") PARTITION_= UUIDS > unconditionally even without explicitly enabling EFI_LOADER or EFI_PARTIT= ION. I wouldn't assume that they're correct in doing so and it might have been how some other problem was addressed at the time to fix incorrect / not yet implemented in Kconfig at the time dependencies. --=20 Tom --c8bPn4FL4u+7TADa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmJhWIYACgkQFHw5/5Y0 tywaqQv/eL/ipghQoj8rUvjHeDAKZKV0+HRzMBO6A7trEkbC7fNSsEY9nuIjg7RA mVoI0VwPKIlemZO5u7meDSU8T82UCWwiP2FoAJL2DyJdkqGgCal7f/5tMF8CrTFd D6kCajpD6JLe0MeDHCGCpb91uULDMvDASwewICJHaCxN8C0a95CLk9TPPEdZOuzL FVqtUv5y2wL2JbeFFcX3yv4bpRVAm4pHpeoz20T4j80j40fKLsHhd0d8OrDDklJt ox2IyeE+7ilkAoW+ti+kCrt600QyFgApeVycP8DomG/fwYyzHV9IsHlQUyOyLEfX aiMOFVy8d9CffrajwjnZ33xIHxb6D3HRT9NPSV1ps/pKa6zcS2z8VneE8hnPj7tC ldKup6mhCAdrp0i8JpesQTLtVGCLfZV2DKLqjHxJAPEeQRqlIj8QTgnvoCmhKS+Y dyukiwWQkehopIzjdqWTnMjjf41bxARxje/BP+l3IAVqruq6p6iXBZjrKIc0Dl3i oJ4tiwzT =eS2U -----END PGP SIGNATURE----- --c8bPn4FL4u+7TADa--