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 971BAC433F5 for ; Wed, 20 Apr 2022 07:37:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BA08083C01; Wed, 20 Apr 2022 09:37:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.net header.i=@gmx.net header.b="QjCyJ1u0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5935183C1E; Wed, 20 Apr 2022 09:37:53 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 502DA83BF4 for ; Wed, 20 Apr 2022 09:37:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1650440269; bh=BlZEez+0okH7AkY49QNW2u0TA14C5igPNlcB+dE13LA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=QjCyJ1u04j2FfIOydfQ7WJMwAdhH1XTQy19mGeAbI+6doaMUzZDxscH8LD3jLNUIU LoGT/SXxDYsR8PFYbxdaOhISM+E0svBC+4/tMh6uGNIlbh6CF/21ht7xZtcsyIqiPj ttfM74GR0H14nYeJX4tCvCjy/v0Dr5d/2d2FwxAA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.67] ([88.152.144.107]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MCsU6-1npqLk3SNs-008qhS; Wed, 20 Apr 2022 09:37:48 +0200 Message-ID: Date: Wed, 20 Apr 2022 09:37:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 5/7] efi_loader: PARTITION_UUIDS should be optional Content-Language: en-US To: AKASHI Takahiro Cc: u-boot@lists.denx.de, trini@konsulko.com, sjg@chromium.org References: <20220419010158.47034-1-takahiro.akashi@linaro.org> <20220419010158.47034-6-takahiro.akashi@linaro.org> From: Heinrich Schuchardt In-Reply-To: <20220419010158.47034-6-takahiro.akashi@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zwuTsN6EqnjLkB0WB2QEPlbhFa0181JyFWxBEFRf3GEq9DJmOVu QHb/GtXagpPwhmjCO2aNoMKCPNCro5uZaZ0BP4+fXSkYaj447V/hHPxNwpnDYZm4OoKM81R I1ZbVu2DYip0ge7ZgyI9LPpde+mTrXcofvWZ1jzvfwgOfY2d8eB65gUSb5S1Ui42e02ljC4 Nw3bHUltJ4LzpX3wh/9hQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:mVxtYiyon4o=:HpZolWJCOOT1bzcx8Tat35 jzXLPLSMYGtzkE9NULhrSLdN04gWxtFd9jkkvhRBfAxs/ARMsMh7iWcB5z0F04euRklzm+fWP hOnPtYqf+lS87Hqr27jca+mSpNV3zXQJ/qwzwO7qMEz4ILhM+K2zzoTHL0sl1ab6dJ2GXpFU/ sL/TsovqU72zr5wxjp2OHv8WXg0hC7gMSAb/ximpno0plSYT/YVufoTXweD9oCN6jK3/fiNSc qFUeFDN8zsjjCQ+gGAQ7wO0xTm+TkbX0lraHE1jLdBV3QO14ymUPgmODvl/AzI0XIxje41i28 Htt2Z8cGzu6cqFepFRU+Vf1J6BUtiP6Nnp2DKHGCWthMfI32t8Le0P9lpfNNLkX/gAWdu5Y6M UT3B4Ox//QZgRUkeVR4RjZDNnBtmTq/4XBdQG5AtV6z+LHYP1vH5UTZoFKIHv6KL1CfGRrYBW IzXhgy4UYDZa/h1jIfqKwNI65ejAL/kFoQQJ5RJAjfWxBboJ2TPsYhdaIQsq+iXNHlxjR3wdc rA/o6NndNYUFkr+f0vlhDqHOVONzQ/gBHhivv9WSmauu/KN3jGipgRFhzPk62rOWT9K+y7Lpr L06eZ8cmx3MrZ+zLzLp3oRHT0WQyUq8tw0FzaxGpx0AE7iG49+CbMxshdKImDp9R2wRytJ5c5 waTwz1XGmmiur/NrSLlAMf1A2e3imqKrUi+n4S7sFYuE1c8lcxM9nfaqV87paMZ9wZcxgrGbQ ++Fw3yTTnPK02YgHh2vQlf7AJk7/Odks300eW0FxNFe08FlxXkO6kf6g1YwuYxWGfG6OzXpLd 5o8Cj1mbFoGbKuQpU+TogC9/OpOBV1HddiOdPOMmFkj4Zpy+W0pAfgW3JzhR83PLC6qS03MZU IMac9etkqroG/WDWaCsCgofgLXEOQ2RiJ3+OTrzwCeh3I9KbnixPGA8YIjQY8lh+FY+8K4oQf UrfqQrtV35QTfOXiidUixf3WQZgGNKd1JowxaYIl9fVf4t0aeCkr2zFnTACFlBDNoNrd4cXqM 70WkcGJS7woCGl3iGKcnG4XasErwaF71eJjPxy5jB8FBEnXqe5TlwcUaLSbsUckGR3XY0y54g XMQRaVMDkzLNbo= 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 On 4/19/22 03:01, AKASHI Takahiro wrote: > In the current implementation, partition table support (either GPT or DO= S) > is not mandatory. So CONFIG_PARTITION_UUIDS should not be enabled > (selected) unconditionally. > > Fixes: commit 17f8cda505e3 ("efi_loader: set partition GUID in device pa= th 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(-) > > 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_devic= e_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_de= sc *desc, int part) > break; > case SIG_TYPE_GUID: This can only be reached for CONFIG_EFI_PARTITION=3Dy. > 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)) { uuid_guid_get_bin() does not write any byte if info.uuid is not valid. > log_warning( > "Partition no. %d: invalid guid: %s\n", > part, info.uuid); > + memset(hddp->partition_signature, 0, > + sizeof(hddp->partition_signature)); dp_alloc() already has zeroed out the memory. Please, remove the superfluous code. > + } > +#else > + memset(hddp->partition_signature, 0, > + sizeof(hddp->partition_signature)); ditto. This does not conform to the UEFI specification. Why should we support it? Shouldn't we select CONFIG_PARTITION_UUIDS if CONFIG_EFI_LOADER=3Dy and CONFIG_EFI_PARTITION=3Dy. Best regards Heinrich > +#endif > break; > } >