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 3ECE4C433EF for ; Thu, 21 Apr 2022 00:58:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CBD7F83ECC; Thu, 21 Apr 2022 02:58:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="UeUH5cAy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EA5B83EC6; Thu, 21 Apr 2022 02:58:00 +0200 (CEST) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 3CBF283D73 for ; Thu, 21 Apr 2022 02:57:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x634.google.com with SMTP id j8so3332870pll.11 for ; Wed, 20 Apr 2022 17:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=CUq40RBcFWlSwGbY5RJDIyTMYxN80oLaIQ8ofaKawKU=; b=UeUH5cAyQk2ieOPjIL7Fil7yex0OySPuQcTKDWtqzRndhPc7KWpdViwlz4OgoSmB+6 gW+tkr0iAn1LUCXo8xwrIKZNCuCrFWrQ1a37XKJfYep5Z5zPAlzhP4IHX4sQIDHAnluI ugrv/ngMHmMnS9JcrJsZS9rGpP7YSy8nJU4JAB6XA1UHsBOwTgRjowhxIrUbZmX1AO0/ an6KRy2cXPGWaUKP/CTEzBYlpjV1bjvllnYBddoz0h1smMGuODiyY+q32aIlNqLo3ML/ GvvcgDll1bxctFngj2Ui6iC8Xa+93RsYOMo8rEtdgdJdSXYGJjeKXH1AeSsnPzICmUSm uFIA== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=CUq40RBcFWlSwGbY5RJDIyTMYxN80oLaIQ8ofaKawKU=; b=P7YFsjXxShMcC60LWwQ6ZaCIj4ooPanJ4rkCcGCY7PDm4ZKy++97uusAHX2ardYkuN zY+uRB3F6h5QVXnw/Csc1qfBAl8e5yy1zRN4dlhfWCAkIhRVSwZvTD8M7sczzCX4qHCL YWvN7cF25Uls6E9aKzI5RssUu5VGJGGn37UEpdxLd333niP8/p6ubl4XW6zFCgY41gQn 8wR2LMqUEpVO+Z4oSX9ARQVcuzaBh56RdCK8yigcCEkWjqopJlUZRI9aum2Npm8fmq1C UFFA0n6f+juTw4xC9bJ8G382XhXROIUVnBAhjbsEBeeFHzrzzf7Ln3vTsED2aHHIOXLa JF7w== X-Gm-Message-State: AOAM531aJ2kcaK5tCPRon5GVxJho6jx6l1HIzGchiv2jMQtscX4SlzE7 Kz4FK9zW9m8FwnPVQNwiI4uDsQ== X-Google-Smtp-Source: ABdhPJw0KHlJ4T6p6oTbhkmyNmLTN1Q2hb1K7QIoEOqj48/R6cuJRPrxroJTyk5muBGKtye53Bw6Bg== X-Received: by 2002:a17:90b:38cb:b0:1d1:4d40:360 with SMTP id nn11-20020a17090b38cb00b001d14d400360mr7508634pjb.9.1650502675109; Wed, 20 Apr 2022 17:57:55 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:88b4:9a13:801d:9fc8]) by smtp.gmail.com with ESMTPSA id qa16-20020a17090b4fd000b001d25dfb9d39sm383410pjb.14.2022.04.20.17.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 17:57:54 -0700 (PDT) Date: Thu, 21 Apr 2022 09:57:50 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, trini@konsulko.com, sjg@chromium.org Subject: Re: [PATCH 5/7] efi_loader: PARTITION_UUIDS should be optional Message-ID: <20220421004011.GB7584@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. > > > > 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(-) > > > > 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 = armv7 || SYS_CPU = 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_device_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: > > This can only be reached for CONFIG_EFI_PARTITION=y. I know, but the code won't be exercised anyway if !CONFIG_EFI_PARTITION. > > hddp->signature_type = 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. What matters here is that "uuid" in struct disk_partition is defined only if CONFIG_PARTITION_UUIDS. > > 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? As I said in my previous comment at patch#6, CONFIG_EFI_PARTITION can be seen optional under the current implementation. > > Shouldn't we select CONFIG_PARTITION_UUIDS if CONFIG_EFI_LOADER=y and > CONFIG_EFI_PARTITION=y. Unfortunately some platforms enable (in other words, "select") PARTITION_UUIDS unconditionally even without explicitly enabling EFI_LOADER or EFI_PARTITION. -Takahiro Akashi > Best regards > > Heinrich > > > +#endif > > break; > > } > > >