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 661DAC433F5 for ; Fri, 17 Dec 2021 12:56:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 01588830A2; Fri, 17 Dec 2021 13:56:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.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=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="o6E1Ktyv"; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="o6E1Ktyv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3BE1883063; Fri, 17 Dec 2021 13:56:00 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on062b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::62b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4AAD08306E for ; Fri, 17 Dec 2021 13:55:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Jose.Marinho@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NSNjmXMPRwkBqFKuXevWnY5nbiH5iGLr/Sr/Tw+yHjM=; b=o6E1KtyvMsFuUL3xs6qHnYAVwOBcX+tMzEf4XMA3OxLkpaxK85NasnwJlmOdn+EebXnKVgHQOmgv4x4LxUMuWZAh0jC6H/Lg7g41bO/7Nq2EbyNiSpPZHOpyOq8RdYQwqvJh18Iy4JrOTp678GqXnKfhm4XxZws1A9rXh8cn+lo= Received: from DB6PR07CA0174.eurprd07.prod.outlook.com (2603:10a6:6:43::28) by VI1PR08MB3104.eurprd08.prod.outlook.com (2603:10a6:803:42::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.14; Fri, 17 Dec 2021 12:55:50 +0000 Received: from DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:43:cafe::bc) by DB6PR07CA0174.outlook.office365.com (2603:10a6:6:43::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.8 via Frontend Transport; Fri, 17 Dec 2021 12:55:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT053.mail.protection.outlook.com (10.152.21.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14 via Frontend Transport; Fri, 17 Dec 2021 12:55:49 +0000 Received: ("Tessian outbound a33f292be81b:v110"); Fri, 17 Dec 2021 12:55:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bf6bd563938a8626 X-CR-MTA-TID: 64aa7808 Received: from b401f0043b9e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 725A5CA3-F63C-4897-9C45-098259423DBA.1; Fri, 17 Dec 2021 12:55:43 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b401f0043b9e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Dec 2021 12:55:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BajgwRLrmWwVTQtxL3z8mei9vpZzE2ofWP/c0g/+sKeRi8LW16DfwzX5FZpLp5LaNJTyUUrTnv3Pq7LOWLJB1FPju80yZxjuthVd96wjHTWaUhxS2Zf1/vGVCwvmF8CPIALVwJ8M3Z14avvudIU9yW+EQ7CNT8tePHJIMBvVFyfzU7cXPD5+YTAQPotVend4vNq+OblvDH94YaEq0rCpGZAvubjzVtpV6usnX1pAP2cfbUB4VapasD7TYMZ91zZBivy9j5JgmYs2GnIVLVc7W6T2CpT1F1gcqQ5HGrIR6trk0ybvIZR4nzSv5zmDEKknmtkV3yZ5KQhPDRhFZnditw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NSNjmXMPRwkBqFKuXevWnY5nbiH5iGLr/Sr/Tw+yHjM=; b=fzP8fxtc8SJMIVfBJaJzTkQ2QTQ/YfqzgKkp0t1WKdOhHhiC6jMRrAV3nqDnaxNtAuOPF0XNpQK7nwR1VPap4kDISnWE60saTOC4AsUg8EXtWNhe0xS24sfNkvaUHf1toYZ7wEeayj6Y2xCmGxtiQ42xtexewa/dvYZ9wcQ+SW3kzdEG7FwO/AnvYubVl+B7xlI/mpWk8CU1yDnX8kNQxe2u/+30Q2poKxee/WScLwSCXPKJlGH/pX3sp7WUJF3NdAoU400Ia8LP+noWQpu9mgmSgSNBBVmqeXSjpOqmNOv0JxZ3PCFZCos6Ml7jPihIdb+2haixkrdUMHE36/L0mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NSNjmXMPRwkBqFKuXevWnY5nbiH5iGLr/Sr/Tw+yHjM=; b=o6E1KtyvMsFuUL3xs6qHnYAVwOBcX+tMzEf4XMA3OxLkpaxK85NasnwJlmOdn+EebXnKVgHQOmgv4x4LxUMuWZAh0jC6H/Lg7g41bO/7Nq2EbyNiSpPZHOpyOq8RdYQwqvJh18Iy4JrOTp678GqXnKfhm4XxZws1A9rXh8cn+lo= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DBBPR08MB6012.eurprd08.prod.outlook.com (2603:10a6:10:205::9) by DBBPR08MB4629.eurprd08.prod.outlook.com (2603:10a6:10:f4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.18; Fri, 17 Dec 2021 12:55:40 +0000 Received: from DBBPR08MB6012.eurprd08.prod.outlook.com ([fe80::5d1b:4877:774f:275e]) by DBBPR08MB6012.eurprd08.prod.outlook.com ([fe80::5d1b:4877:774f:275e%9]) with mapi id 15.20.4801.015; Fri, 17 Dec 2021 12:55:40 +0000 From: Jose Marinho To: u-boot@lists.denx.de Cc: Jose Marinho , ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, xypron.glpk@gmx.de, takahiro.akashi@linaro.org, agraf@csgraf.de, nd@arm.com Subject: [PATCH 3/3] cmd: efi: efidebug print ECPT table Date: Fri, 17 Dec 2021 12:55:06 +0000 Message-Id: <20211217125506.138902-4-jose.marinho@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211217125506.138902-1-jose.marinho@arm.com> References: <20211217125506.138902-1-jose.marinho@arm.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN6PR08CA0012.namprd08.prod.outlook.com (2603:10b6:805:66::25) To DBBPR08MB6012.eurprd08.prod.outlook.com (2603:10a6:10:205::9) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 53e8e054-cf0e-4ea9-9d13-08d9c15c8d15 X-MS-TrafficTypeDiagnostic: DBBPR08MB4629:EE_|DB5EUR03FT053:EE_|VI1PR08MB3104:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:949;OLM:949; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 8O7aeLRiTMoJDtp6+vWSRGrii//KQ8RbRZCj7xf8Uqx2WX1NPziPlDhVSVHN7yr1zVL5Vfoh0O0Tr1xYXkkcJQYSYhYZ0nspUQ7qWXcnj4mk2B3rXK7m3ZUYcUoG17nLG8b6tKQCsy5UFwamQ9X9MlVjXQ5uIaSeklQi/hUCmpVI9DfSxya2e9okl4XJt1ERZyYaO/MsAihipKcx/bkn060+T4QwSING9WVkjbIQGKtebveWoemQdTVQLoPE6PJkorQIo5GdTswaA9E1Jn7MtqYI1tLGobYyhgih9fcEfJtyO81SH8hkA0gdxG9I3Kkg2H/uzjsRIPyDv/6sLAF4+rZbdP2o+FNM3flrdXNzFn17nas/Hr8LpUvECT9a53+PeVqX/b1g4dufJEWEgG08VVmAxFmrQ9WMo4yjfOWWZVfzygm1wgaCIfFGOfuU0m9kfiqQfcJRRaQV0BjSMOwAM/fOwzNz3Q5gVyQgMx2oHS3MDr2FUX6zgHZYbNwStRkMVjd5yb+njYHUV/g4Hxbo7AhQhKh2+rtUmXbpn9bDbT4Mzi6TqG0r8dzdJTkAij+WX6ZKh9tNYE1RSOStQtxzKRzdLhI9IsbhZ6THgYLHypIcpCTKNvOrzec+k/aPnBmU7dj8cV4Rr7YoKbWMFBnC5R07eHATl41Zpk97b2oQOsj5EpmbosBKsYnF7A68EtI40/KzIHnQdv2l+Q0joWEoKw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB6012.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(38100700002)(38350700002)(1076003)(316002)(44832011)(5660300002)(6916009)(4326008)(26005)(36756003)(186003)(8676002)(8936002)(2616005)(508600001)(6506007)(6666004)(52116002)(6486002)(6512007)(66476007)(66556008)(66946007)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4629 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b8e677bf-8daa-4d36-3380-08d9c15c8700 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zMeuAMy5DrCCYM/iB3OANoUzrxU8b+AGg37kVjyFDCF1iq94sOyp7YSDmJ0dS1fY9PZuhfltvgfL1vmxfCqbeE+xncYpftZV3jUp4uxDNkqvyDYNrDLCG48QT+yrNy94xZolq6X/StxMnMl+LMHtyPt+So4UcGmCG2jv1xj0Tr1eWdyfSwFpwUihOu1+5Lru/r0nSnLD1VZeEtDhuWJpkRuI+h5MZDfsYxKtySt5yD8vpCvwpiF6X2ZKmcrfQ39UvV5FpG6DeTO3S9Dd1Z+ee7eDV8O3s0XZdfFbi0SXYZETjcCY8//EfkVGEma45h+oQUq5HmR68eToXLm45NWxe0bawRiUYrUC3gH8ZJdL5CnYw5KDts5/Ww91JVD9XnrWfHhR4hSpe9GiYskmEpO09nvqc4CzUTu+BSns/W/eFIJBbzI7PoyecSHHRY/pzUnC/h1W269nKWPFUn2bn1OS/PbLzdR6Bk46dXJwNcpdMjnRRrhvvnV5Jjr0yNYMX1R7UwySiIR6usZutE9Frcgzk2B/Yg6SLfy/NGIimk+dPbOVC1ACSPJ8Y299iIyC6ogMNA8gqP/XFHHq+r27HoGXKL0surI8/JMy2+Gm+ALgMETUmQNUpbAS3DrZ1ujZAYefXtrBAkY4FXeJM67JFtVn8t3Wf+BPoLbgYbkPr6Lms8kNVmWNWxv007akGnAkBluJZyv3ksrlT2JvvuFknL7iPw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(70206006)(508600001)(8676002)(6506007)(26005)(70586007)(1076003)(2616005)(82310400004)(8936002)(6486002)(44832011)(336012)(6666004)(36860700001)(6512007)(86362001)(6916009)(316002)(186003)(4326008)(36756003)(356005)(2906002)(47076005)(5660300002)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2021 12:55:49.7635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53e8e054-cf0e-4ea9-9d13-08d9c15c8d15 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3104 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 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 != 1) + return CMD_RET_USAGE; + + for (int idx = 0; idx < systab.nr_tables; idx++) + if (!guidcmp(&efi_ecpt_guid, &systab.tables[idx].guid)) + ecpt = (struct efi_system_resource_table *)systab.tables[idx].table; + + if (!ecpt) { + log_info("ECPT: table not present\n"); + return CMD_RET_SUCCESS; + } + + const int num_profiles = ecpt->number_of_profiles; + + printf("========================================\n"); + printf("ECPT: version:%d\n", ecpt->version); + printf("ECPT: num profiles:%d\n", num_profiles); + + for (int i = 0; i < num_profiles; i++) + printf("ECPT: profile %d = %pUL\n", i, &ecpt->conformance_profiles[i]); + printf("========================================\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[] = { "", ""), 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[] = " - 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[]; -- 2.25.1