From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.45]) by mx.groups.io with SMTP id smtpd.web11.8766.1633351644053491527 for ; Mon, 04 Oct 2021 05:47:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=2wiKHM0c; spf=pass (domain: arm.com, ip: 40.107.14.45, mailfrom: sami.mujawar@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=SnS8tgBkQvZR5MRdNdfpgcx2ysttgyswkOs7UiqpoPI=; b=2wiKHM0cUjzkwqGcPa2zr8+nZfXxR91sXAl9JN/d2ffJw8TAsiU0wEQe0C61J+oAE54Q2v/WifQEvX60kPgJ14i38f1TNPEfHhesXLkPEtoNwThPHQNZaOi4zXHHM9DveY0tVZKlp5JXKG8s+xwOcroDRt7aVR9y22aAmWOsBhc= Received: from AM0PR10CA0020.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17c::30) by VI1PR08MB4542.eurprd08.prod.outlook.com (2603:10a6:803:fa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Mon, 4 Oct 2021 12:47:19 +0000 Received: from VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:17c:cafe::4b) by AM0PR10CA0020.outlook.office365.com (2603:10a6:208:17c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 12:47:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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 VE1EUR03FT006.mail.protection.outlook.com (10.152.18.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 12:47:18 +0000 Received: ("Tessian outbound a492f2284909:v103"); Mon, 04 Oct 2021 12:47:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bb7c8b7556a3dc99 X-CR-MTA-TID: 64aa7808 Received: from 1185f1ac22ca.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7D10FA5E-E7C0-4E27-B66A-DD7D51CA4531.1; Mon, 04 Oct 2021 12:46:53 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1185f1ac22ca.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 04 Oct 2021 12:46:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gCdmDqMjHTJSGhfrGKAa08FdGeyt6RpYNnLUMpQBHEGLPfQWWlCW14rYcPyztGzyXllNXH5Mmec4RpT40x7X3RSGnxRTfmHWI8sNm5lXEO13XL4sAg+0pqn5BnaSLmvH83Jw6mFEgdjHcCbvSb8/dAxgGqKScI0nHGjt6SpgyhvhNCQtOuHvs/pC+PAjLIAVMV25cuMta1263PuDLM856fCs+lF4PxykdlvYeFoRaH1eEkGChftLfFGEN+qgMI8UNRX84mCcgRCGh6C9JuKxwU7SbysqfOQGwyprPRfJtXJBZFG+m5hek/FnNB3bWhZUUU/Do1ODYsh8UoZaNCIyYQ== 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=SnS8tgBkQvZR5MRdNdfpgcx2ysttgyswkOs7UiqpoPI=; b=HU2mmb6TBkOWF9O0HJe2JCQIS8xzxHZQx+z06jhdKwzdOSWjvGO8kLYXVNsQWF2oxGTzS8KiIgXxMe+mffQXwSDsHGVTKGvXsaD5BlWmSQaqmyo289nbmADrFRoD2ZYoQ/4QHwCuWGyNOB55Y0F46ud/s5K2a2TT3Z1DJ9yCaztVpcZhGc1xUtksJP8Q2gqzHuTt+H6ibb3l4H5QcJCs4cg7nUk9SHG36m+lPG5eYU8SIXZr1/UyUA8hRRiyACgZK0a4X4r1CfV6ofgVNpy06Zml1pE3R5R/WUvT+gi0Cu+gJ+nCdJKhNBGS7nl0ezCobQrVP5sjZmZP15SF3bAhEw== 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=SnS8tgBkQvZR5MRdNdfpgcx2ysttgyswkOs7UiqpoPI=; b=2wiKHM0cUjzkwqGcPa2zr8+nZfXxR91sXAl9JN/d2ffJw8TAsiU0wEQe0C61J+oAE54Q2v/WifQEvX60kPgJ14i38f1TNPEfHhesXLkPEtoNwThPHQNZaOi4zXHHM9DveY0tVZKlp5JXKG8s+xwOcroDRt7aVR9y22aAmWOsBhc= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AS8PR08MB6501.eurprd08.prod.outlook.com (2603:10a6:20b:338::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Mon, 4 Oct 2021 12:46:50 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65%4]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 12:46:50 +0000 Subject: Re: [edk2-platforms][PATCH v3 5/5] Platform/Sgi: Add platform error handling driver To: Omkar Anand Kulkarni , devel@edk2.groups.io Cc: Ard Biesheuvel , nd References: <20210824060027.27246-1-omkar.kulkarni@arm.com> <20210824060027.27246-6-omkar.kulkarni@arm.com> From: "Sami Mujawar" Message-ID: <3c0d8846-ddba-6983-5074-d03ca3cef3d1@arm.com> Date: Mon, 4 Oct 2021 13:46:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210824060027.27246-6-omkar.kulkarni@arm.com> X-ClientProxiedBy: LO4P123CA0409.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::18) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.52) by LO4P123CA0409.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 12:46:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b705e1d2-29a0-433d-fc4f-08d9873519db X-MS-TrafficTypeDiagnostic: AS8PR08MB6501:|VI1PR08MB4542: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1923;OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: rATQfXMCxBFpBtNFZPGRZxl0D9y6QbjDtDy6S/AyjvM/4nB/mMykGMfwSMShXkFoKxl88t4495OX8v38Ui4uinWVapzqd8MFcvKZML83+HdwoU/n929hj6/GActdxWSULFJubNtyun2kLdoLxsXD+Zmoz+7IdMN6jssW18PQYAK4Xj77XoHpGfCeaES1/zxHRD9krGCY0NmNFa6+fXryP8qx0jBbGcJ78oG6ZSNstts7SooF+AIl9LH9bVZIS3BqGZsiDMqnpLWKe8YZWA1YqjkJFA7edYSx4QkAgcQBfLIpd9De5vql/u5NW4ghvAbm01QdMiDn14anivvG9+bbIjfkyEQgS5fUn3PJeFrGobJVzW3w6DbEgrmqKNEOV/ivXFMcv5OlBjhI4x71Yu8xhdN9rVQoUnl+60rC/PLnOzDuWxVTJzhNIR1RV8VSIsLBAaXeWlj9kt0Q4CB/bKFPOKoa8Vx/lcdkkEtoOK17Yga1kU8NJJxFQOBBufw0JWHSzcjwsJlNjlEYh6Y+4R2fHEnJjgU3miYKNpZhRbgqnuJDdjhO6P7RbRqTrbfAVwFIXGZVfjW1b79SmeK/Ev8iB8K5pmeXF/oqVql7YYn8uWYefiyD/hGH0akxQtf7iNamGnymBYbVeeV4OkuhFnoPYsom1gB4RKQz0om0uHw9Yn9iMLq3YhbiFgid5IBi4t48LzFhQmzPBllEKjojoJY9Q4Mo5gwXEeH9eVhskbaR1gMRmubARi9rOnsCObDv90FiBQK+ucsnmfe9e5JHF+WdqJzgnPjGQj5jqFgOxVBZk/fOjKRwcBs9is03L9TUJVSzZKDaxffAFj9ZCrNBqmqsj5pXojK13LYLo6pz/gqIHQ8= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(186003)(52116002)(31686004)(2616005)(956004)(38100700002)(38350700002)(508600001)(53546011)(86362001)(16576012)(31696002)(26005)(83380400001)(966005)(5660300002)(36756003)(66556008)(66946007)(66476007)(19627235002)(316002)(8936002)(4326008)(54906003)(8676002)(6486002)(2906002)(44832011)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6501 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3c3fd70a-2433-470a-908c-08d9873508fe X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ORb51eEprNSn7ADNQ9D7oG0BSh9frotJcWnIxBAaJk7LzuLNwLwG9q5s6OAc96To3E7pfsJr9lgfmWIge6fHk+nlwIIYkxILplm7HMqqyFUO+I5CQ0mMxQi7Kv4Z3ypJ6c9GzfTENWZ3hmS0CCvy777d1our0H4kQPGril8BmagbCBDxrHcPnJHCagKBIT6k9LJhGzg7oJiCDYFGYfeVO8xDm3OxRLKfM/l10mhEJl6l5mGn7kSwMrSgmeqslnWTCkP9rQiI1e9fpIqy3eJHAcEzvIad8Jb2QAfqfY4WmaoDhFr4ruj4xjhkZMxn1Ip6oAvrtfO9I0tx+tNUSQFpk9j+G1h2xGwOWm9UTKH4lfCJabQ/3Frj9MKz111QTieJhpoqZT7uwVAqJYRgrmR2t25TZJBmv4ooiz2fJU7MQhI8Z4CAVO6MqqAlPvYGrO+GyEiHhJo5o00LDc45JxdDoz4/HGdBUpmeAGP7gzKhidI3k39M0evp/g2byoIjp3I9ZzE0W3B6qBJCk4CQ8LXmzBiUBH53p0Ct7t8wEpgbFFQkfOJa1CWc6v8oRpY7/FhMyb3d2cQrjvX2GH2KXYrfuRZpKLgvLzvmTeRcJaVwDeQc/rJsjNGtlN5recp8mF+EGz3kkO3zBe64E/rpPZHPandoU/F9RBmUNc0BWJTb51bQXg3xCXyeVK69OD4zA8gla3XUm2qGKj42PgwxnesW6nAbTvoWzQEUURutNblHGhaqZyyhH/cWq4YszrHdJtGYWnkVYf0ZTMii/Zy24VdXluP0MVAK4OL/K+LI86Ejr4cx04YIwQRoZBjhHrTVDQqt 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)(186003)(26005)(31686004)(2616005)(956004)(336012)(508600001)(53546011)(86362001)(16576012)(47076005)(36860700001)(31696002)(82310400003)(83380400001)(966005)(5660300002)(36756003)(70586007)(81166007)(356005)(70206006)(19627235002)(316002)(8936002)(4326008)(54906003)(8676002)(2906002)(6486002)(44832011)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 12:47:18.5087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b705e1d2-29a0-433d-fc4f-08d9873519db 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: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4542 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Omkar, Please find my feedback inline marked [SAMI]. Regards, Sami Mujawar On 24/08/2021 07:00 AM, Omkar Anand Kulkarni wrote: > Enables firmware first error handling on the given platform. Installs > and publishes the SDEI and HEST ACPI tables required for firmware first > error handling. > > Signed-off-by: Omkar Anand Kulkarni > --- > Platform/ARM/SgiPkg/SgiPlatform.dsc.inc | 10 ++ > Platform/ARM/SgiPkg/SgiPlatform.fdf | 7 + > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf | 51 ++++++ > Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.c | 171 ++++++++++++++++++++ > 4 files changed, 239 insertions(+) > > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc > index 102d7926bde1..20f003b96cdb 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc > @@ -24,6 +24,9 @@ > # To allow firmware first error handling, set this to TRUE. > DEFINE ENABLE_GHES_MM = FALSE > > + # To allow firmware first error handling, set this to TRUE. > + DEFINE ENABLE_FIRWARE_FIRST = FALSE > + > [BuildOptions] > *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES > > @@ -326,6 +329,13 @@ > # > Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > > + # > + # platform error handler driver > + # > +!if $(ENABLE_FIRMWARE_FIRST) == TRUE > + Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf > +!endif > + > # > # FAT filesystem + GPT/MBR partitioning > # > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf > index d6e942e19b81..b1d088610c4c 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf > +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf > @@ -190,6 +190,13 @@ READ_LOCK_STATUS = TRUE > # > INF Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > > + # > + # platform error handler driver > + # > +!if $(ENABLE_FIRMWARE_FIRST) == TRUE > + INF Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf > +!endif > + > # > # Bds > # > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf b/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf > new file mode 100644 > index 000000000000..fe9ed4175b0b > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.inf > @@ -0,0 +1,51 @@ > +## @file > +# Dxe driver to handle platform errors. > +# > +# This driver installs SDEI and HEST ACPI tables required for firmware first > +# error handling. > +# > +# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION = 0x0001001A [SAMI] Update INF revision to use the latest version. > + BASE_NAME = PlatformErrorHandlerDxe > + FILE_GUID = a3187ea4-feb4-415f-b11e-2312623ffa6f > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + ENTRY_POINT = PlatformErrorHandlerEntryPoint > + > +[Sources.common] > + PlatformErrorHandlerDxe.c > + > +[Packages] > + ArmPlatformPkg/ArmPlatformPkg.dec > + EmbeddedPkg/EmbeddedPkg.dec > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + Platform/ARM/SgiPkg/SgiPlatform.dec > + > +[LibraryClasses] > + AcpiLib > + BaseLib > + DebugLib > + UefiDriverEntryPoint > + > +[Guids] > + gArmSgiAcpiTablesGuid > + > +[Protocols] > + gEfiAcpiTableProtocolGuid ## PROTOCOL ALWAYS_CONSUMED > + gHestTableProtocolGuid ## PROTOCOL ALWAYS_CONSUMED > + > +[FixedPcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId > + > +[Depex] > + AFTER gArmPlatformHestErrorSourcesGuid > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.c b/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.c > new file mode 100644 > index 000000000000..25b29152f1bb > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformErrorHandlerDxe/PlatformErrorHandlerDxe.c > @@ -0,0 +1,171 @@ > +/** @file > + Driver to handle and support all platform errors. > + > + Installs the SDEI and HEST ACPI tables for firmware first error handling. > + > + Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + @par Specification Reference: > + - ACPI 6.3, Table 18-382, Hardware Error Source Table > + - SDEI Platform Design Document, revision b, 10 Appendix C, ACPI table > + definitions for SDEI > +**/ > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > + > +/** > + Build and install the SDEI ACPI table. > + > + For platforms that allow firmware-first platform error handling, SDEI is used > + as the notification mechanism for those errors. > + > + @retval EFI_SUCCESS SDEI table installed successfully. > + @retval Other For any error during installation. > +**/ > +STATIC > +EFI_STATUS > +InstallSdeiTable (VOID) [SAMI] Fix coding style, please. VOID and closing brackets should each be on a new line. > +{ > + EFI_ACPI_TABLE_PROTOCOL *mAcpiTableProtocol = NULL; > + EFI_ACPI_DESCRIPTION_HEADER Header; > + EFI_STATUS Status; > + UINTN AcpiTableHandle; > + > + Header = > + (EFI_ACPI_DESCRIPTION_HEADER) { > + EFI_ACPI_6_3_SOFTWARE_DELEGATED_EXCEPTIONS_INTERFACE_TABLE_SIGNATURE, > + sizeof (EFI_ACPI_DESCRIPTION_HEADER), // Length > + 0x01, // Revision > + 0x00, // Checksum > + {'A', 'R', 'M', 'L', 'T', 'D'}, // OemId > + 0x4152464e49464552, // OemTableId:"REFINFRA" > + 0x20201027, // OemRevision > + 0x204d5241, // CreatorId:"ARM " > + 0x00000001, // CreatorRevision > + }; > + [SAMI] I would prefer a static structure locally initialised in this file and used in this function. Can you fix this, please? > + Header.Checksum = CalculateCheckSum8 ((UINT8 *)&Header, Header.Length); [SAMI] I dont think this is needed as the checksum is calculated in mAcpiTableProtocol->InstallAcpiTable(). See https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c#L241 [/SAMI] > + Status = gBS->LocateProtocol ( > + &gEfiAcpiTableProtocolGuid, > + NULL, > + (VOID **)&mAcpiTableProtocol > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "%a: Failed to locate ACPI table protocol, status: %r\n", > + __FUNCTION__, > + Status > + )); > + return Status; > + } > + > + Status = mAcpiTableProtocol->InstallAcpiTable ( > + mAcpiTableProtocol, > + &Header, > + Header.Length, > + &AcpiTableHandle > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "%a: Failed to install SDEI ACPI table, status: %r\n", > + __FUNCTION__, > + Status > + )); > + } > + > + return Status; > +} > + > +/** > + Install the HEST ACPI table. > + > + HEST ACPI table is used to list the platform errors for which the error > + handling has been supported. Use the HEST table generation protocol to > + install the HEST table. > + > + @retval EFI_SUCCESS HEST table installed successfully. > + @retval Other For any error during installation. > +**/ > +STATIC > +EFI_STATUS > +InstallHestTable (VOID) [SAMI] Fix coding style, please. VOID and closing brackets should each be on a new line. > +{ > + HEST_TABLE_PROTOCOL *HestProtocol; > + EFI_STATUS Status; > + > + Status = gBS->LocateProtocol ( > + &gHestTableProtocolGuid, > + NULL, > + (VOID **)&HestProtocol > + ); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "%a: Failed to locate HEST DXE Protocol, status: %r\n", > + __FUNCTION__, > + Status > + )); > + return Status; [SAMI] Fix alignment. > + } > + > + Status = HestProtocol->InstallHestTable (); > + if (EFI_ERROR (Status)) { > + DEBUG (( > + DEBUG_ERROR, > + "%a: Failed to install HEST table, status: %r\n", > + __FUNCTION__, > + Status > + )); > + } > + > + return Status; > +} > + > +/** > + Entry point for the DXE driver. > + > + This function installs the HEST ACPI table, using the HEST table generation > + protocol. Also creates and installs the SDEI ACPI table required for firmware > + first error handling. > + > + @param[in] ImageHandle Handle to the EFI image. > + @param[in] SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS On successful installation of ACPI tables > + @retval Other On Failure > +**/ > +EFI_STATUS > +EFIAPI > +PlatformErrorHandlerEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + // Build and install SDEI table. > + Status = InstallSdeiTable (); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + // Install the created HEST table. > + Status = InstallHestTable (); > + if (EFI_ERROR (Status)) { > + return Status; > + } > + > + return EFI_SUCCESS; > +}