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 B055EC433EF for ; Fri, 17 Dec 2021 12:56:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9C9E8306F; Fri, 17 Dec 2021 13:56:22 +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="6mIarYrM"; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="6mIarYrM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 09F2B830BE; Fri, 17 Dec 2021 13:56:19 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03on060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe09::60c]) (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 C4ACD8304C for ; Fri, 17 Dec 2021 13:55:47 +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=B1vBQ8eqFo/3IFqS2mh9XB9O78WuBa6ZZwcWEZE+bhM=; b=6mIarYrMxuFVHl17O52Z85RYlSnSw26NlZX3hJ85NFZJaaah5wSw8gutcbtwJLBZY58vIB1nVXmXZs9oyXYKgII1Vhgz3goc43DATTAu3wlkp4UfPR3OFNgBGb0z/c7YI1Ewd6xl0hwm2ihMmFX2UW/oCp3xPbZX2cA3rxNrk4Y= Received: from AS9PR04CA0039.eurprd04.prod.outlook.com (2603:10a6:20b:46a::33) by DB9PR08MB6857.eurprd08.prod.outlook.com (2603:10a6:10:2a2::7) 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:45 +0000 Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46a:cafe::67) by AS9PR04CA0039.outlook.office365.com (2603:10a6:20b:46a::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16 via Frontend Transport; Fri, 17 Dec 2021 12:55:45 +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 VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) 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:44 +0000 Received: ("Tessian outbound 9a8c656e7c94:v110"); Fri, 17 Dec 2021 12:55:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: eb073df03a186fed X-CR-MTA-TID: 64aa7808 Received: from 9062109e0f95.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6585BFDF-8AEF-417D-9DC2-CAB8035EB763.1; Fri, 17 Dec 2021 12:55:33 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9062109e0f95.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 17 Dec 2021 12:55:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M61yezedifimvyQPxdu/l8wOn4yby+ndjNymACSoHHneVBk6cA7KWftBgz3JMCG6kUcTV+Pg/ZynxjH1J7Tl1YzBDFGdpTGoYoJBnikHhsOFRYsSTwwkSQPc9QbG+uJ35MZeKsqSif350oSi/H+DO49DeppGySxgs8vdLLpa6vPv3mAucTjyr9hQaJfzgAHgaUhLcmu7cP9Rgqk/mGyANMJzJqBgohr5Gx0RmMyvl5C72ch0CMJ+zbWIp36eg+f+Seu1XcFCDtwSwQiGb5oaRCjf4oVLshtYL2P38ZN8Vfl8S1rN1hmBjby7RaWkXVaoz++Tmpdc92Vz4G1seY4eYw== 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=B1vBQ8eqFo/3IFqS2mh9XB9O78WuBa6ZZwcWEZE+bhM=; b=WJDfItfxbvntN5U5dL/yGqLqgBK3KRYVvskJqtSUUMT77mJcKBP7Pp2rwa8sKCUmJYzHT4+JutUIWglTGt0avXh+/IZk25EoPbBTDbFkJJq6W6NlKWeWD3orvxKcb1rnE2xQf7bNcbeNF9hGRiTsRa9VZfZTim6wjAgre8S6LHT8041uMmp1Pvsclvm3rrqe7QfnXJ9qd/pY34aOJkPEJuzAmMqkp/WWXjXMebz8kSaysmPVPBS/ZDJtmqcEUbB9zpIJyM1lQjqFCR9ZlPuNf5WsTBNlex/F52b23kI1ZXbnBKIariM6J4FN8xgjOmtiT7CyJtyNZ8JeahVnikmCHw== 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=B1vBQ8eqFo/3IFqS2mh9XB9O78WuBa6ZZwcWEZE+bhM=; b=6mIarYrMxuFVHl17O52Z85RYlSnSw26NlZX3hJ85NFZJaaah5wSw8gutcbtwJLBZY58vIB1nVXmXZs9oyXYKgII1Vhgz3goc43DATTAu3wlkp4UfPR3OFNgBGb0z/c7YI1Ewd6xl0hwm2ihMmFX2UW/oCp3xPbZX2cA3rxNrk4Y= 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:32 +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:32 +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 1/3] efi: Create ECPT table Date: Fri, 17 Dec 2021 12:55:04 +0000 Message-Id: <20211217125506.138902-2-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: a129f596-479e-4123-46c6-08d9c15c8a0b X-MS-TrafficTypeDiagnostic: DBBPR08MB4629:EE_|VE1EUR03FT047:EE_|DB9PR08MB6857:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 5EqKHH75vwVlwQ4Hcta2baFyc0bjJsyBBIs/lvjBpfKPuDRCXRYwCthk5Cx809tNH9AY8r6Ipyu+3QJbemR0RCLq2RX92lpjil3eATvQvkyp57UdGHlu1qLJIl3D7UhWGQPlgGTmEnuDnnnuoD70uFGFTXdAVCUzywQzQB20kXHro2BIyAX9UQIgArRLBriJAP8eA2pJR6aTGRIUz1xRl4oVv+j5f4Z0raMLIyizkg44Z+5vnc+hOcM9ox+FPH3iAFYFjyu+HR5+RHk5OukWqXnKwkCWp729FASW6fUlIGBU1X+RXrwanFzIp3Kx4sOaRnIHxL/n3goixzwF5YFtlIpPFo4ilx+XmBOhTV8n7SGLDGXN4M/WZy2nNQUA5Hae9TXXRHVilbI491aQo1HveFMsFiETIny7gQLyHB0wD7XPZqO4fsxgA4nKCCVajYDHJMfa3a4Eh2oy17Hab57B3nF8tgZMBX54WBLLQNDRKk4ZFwD2iNrReOLclWDOf6b8ZW0ro2TbaiYJ9z7v7PIFdVRNVInMLwusFGz3C4/JUh1uBbSdKs2QJyB0mWErOoaJnjR+1X/fET6ZXzACvWfYh/IGZUt2mFK461n6lKR/BhvoDTrbouB/Xj1Ni9ml1dQ6xCqgcMmj/66N325ICf/0j79nnv/PkN5hZcZ3hNwpUNEQrv+QM9Xjn7G+UkJC7C0QZ04zHUh3gcQZxSSNoaG32WO9Y9eYuCiPy03vM4CW7l4DgOI7zdTwslzzWZ/KGB5R5/zvunfXy2crJORweSI7t72WPsubstuwkD9QOqgR3YY= 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)(83380400001)(38100700002)(38350700002)(1076003)(316002)(44832011)(5660300002)(6916009)(4326008)(26005)(36756003)(186003)(8676002)(8936002)(2616005)(508600001)(6506007)(6666004)(52116002)(6486002)(6512007)(66476007)(66556008)(966005)(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: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 76130bdb-1c7e-4c38-b76e-08d9c15c8220 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GJeFIgPhoMGgYoJNSlOtskKT4fKsCU03Mf50Q4KcXXetpXHCmrCvpZHSplhBAWrYiC6Kjw0YnaVlOvm3eI6GZHnsaS3BBUCfXjGig2WbNyN1T8JmOwg9hyHX+qGW6DYRyNNJ2FEmJoep1gwcofkx2NXtAqXxtK5krYNZtDAEj5VI38LcKmBRnNReXiHvuK8xp/FL8bxjCUKmtwaKjsgBh+gbsRyAg9DzJwCgY3xMbpfdf8wx7zNZ049VsIJf9ig1cLF6BVTnq4+u6DJd9VfWdgFiG8bHAJpbBPGzjPUgmf/FS8E4l0qh2fOXr3wJ31LLbRnX8zDXZ40e96qIazvwO9rwg+FeOfRz5vS3FHeXic5gZByTvy2SvApKY9f7FHDDeSiMZ3mdWPZLBJH/6tb7tRCJAaLzyjlexiwXNQ6VVltz4oKgfiKARvY96t4wuGpm6xqiMLCMGIbptlfZPl6P42c8TNQb5WGpyBsnMtXodc1aCSvZ55vIDM+l0bmK9V///I1F3nU7UEmYvh7l9QQHcgCz0XtNKf52M8NKI+50Cep+TIDqBnTU0cop23uGCMXB+60YteXBoItyWqPwRbWtTnsE6aaYatsLfOtGNg0YSixw1Uw3Z5pIoAGEw1g62vZLkHnjHJIYh51ZK1c9pFIuegEB/cQmFtqJfoa8zSi0dFt5wgiXlvUM3H6sEGbrAfVzfS2Eg8TedGjZnTEtOPdImzG2dSSMXTbgqt2sP7Qg9s0VjCLgmICn2BC6Us2bFBBgoeLO3Hua4gwLqgDso5aXlfqz/FYQUqA93zr7N29qcUKslGLWX0qcS8aqvZsLAKd82O10lSoibQO27lZQ+Ot+QQno2vdMTTTdAUyDh/v0Pc8= 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)(46966006)(36840700001)(40470700001)(36860700001)(83380400001)(8676002)(4326008)(36756003)(6666004)(47076005)(40460700001)(6916009)(82310400004)(336012)(6512007)(966005)(6486002)(316002)(6506007)(70206006)(8936002)(26005)(5660300002)(508600001)(186003)(70586007)(1076003)(2906002)(2616005)(81166007)(86362001)(356005)(44832011); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2021 12:55:44.5744 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a129f596-479e-4123-46c6-08d9c15c8a0b 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: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6857 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 The ECPT table will be included in the UEFI specification 2.9+. The ECPT table was introduced in UEFI following the code-first path. The acceptance ticket can be viewed at: https://bugzilla.tianocore.org/show_bug.cgi?id=3591 The Conformance Profiles table is a UEFI configuration table that contains GUID of the UEFI profiles that the UEFI implementation conforms with. The ECPT table is created when CONFIG_EFI_ECPT=y. The config is set by default. Signed-off-by: Jose Marinho --- cmd/efidebug.c | 4 ++ include/efi_api.h | 10 +++++ include/efi_loader.h | 7 ++++ lib/efi_loader/Kconfig | 6 +++ lib/efi_loader/Makefile | 1 + lib/efi_loader/efi_conformance.c | 66 ++++++++++++++++++++++++++++++++ lib/efi_loader/efi_setup.c | 6 +++ 7 files changed, 100 insertions(+) create mode 100644 lib/efi_loader/efi_conformance.c diff --git a/cmd/efidebug.c b/cmd/efidebug.c index a977ca9c72..a53a5029fa 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -619,6 +619,10 @@ static const struct { "TCG2 Final Events Table", EFI_TCG2_FINAL_EVENTS_TABLE_GUID, }, + { + "EFI Conformance Profiles Table", + EFI_CONFORMANCE_PROFILES_TABLE_GUID, + }, }; /** diff --git a/include/efi_api.h b/include/efi_api.h index 80109f012b..6fd4f04de3 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -226,6 +226,16 @@ enum efi_reset_type { EFI_GUID(0x6dcbd5ed, 0xe82d, 0x4c44, 0xbd, 0xa1, \ 0x71, 0x94, 0x19, 0x9a, 0xd9, 0x2a) +#define EFI_CONFORMANCE_PROFILES_TABLE_GUID \ + EFI_GUID(0x36122546, 0xf7ef, 0x4c8f, 0xbd, 0x9b, \ + 0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b) + +struct efi_conformance_profiles_table { + u16 version; + u16 number_of_profiles; + efi_guid_t conformance_profiles[]; +} __packed; + struct efi_capsule_header { efi_guid_t capsule_guid; u32 header_size; diff --git a/include/efi_loader.h b/include/efi_loader.h index d52e399841..d20ff396d0 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -976,6 +976,13 @@ efi_status_t efi_capsule_authenticate(const void *capsule, */ efi_status_t efi_esrt_register(void); +/** + * efi_ecpt_register() - Install the ECPT system table. + * + * Return: status code + */ +efi_status_t efi_ecpt_register(void); + /** * efi_esrt_populate() - Populates the ESRT entries from the FMP instances * present in the system. diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 700dc838dd..b2398976f4 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -367,4 +367,10 @@ config EFI_ESRT help Enabling this option creates the ESRT UEFI system table. +config EFI_ECPT + bool "Enable the UEFI ECPT generation" + default y + help + Enabling this option created the ECPT UEFI table. + endif diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile index fd344cea29..9f5a0cebd1 100644 --- a/lib/efi_loader/Makefile +++ b/lib/efi_loader/Makefile @@ -64,6 +64,7 @@ obj-$(CONFIG_EFI_RNG_PROTOCOL) += efi_rng.o obj-$(CONFIG_EFI_TCG2_PROTOCOL) += efi_tcg2.o obj-$(CONFIG_EFI_LOAD_FILE2_INITRD) += efi_load_initrd.o obj-$(CONFIG_EFI_SIGNATURE_SUPPORT) += efi_signature.o +obj-$(CONFIG_EFI_ECPT) += efi_conformance.o EFI_VAR_SEED_FILE := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE)) $(obj)/efi_var_seed.o: $(srctree)/$(EFI_VAR_SEED_FILE) diff --git a/lib/efi_loader/efi_conformance.c b/lib/efi_loader/efi_conformance.c new file mode 100644 index 0000000000..86c26d6b79 --- /dev/null +++ b/lib/efi_loader/efi_conformance.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * EFI conformance profile table + * + * Copyright (C) 2022 Arm Ltd. + */ + +#include +#include +#include +#include +#include + +const efi_guid_t efi_ecpt_guid = EFI_CONFORMANCE_PROFILES_TABLE_GUID; + +#define EFI_CONFORMANCE_PROFILES_TABLE_VERSION 1 + +/** + * efi_ecpt_register() - Install the ECPT system table. + * + * Return: status code + */ +efi_status_t efi_ecpt_register(void) +{ + int num_entries = 0; + struct efi_conformance_profiles_table *ecpt; + efi_status_t ret; + size_t ecpt_size = 0; + + EFI_PRINT("ECPT table creation start\n"); + + ecpt_size = num_entries * sizeof(efi_guid_t) + + sizeof(struct efi_conformance_profiles_table); + ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, ecpt_size, + (void **)&ecpt); + + if (ret != EFI_SUCCESS) { + EFI_PRINT("ECPT cannot allocate memory for %u entries (%zu bytes)\n", + num_entries, ecpt_size); + + return ret; + } + + ecpt->version = EFI_CONFORMANCE_PROFILES_TABLE_VERSION; + ecpt->number_of_profiles = num_entries; + + if (num_entries) + EFI_PRINT("ECPT check conformance profiles, not all entries populated in table\n"); + + /* Install the ECPT in the system configuration table. */ + ret = efi_install_configuration_table(&efi_ecpt_guid, (void *)ecpt); + if (ret != EFI_SUCCESS) { + EFI_PRINT("ECPT failed to install the ECPT in the system table\n"); + goto error; + } + + EFI_PRINT("ECPT table successfully created\n"); + + return ret; + +error: + + ret = efi_free_pool(ecpt); + + return ret; +} diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 1aba71cd96..fa5ad13500 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -231,6 +231,12 @@ efi_status_t efi_init_obj_list(void) if (ret != EFI_SUCCESS) goto out; + if (IS_ENABLED(CONFIG_EFI_ECPT)) { + ret = efi_ecpt_register(); + if (ret != EFI_SUCCESS) + goto out; + } + if (IS_ENABLED(CONFIG_EFI_ESRT)) { ret = efi_esrt_register(); if (ret != EFI_SUCCESS) -- 2.25.1