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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE863C433F5 for ; Tue, 5 Oct 2021 18:17:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 06BF461130 for ; Tue, 5 Oct 2021 18:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 06BF461130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA402807CD; Tue, 5 Oct 2021 20:17:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="iaGRoMd1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 52F2982B68; Tue, 5 Oct 2021 20:17:39 +0200 (CEST) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 CB45780607 for ; Tue, 5 Oct 2021 20:17:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-ot1-x32e.google.com with SMTP id u20-20020a9d7214000000b0054e170300adso1932864otj.13 for ; Tue, 05 Oct 2021 11:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1oV/IdO2I+AEdVvfGQ8RFe7mmMYu993CG7bjvpsrcvw=; b=iaGRoMd17WGJERqQ6IgjpPAr4TZbIEiYLroKHBo8Zc+vt/ZunD5VC8Ud1eNUGIXfSZ JdTKFD/d5Ingc18gKlEIjYrg6D1iPmgNIB7Soyz6Oxjfh/Re8sObyHQAaKC8EMWwLpE4 V238fp+8xqECYwtenQb4g0qz8MAyJDGGTyPH8bi4svDuu1camRCopgZgjru1EddECdTk 9nB8wbsiJHTjzWLDLX+bziopqHKWhujaoayvuuQ6mFxkd3DuZGq1g0V+YHVG8wYpRd/v F0zj8FRPaFyRM8wDhaocc/s9Ay0mD4KctEkot+II3wIFxY4uHxYeE5zRWQ/LctABKLhZ hImg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1oV/IdO2I+AEdVvfGQ8RFe7mmMYu993CG7bjvpsrcvw=; b=dBv09+KMSlXEbc+XY68P/l5xeRmlwoakVlg2dXVetl8QVgeHLl/xo+cXr4APzKJ1q8 ofW+N3ZD8bDxMUwrSwtXE0qSwbLP8iFTqOD2yH+JveGCBOqFj3zdXBY2u6h8rUEksMMo ZDdvgMfq7yuXUOC8VjutLDH7HRXZvLseaV5hh7fCipsZ+8tn3Drs9bDeN49GBQgNm4jV kvMPd7WvV9pS0t219/u3yDlQgecckbWQuSZiZagMmnJqnMx9FV1wzvbRj/fFJlFTysLN TE5pS/4ZrAFhFxFNoymae5/i4xUY+T8wiFyZFo+5i72zvucdTjl6CjuWgcggG7NdYaAQ CEDw== X-Gm-Message-State: AOAM532Cw/tWO9qVxPrAgINb9W4rWzvIqklJNR1b3Ck92zFkPvglWhhw C6dIYwnsCl9K8VVTyAiK3lI= X-Google-Smtp-Source: ABdhPJybG14h5SeH+zkTptB85VLhVE4n6K+9tF/a45Zr+/kfkeEq8P70a0k6oQwAIybQZ/2tOorqcA== X-Received: by 2002:a9d:5d15:: with SMTP id b21mr15585287oti.356.1633457854536; Tue, 05 Oct 2021 11:17:34 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id q25sm3494790oof.33.2021.10.05.11.17.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 11:17:33 -0700 (PDT) Subject: Re: [PATCH v5 03/29] image: Add Kconfig options for FIT in the tools build To: Simon Glass , U-Boot Mailing List Cc: Andre Przywara , Rasmus Villemoes , Robert Marko , Masahiro Yamada , Tom Rini , Joe Hershberger , Marek Vasut References: <20210926014342.127913-1-sjg@chromium.org> <20210925194327.v5.3.I64826ed33219988294468df7b95dfa3fffd7a0a1@changeid> From: "Alex G." Message-ID: Date: Tue, 5 Oct 2021 13:17:32 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210925194327.v5.3.I64826ed33219988294468df7b95dfa3fffd7a0a1@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 9/25/21 8:43 PM, Simon Glass wrote: > In preparation for enabling CONFIG_IS_ENABLED() on the host build, add > some options to enable the various FIT options expected in these tools. > This will ensure that the code builds correctly when CONFIG_TOOLS_xxx > is distinct from CONFIG_xxx. > > Drop some #ifdefs which are immediately unnecessary (many more are in > later patches). > > Signed-off-by: Simon Glass Under protest, Reviewed-by: Alexandru Gagniuc > --- > > Changes in v5: > - Drop changes to tools/Makefile since they already use TOOLS_ Kconfigs > - Use TOOLS_ instead of HOST_ > > common/image-fit-sig.c | 3 ++- > common/image-fit.c | 4 ++-- > tools/Kconfig | 25 +++++++++++++++++++++++++ > 3 files changed, 29 insertions(+), 3 deletions(-) > > diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c > index b979cd2a4b6..e95e64bd2fe 100644 > --- a/common/image-fit-sig.c > +++ b/common/image-fit-sig.c > @@ -72,11 +72,12 @@ static int fit_image_setup_verify(struct image_sign_info *info, > char *algo_name; > const char *padding_name; > > +#ifndef USE_HOSTCC > if (fdt_totalsize(fit) > CONFIG_FIT_SIGNATURE_MAX_SIZE) { If you set CONFIG_FIT_SIGNATURE_MAX_SIZE to 0x10000000, then this comparison will always be false. > *err_msgp = "Total size too large"; > return 1; > } > - > +#endif > if (fit_image_hash_get_algo(fit, noffset, &algo_name)) { > *err_msgp = "Can't get hash algo property"; > return -1; > diff --git a/common/image-fit.c b/common/image-fit.c > index 6f8e67e4158..17c6d4e7813 100644 > --- a/common/image-fit.c > +++ b/common/image-fit.c > @@ -170,7 +170,7 @@ int fit_get_subimage_count(const void *fit, int images_noffset) > return count; > } > > -#if CONFIG_IS_ENABLED(FIT_PRINT) || CONFIG_IS_ENABLED(SPL_FIT_PRINT) > +#if CONFIG_IS_ENABLED(FIT_PRINT) > /** > * fit_image_print_data() - prints out the hash node details > * @fit: pointer to the FIT format image header > @@ -578,7 +578,7 @@ void fit_image_print(const void *fit, int image_noffset, const char *p) > #else > void fit_print_contents(const void *fit) { } > void fit_image_print(const void *fit, int image_noffset, const char *p) { } > -#endif /* CONFIG_IS_ENABLED(FIR_PRINT) || CONFIG_IS_ENABLED(SPL_FIT_PRINT) */ > +#endif /* CONFIG_IS_ENABLED(FIT_PRINT) */ > > /** > * fit_get_desc - get node description property > diff --git a/tools/Kconfig b/tools/Kconfig > index d6f82cd949b..ea986ab0479 100644 > --- a/tools/Kconfig > +++ b/tools/Kconfig > @@ -20,4 +20,29 @@ config TOOLS_LIBCRYPTO > This selection does not affect target features, such as runtime FIT > signature verification. > > +config TOOLS_FIT > +config TOOLS_FIT_FULL_CHECK > +config TOOLS_FIT_PRINT > +config TOOLS_FIT_SIGNATURE Besides FIT_PRINT, I'm confused as to where the others are used by the tools build. > + > +config TOOLS_FIT_SIGNATURE_MAX_SIZE On the other hand, if you #ifdef out the check in image-fit-sig.c, then it doesn't make sense to have this config on the tools. > + hex > + depends on TOOLS_FIT_SIGNATURE > + default 0x10000000 > + > endmenu >