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 DA25EC433FE for ; Fri, 17 Dec 2021 18:07:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A4118363F; Fri, 17 Dec 2021 19:07:33 +0100 (CET) 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="ZZx5N0LA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4581830CE; Fri, 17 Dec 2021 19:07:31 +0100 (CET) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 3810483662 for ; Fri, 17 Dec 2021 19:07:28 +0100 (CET) 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=1639764446; bh=3c4u7pkpsaSJiCLJr13ec/7n43VGFDUCFhaPvvG++oo=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ZZx5N0LA7ExNzYcex1ycD65yrreCotf3Imvh7ti3PWeGXYxwvsn2+HAZ8AJlosbF5 0Qt+uYOdqEPH7472Lk3J58KNlpfX1NfjQUWHUnERP+yZDeRrA8rIDsdNGaiAQUVxtm i2+gqWogJX4HqXMxzGJXfrnF2pmJloL4Hh9qo8Xg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MlNtF-1mDAaR1Oov-00ln5c; Fri, 17 Dec 2021 19:07:26 +0100 Message-ID: <7108064f-e169-fe83-105e-998641dd3132@gmx.de> Date: Fri, 17 Dec 2021 19:07:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH 3/3] cmd: efi: efidebug print ECPT table Content-Language: en-US To: Jose Marinho , u-boot@lists.denx.de Cc: ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, takahiro.akashi@linaro.org, agraf@csgraf.de, nd@arm.com References: <20211217125506.138902-1-jose.marinho@arm.com> <20211217125506.138902-4-jose.marinho@arm.com> From: Heinrich Schuchardt In-Reply-To: <20211217125506.138902-4-jose.marinho@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:bkP+xDbm6kHngqIpVRZ+5lJ/FIigRR6eqnxnayxRkhLY1Nm5BnP +j5K7Pm7iqkSccoh/Y1OHtxVOV75hVR5sssi9SVXIJp34wVr+tP6E4YcEUeqJt6SjMq6eOL pzBn/6Bcv0DP/lm1lg2jBZq6Ol6gEmlN+z+8fQ2D9pMEis/u4acGQOhWNME52mwQms7QWtD BC6GkkT4NP0uKUbTDsWWA== X-UI-Out-Filterresults: notjunk:1;V03:K0:PO5SAbXH3P4=:sk/g7Q8bN8B1DkQeaIjsmj D4UonrGTUxYbeeLJ09P8IdgYRMLAPRgMIMEIctaNaaIUG6o8SmnfXFXELxwDw5yM7JmUv+Ter y/7TZX6aIksI3yl1RmGnnOne3Qz8qCAddH/p0yhcWpDAqGtG8OVnyTSHXNSZbBOvxABcFG1u7 Baa+MuWKmQcolZCCE62FNt7oZia6e0D+3r5B3p5H6uDQ8XJRpu8xkHFpCs2VyhIKLlN0tYBkU Tk2AxuyirGL5j8T4c5Wr6lYLYs3+8ZOXDIAxwT74H1eoJtoxmbNf7cjfDpDwTyr9fAvEmdDiK tUnzCFfijc1zZ8TMcpbvj0QnldEhxzRfYmBAoLDlzNLZIeHJHIL3J6za9oDsslyMKjLDdvKN5 5mS3drHanlKPKD2xJ3KP+g3PRtMTerPDA2ddZFijzBJ4CwB4jaRJ4DF198xwn/CibLmwjsD8w VPNeOqxgSVFC27n946GuNS+BdOiNFZ+JXLys3zF81eCnUpfcdVW1lFexzsdgz3GN6Pjp5gS8Y noulwTMJ2W7febJFPQQgV5K/3sVdmrdIuWALeucqQxe2EQ1LWfJx9eev6NWRGO7UlytqoFzPD KS4x8kw5Vj9OTC16yjoXbD8i9Dhd8Lfqv90aDgPPP5u7+2ERtQSnc6IjuEkdNEnKNrMy1rK3L BmgQ1Fs4t/7xrBT5oO1XueYEKt8G0l/5SvxZwQJrcvVTTouJ5YLp9Gw3NhtTpb1bOb1T6QqCa dK9yfhJjXKGbqoWdz6b/esoQunWrbjOlD+MJ0rg7U8nnzx4ZdBaUS26qRIAkhTck+r2U7jkob CJZqrYgpHPOwoORch5TsxWqrdMndLb5g+GYju6k5wMC7eHHlZAa+2a+gkAP0P08o1SmAox5xP YOia/qkZRK5iExDAlku7kH5kBkXM8ENtE6byk6h9I8KcKQCH26q44Cq7RkikzpcQi++48mEif K2gjmagOR/VTuuNHuX6d5IG58JopioZqC5mUbhKNrGROeU6gfFmyz5jCi5/jZmzDwuhH5KrN7 IAlUkru6VoHY5B+oBZAjFv5Js9ltAMR5ragLz7smPbDPZBASzmtttzi8CBzoUHENPkOjOKSwd k5ugoODP6teD/c= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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 12/17/21 13:55, Jose Marinho wrote: > Signed-off-by: Jose Marinho > --- > cmd/efidebug.c | 41 +++++++++++++++++++++++++++++++++++++++++ > include/efi_loader.h | 2 ++ > 2 files changed, 43 insertions(+) > > diff --git a/cmd/efidebug.c b/cmd/efidebug.c > index a53a5029fa..c3246e1820 100644 > --- a/cmd/efidebug.c > +++ b/cmd/efidebug.c > @@ -889,6 +889,38 @@ static int do_efi_show_tables(struct cmd_tbl *cmdtp= , int flag, > return CMD_RET_SUCCESS; > } > > +#ifdef CONFIG_EFI_ECPT > +static int do_efi_ecpt(struct cmd_tbl *cmdtp, int flag, > + int argc, char * const argv[]) > +{ > + struct efi_conformance_profiles_table *ecpt; > + > + if (argc !=3D 1) > + return CMD_RET_USAGE; > + > + for (int idx =3D 0; idx < systab.nr_tables; idx++) > + if (!guidcmp(&efi_ecpt_guid, &systab.tables[idx].guid)) > + ecpt =3D (struct efi_system_resource_table *)systab.tables[idx].tabl= e; > + > + if (!ecpt) { > + log_info("ECPT: table not present\n"); > + return CMD_RET_SUCCESS; > + } > + > + const int num_profiles =3D ecpt->number_of_profiles; > + > + printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > + printf("ECPT: version:%d\n", ecpt->version); > + printf("ECPT: num profiles:%d\n", num_profiles); > + > + for (int i =3D 0; i < num_profiles; i++) > + printf("ECPT: profile %d =3D %pUL\n", i, &ecpt->conformance_profiles[= i]); > + printf("=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); > + > + return CMD_RET_SUCCESS; > +} > +#endif /* CONFIG_EFI_ECPT */ > + > /** > * create_initrd_dp() - Create a special device for our Boot### option > * > @@ -1681,6 +1713,11 @@ static struct cmd_tbl cmd_efidebug_sub[] =3D { > "", ""), > U_BOOT_CMD_MKENT(query, CONFIG_SYS_MAXARGS, 1, do_efi_query_info, > "", ""), > +#ifdef CONFIG_EFI_ECPT > + U_BOOT_CMD_MKENT(ecpt, CONFIG_SYS_MAXARGS, 1, do_efi_ecpt, > + "", ""), > +#endif > + > }; > > /** > @@ -1769,6 +1806,10 @@ static char efidebug_help_text[] =3D > " - show UEFI memory map\n" > "efidebug tables\n" > " - show UEFI configuration tables\n" > +#ifdef CONFIG_EFI_ECPT > + "efidebug ecpt\n" > + " - show UEFI conformance profiles table\n" > +#endif > #ifdef CONFIG_CMD_BOOTEFI_BOOTMGR > "efidebug test bootmgr\n" > " - run simple bootmgr for test\n" > diff --git a/include/efi_loader.h b/include/efi_loader.h > index d20ff396d0..d60a340136 100644 > --- a/include/efi_loader.h > +++ b/include/efi_loader.h > @@ -310,6 +310,8 @@ extern const efi_guid_t efi_guid_firmware_management= _protocol; > extern const efi_guid_t efi_esrt_guid; > /* GUID of the SMBIOS table */ > extern const efi_guid_t smbios_guid; > +/* GUID for the ECPT */ > +extern const efi_guid_t efi_ecpt_guid; > > extern char __efi_runtime_start[], __efi_runtime_stop[]; > extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[]; Our interest is to keep the U-Boot binary size small. I see no need to print the ECPT table. What make more sense is a unit test that checks the consistency of the table. Best regards Heinrich