From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.86]) by mx.groups.io with SMTP id smtpd.web10.27798.1674593712163021431 for ; Tue, 24 Jan 2023 12:55:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=iBX7zegp; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.237.86, mailfrom: jeshuas@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BVdLkR5HXM4dXk1NdQMXUlfd+xejEli1E4K9HgzKNitveMJ97pPUdda9qs81B2IweS4qPZ/+9DpeMBCMwYDPqNcmH0g385yfsyu3hvBcYHoPY/nfxwQKM+gG9WA6B/3X5lUQJl5heTaswq0FsKSsdYn4i2oUkO/pMAyy0NNyfVrD0bUrVSVn2EO7bhCfkGGGt0AhAVJHw2n6vmoDylTD0obfQJat4Av1Fu3BlzZWaO9DrpW7GevWkFgofLK+1GiOlEP65x48sVbQXVVzuiGULcoExt5GPhcRrE8DSlpfc8Mlsr7kRNvSGbNfAetIdFQrkSKssWhu6ai4N/GyrWHyug== 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=bqmbXyENjE6zd4Na3cjfiSnXg4SjLw3+TT5hmTTWOtY=; b=TIVte5qUUHAB8OCUrjFvtanq6IWUCem3s3IvFrXZttjw6kSlMIRHmKVPAjKw5mrbiQmwuoAf9xmVRjepMXlHKkR/9/n9wx/Vkb9J3xwrsmw1acrCIkM7HFFy/wtPYRTD6PZg1WtfUsDq98f2uxfYhXs3B/S6wh3Pw+wxjGVY6QH+emz70pQ905uP35GH36TNMBVGxXHAkF96LP9VmylKZ5yqecVirme/tfxdDexXWRvuJzL86nYF6fmgyGtYuq1d99LOlBSWxbUqOom43ATlT1SRb61ZVMdsSPXjGwMJ5eLTIETSgP6VJmiv5e0LxA3yRt3F6x2EgBLfdFLIy+uUVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bqmbXyENjE6zd4Na3cjfiSnXg4SjLw3+TT5hmTTWOtY=; b=iBX7zegp30QnvEMc3qEZ4nOjPLRD+xdT1NjhNxYw4R2bs2/7qRaL3+lsul6bFA6xdtzT7jonAwqEnLyuWyJlS5bexfhlJsje8cPInqHEEiiFnMRUrKNZFhpe3fZWZTAmhHKiLkdWl/PiY7Cq3fTe0dO5Re2/h6IxfqictAfB6Y1TyIWy1I9TQ3lDlP58cLTy+zdrSJJT0dPY3QbFbpnwKpIY2k1k4QLCOFKtWmtl6MvYnkyXYEIRwG1lKpVqhEP5BxI3o2SgISZFCwlar2BQxFnO1m/sC13q4uwb0pjbdf3ZVLYl20UW5LjfwRt5utnlHYso+pIgvMmhlQmKVwMUDg== Received: from DM6PR12MB3371.namprd12.prod.outlook.com (2603:10b6:5:116::27) by DS0PR12MB7703.namprd12.prod.outlook.com (2603:10b6:8:130::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 20:55:08 +0000 Received: from DM6PR12MB3371.namprd12.prod.outlook.com ([fe80::d52b:f6aa:20c9:6cbf]) by DM6PR12MB3371.namprd12.prod.outlook.com ([fe80::d52b:f6aa:20c9:6cbf%7]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 20:55:08 +0000 From: "Jeshua Smith" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Topic: [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Index: AQHZBOoYyhC+NCpeNEepgzG3w9X5qK6ggY6AgA3gikA= Date: Tue, 24 Jan 2023 20:55:08 +0000 Message-ID: References: <998e19f8df9167c20b4b7bfe5e9ecac0093fc132.1669832339.git.jeshuas@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR12MB3371:EE_|DS0PR12MB7703:EE_ x-ms-office365-filtering-correlation-id: 192490cb-cc62-4d5d-fe4d-08dafe4d46dd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CHzzpBta5fyWAhGnIwDKu4mzqyLc+rImF5utX9J1D2dv0/A51lbJf/IKmHbUWGUUtYA5l+FpiaSEv5vwr6GxO/bDaZCyQWVivRkQ1opqiY57ri3DzWIYFOx1K85BuBxIDMq5ajZ+SP9lcyTSMAAdnNcQccNC7rKOVNCEuZla+Fa6gcP5oG/Vffu1wJZ0IRD8n9iRakFQawJW1Ix7fwFQ5rbJQELUbWaE6PEtOU6uB/y4li+E1vizuKIayY2VXm9EwuUlpqwaa8IUBfKkiM0UhANAQJmUDs5aAOWFPJwF4bzDi/GFrr8h2qSD4AOCF9dTA0910Se8iVoDFQEjp6FCSfTM73EaWiTlqrsW7WGItvwRu9EuQG9hjgB6TvFGXbURnSEMgQ/k1/zfGS169WBG4jejotf5D95a20QY5zbGvmOe3JyFNo2bR8lfvbWunr96NYTNxWU9lu2kcjxmdGFmVm5PIyhC2eOZYWD23Dvb3AYeE6ZhhAGx6GO2QLwOPBqi52iwwWFmgAcyPg+lY2kJX0Pcc/sLRumKG2eCyK3QdoddK9MT39hD1QbdS+DMpfdGXkdOk+uIoN7bwQ/a3mWk/R43a2IfLuG6HNG+lUz6xirzPF8lj8zz90Ibw2Rg1rgaqO3mfVynst5lWIJ43QuK/mHlkz1nGupjhOttyMnhwA7AuTYJSteNXonp6+ovrdoArj0y4tUyEXdGnZCpRL/FPA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3371.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(39860400002)(346002)(366004)(376002)(451199018)(122000001)(110136005)(38100700002)(66556008)(33656002)(55016003)(38070700005)(86362001)(478600001)(316002)(19627235002)(64756008)(8676002)(66446008)(76116006)(66946007)(66476007)(4326008)(53546011)(71200400001)(7696005)(6506007)(2906002)(186003)(41300700001)(26005)(5660300002)(30864003)(9686003)(52536014)(8936002)(83380400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1wpwQXWJ9mN+wUETTkD+VK0suT4VV5+7JRbbB6hgZsF7dWtZg0LiVlOCOPcy?= =?us-ascii?Q?FXQMiWCeHYShQUG/7sFUwtIRKlwIMdH3gZKise/crxh0vP10j0LLQi8aeEiu?= =?us-ascii?Q?uTWjIGT/VnZJ2qY7ARKtN2sAGkqKCBC5k3J+6CChcTDgsvGaI5iomL7F+9lO?= =?us-ascii?Q?GRfuQ7gHCpimu1fvo5iSNbwtsx717rH3ZW0psandbNCbNkjx71H2yr87Dwj+?= =?us-ascii?Q?fw7ymvloOBWrMeBL3YGHgqkLdOTwQe51jAugiwFGiJZkEnxe/H6319bCivpE?= =?us-ascii?Q?oAOuF7b7LfM6+aCr9FEF0F0PJtYtbm77aucuoCMcU42rXe3kY+/GSCPJkTDo?= =?us-ascii?Q?pzYhoaJ8WMlKM3nphOrxqxXO5bkahUETxvQGPNnI8BaM14bgTKwF1wxae4bi?= =?us-ascii?Q?uOehQY0StR7P1lsRi9k8S7yNiwtfwlJCMYgsfRX3BuPE+0XMbBp6tELNl5hR?= =?us-ascii?Q?BIsausEAxJhLQriPEhM4dleIDpHx21K3jU1w2U3X/uuWOhKlpQVA/zmMHtTu?= =?us-ascii?Q?qdkxgZJP8NriGyxHClcZEiFJOLrx7ltF0+5Y9DLg7YQqnvTo8PnOQcLqPBuQ?= =?us-ascii?Q?1cRFZyK87VyG21arJrezylWjVOvoHI3f2ErSyMaHmos0WvdnwROJtW4K6Odr?= =?us-ascii?Q?AcENsgbyPS497UhxU1suZ01+fDRvQnxq+d3IDCgXxdNjuie50Q7bEee8s5d6?= =?us-ascii?Q?+qYUQXJZLAP+bgMXMVS661kPR25x3s0W7HIuNTdEDf0rRhA/egt2GB5dlOGS?= =?us-ascii?Q?Fa9iorScrT5YRZ9dPtyIlXPT3QuisfGl1ZHiYOnglSRFHspDTTKRFs1iFc9z?= =?us-ascii?Q?sEzWpwLzHuwxktjws1x16eYOe85OZDw2Ng5SejdieLDHgodEl31qtvsQmkFI?= =?us-ascii?Q?W5LMxu2qTd5eZB+zpXLtAbQSy8yRwdU51733FB9/uVzNod9XYLJ++y9NSiNP?= =?us-ascii?Q?hByZzFLJeFh1564aAP+h2JXsCm/Sb4qRrHhOp/sP+YLyXC5JeZ4gkzFjeZMa?= =?us-ascii?Q?6vwh81kdDZAFrxutvUmKg0tPEV0zRPGDZze/waASv0kH+HHWUBVS2XJazchu?= =?us-ascii?Q?5OnH+nWxzWzdZl5du0YQUiJm4hs9S4f0L3pcmU/kCyGPkPwRmfjiolk6wMy0?= =?us-ascii?Q?fhptnejdNcOF8yuyWDDYOXhLoxQDSs0pb9UWIbPyGyRgf9um7Q0M4vDz379f?= =?us-ascii?Q?z/R5wz4f0T8/jmv6SB7ozq/M1psh0s1DMn9QdrwM9duZ9yYw1K+eq4ZNCLnM?= =?us-ascii?Q?aRt9EI95nXko6UJzes3GIL+PizGf2Oe9kmYYMSwKxkg5LcyyPQ2NE67etXJt?= =?us-ascii?Q?Nl9vfZqYS5Kp0uyuWVkclm2xMoVmZIxHw+j9bNnwpelTonVgme69jVrHWNUb?= =?us-ascii?Q?nwIiE86aIB+fI/sYwxyhhzTN01PqkIyF20+9NtWs4dQ14vYpaTbm3Apczu6Z?= =?us-ascii?Q?BDYsWkuHiClO+U9ns1osaJcbflfLzwkT0XeUQuy6B/4GF11DHPloGcRMAmVw?= =?us-ascii?Q?oTmxOCWt6pZawaohnYUeavvkZEajvQ9FtpOvxVijGqswxqoYhvtRxHmbithu?= =?us-ascii?Q?o+CKizrvolUN8u+zGpd+85o1GAf70VVzi6r8pJ/P?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3371.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 192490cb-cc62-4d5d-fe4d-08dafe4d46dd X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2023 20:55:08.0768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xmFhtI9aPnWDAJXl6QZdSL55FzoOvJq0noo5lz31eTU5pNEBcbd90zRPU428dpvFoOOwSsKa6Ng0qu9gIwrcmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7703 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the review. What is the next step to get this merged? -----Original Message----- From: Gao, Zhichao =20 Sent: Sunday, January 15, 2023 5:59 PM To: Jeshua Smith ; devel@edk2.groups.io Cc: Ni, Ray Subject: RE: [PATCH] ShellPkg/AcpiView: ERST Parser External email: Use caution opening links or attachments Reviewed-by: Zhichao Gao Thanks, Zhichao > -----Original Message----- > From: Jeshua Smith > Sent: Thursday, December 1, 2022 2:31 AM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Gao, Zhichao ;=20 > Jeshua Smith > Subject: [PATCH] ShellPkg/AcpiView: ERST Parser > > Add a new parser for the Error Record Serialization Table. > > The ERST table describes how an OS can save and retrieve > > hardware error information to and from a persistent store. > > > > Signed-off-by: Jeshua Smith > > --- > > .../UefiShellAcpiViewCommandLib/AcpiParser.h | 22 ++ > > .../Parsers/Erst/ErstParser.c | 278 ++++++++++++++++++ > > .../UefiShellAcpiViewCommandLib.c | 2 + > > .../UefiShellAcpiViewCommandLib.inf | 2 + > > 4 files changed, 304 insertions(+) > > create mode 100644 > ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParser.c > > > > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h > > index db8c88f6df..66c992c55c 100644 > > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h > > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h > > @@ -1,6 +1,7 @@ > > /** @file > > Header file for ACPI parser > > > > + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > Copyright (c) 2016 - 2020, Arm Limited. All rights reserved. > > Copyright (c) 2022, AMD Incorporated. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -594,6 +595,27 @@ ParseAcpiDsdt ( > > IN UINT8 AcpiTableRevision > > ); > > > > +/** > > + This function parses the ACPI ERST table. > > + When trace is enabled this function parses the ERST table and > > + traces the ACPI table fields. > > + > > + This function also performs validation of the ACPI table fields. > > + > > + @param [in] Trace If TRUE, trace the ACPI fields. > > + @param [in] Ptr Pointer to the start of the buffer. > > + @param [in] AcpiTableLength Length of the ACPI table. > > + @param [in] AcpiTableRevision Revision of the ACPI table. > > +**/ > > +VOID > > +EFIAPI > > +ParseAcpiErst ( > > + IN BOOLEAN Trace, > > + IN UINT8 *Ptr, > > + IN UINT32 AcpiTableLength, > > + IN UINT8 AcpiTableRevision > > + ); > > + > > /** > > This function parses the ACPI FACS table. > > When trace is enabled this function parses the FACS table and > > diff --git > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParser > .c=20 > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParser > .c > > new file mode 100644 > > index 0000000000..e2af0c44b4 > > --- /dev/null > > +++ > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstParser > .c > > @@ -0,0 +1,278 @@ > > +/** @file > > + ERST table parser > > + > > + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > + Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > + @par Reference(s): > > + - ACPI 6.5 Specification - August 2022 > > +**/ > > + > > +#include > > +#include > > +#include "AcpiParser.h" > > +#include "AcpiTableParser.h" > > + > > +// Local variables > > +STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; > > +STATIC UINT32 *InstructionEntryCount; > > + > > +/** > > + An array of strings describing the Erst actions > > +**/ > > +STATIC CONST CHAR16 *ErstActionTable[] =3D { > > + L"BEGIN_WRITE_OPERATION", > > + L"BEGIN_READ_OPERATION", > > + L"BEGIN_CLEAR_OPERATION", > > + L"END_OPERATION", > > + L"SET_RECORD_OFFSET", > > + L"EXECUTE_OPERATION", > > + L"CHECK_BUSY_STATUS", > > + L"GET_COMMAND_STATUS", > > + L"GET_RECORD_IDENTIFIER", > > + L"SET_RECORD_IDENTIFIER", > > + L"GET_RECORD_COUNT", > > + L"BEGIN_DUMMY_WRITE_OPERATION", > > + L"RESERVED", > > + L"GET_ERROR_LOG_ADDRESS_RANGE", > > + L"GET_ERROR_LOG_ADDRESS_RANGE_LENGTH", > > + L"GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES", > > + L"GET_EXECUTE_OPERATION_TIMINGS" > > +}; > > + > > +/** > > + An array of strings describing the Erst instructions > > +**/ > > +STATIC CONST CHAR16 *ErstInstructionTable[] =3D { > > + L"READ_REGISTER", > > + L"READ_REGISTER_VALUE", > > + L"WRITE_REGISTER", > > + L"WRITE_REGISTER_VALUE", > > + L"NOOP", > > + L"LOAD_VAR1", > > + L"LOAD_VAR2", > > + L"STORE_VAR1", > > + L"ADD", > > + L"SUBTRACT", > > + L"ADD_VALUE", > > + L"SUBTRACT_VALUE", > > + L"STALL", > > + L"STALL_WHILE_TRUE", > > + L"SKIP_NEXT_INSTRUCTION_IF_TRUE", > > + L"GOTO", > > + L"SET_SRC_ADDRESS_BASE", > > + L"SET_DST_ADDRESS_BASE", > > + L"MOVE_DATA" > > +}; > > + > > +/** > > + Validate Erst action. > > + > > + @param [in] Ptr Pointer to the start of the field data. > > + @param [in] Context Pointer to context specific information e.g. thi= s > > + could be a pointer to the ACPI table header. > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +ValidateErstAction ( > > + IN UINT8 *Ptr, > > + IN VOID *Context > > + ) > > +{ > > + if (*Ptr > EFI_ACPI_6_4_ERST_GET_EXECUTE_OPERATION_TIMINGS) { > > + IncrementErrorCount (); > > + Print (L"\nError: 0x%02x is not a valid action encoding", *Ptr); > > + } > > +} > > + > > +/** > > + Validate Erst instruction. > > + > > + @param [in] Ptr Pointer to the start of the field data. > > + @param [in] Context Pointer to context specific information e.g. thi= s > > + could be a pointer to the ACPI table header. > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +ValidateErstInstruction ( > > + IN UINT8 *Ptr, > > + IN VOID *Context > > + ) > > +{ > > + if (*Ptr > EFI_ACPI_6_4_ERST_MOVE_DATA) { > > + IncrementErrorCount (); > > + Print (L"\nError: 0x%02x is not a valid instruction encoding",=20 > + *Ptr); > > + } > > +} > > + > > +/** > > + Validate Erst flags. > > + > > + @param [in] Ptr Pointer to the start of the field data. > > + @param [in] Context Pointer to context specific information e.g. thi= s > > + could be a pointer to the ACPI table header. > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +ValidateErstFlags ( > > + IN UINT8 *Ptr, > > + IN VOID *Context > > + ) > > +{ > > + if ((*Ptr & 0xfe) !=3D 0) { > > + IncrementErrorCount (); > > + Print (L"\nError: Reserved Flag bits not set to 0"); > > + } > > +} > > + > > +/** > > + Looks up and prints the string corresponding to the index > > + > > + @param [in] Table Lookup table > > + @param [in] Index Entry to print > > + @param [in] NumEntries Number of valid entries in the table > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +FormatByte ( > > + IN CONST CHAR16 *Table[], > > + IN UINT8 Index, > > + IN UINT8 NumEntries > > + ) > > +{ > > + CONST CHAR16 *String; > > + > > + if (Index < NumEntries) { > > + String =3D Table[Index]; > > + } else { > > + String =3D L"**INVALID**"; > > + } > > + > > + Print ( > > + L"0x%02x (%s)", > > + Index, > > + String > > + ); > > +} > > + > > +/** > > + Prints the Erst Action > > + > > + @param [in] Format Optional format string for tracing the data. > > + @param [in] Ptr Pointer to the Action byte > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +DumpErstAction ( > > + IN CONST CHAR16 *Format OPTIONAL, > > + IN UINT8 *Ptr > > + ) > > +{ > > + FormatByte (ErstActionTable, *Ptr, ARRAY_SIZE (ErstActionTable)); > > +} > > + > > +/** > > + Prints the Erst Instruction > > + > > + @param [in] Format Optional format string for tracing the data. > > + @param [in] Ptr Pointer to the Instruction byte > > +**/ > > +STATIC > > +VOID > > +EFIAPI > > +DumpErstInstruction ( > > + IN CONST CHAR16 *Format OPTIONAL, > > + IN UINT8 *Ptr > > + ) > > +{ > > + FormatByte (ErstInstructionTable, *Ptr, ARRAY_SIZE=20 > + (ErstInstructionTable)); > > +} > > + > > +/** > > + An ACPI_PARSER array describing the ACPI ERST Table. > > +**/ > > +STATIC CONST ACPI_PARSER ErstParser[] =3D { > > + PARSE_ACPI_HEADER (&AcpiHdrInfo), > > + { L"Serialization Header Size", 4, 36, L"0x%x", NULL, NULL, > NULL, NULL }, > > + { L"Reserved", 4, 40, L"0x%x", NULL, NULL, = NULL, > NULL }, > > + { L"Instruction Entry Count", 4, 44, L"0x%x", NULL, (VOID > **)&InstructionEntryCount, NULL, NULL } > > +}; > > + > > +/** > > + An ACPI_PARSER array describing the Serialization Instruction Entry > structure. > > +**/ > > +STATIC CONST ACPI_PARSER SerializationInstructionEntryParser[] =3D { > > + { L"Serialization Action", 1, 0, L"0x%x", DumpErstAction, NUL= L, > ValidateErstAction, NULL }, > > + { L"Instruction", 1, 1, L"0x%x", DumpErstInstruction, NUL= L, > ValidateErstInstruction, NULL }, > > + { L"Flags", 1, 2, L"0x%x", NULL, NUL= L, ValidateErstFlags, > NULL }, > > + { L"Reserved", 1, 3, L"0x%x", NULL, NUL= L, NULL, > NULL }, > > + { L"Register Region", 12, 4, NULL, DumpGas, NUL= L, NULL, > NULL }, > > + { L"Value", 8, 16, L"0x%llx", NULL, NUL= L, NULL, > NULL }, > > + { L"Mask", 8, 24, L"0x%llx", NULL, NUL= L, NULL, > NULL } > > +}; > > + > > +/** > > + This function parses the ACPI ERST table. > > + When trace is enabled this function parses the ERST table and > > + traces the ACPI table fields. > > + > > + This function also performs validation of the ACPI table fields. > > + > > + @param [in] Trace If TRUE, trace the ACPI fields. > > + @param [in] Ptr Pointer to the start of the buffer. > > + @param [in] AcpiTableLength Length of the ACPI table. > > + @param [in] AcpiTableRevision Revision of the ACPI table. > > +**/ > > +VOID > > +EFIAPI > > +ParseAcpiErst ( > > + IN BOOLEAN Trace, > > + IN UINT8 *Ptr, > > + IN UINT32 AcpiTableLength, > > + IN UINT8 AcpiTableRevision > > + ) > > +{ > > + UINT32 Offset; > > + > > + if (!Trace) { > > + return; > > + } > > + > > + Offset =3D ParseAcpi ( > > + Trace, > > + 0, > > + "ERST", > > + Ptr, > > + AcpiTableLength, > > + PARSER_PARAMS (ErstParser) > > + ); > > + > > + if (sizeof > (EFI_ACPI_6_4_ERST_SERIALIZATION_INSTRUCTION_ENTRY)*(*InstructionEnt > ryCount) !=3D (AcpiTableLength - Offset)) { > > + IncrementErrorCount (); > > + Print ( > > + L"ERROR: Invalid InstructionEntryCount. " \ > > + L"Count =3D %d. Offset =3D %d. AcpiTableLength =3D %d.\n", > > + *InstructionEntryCount, > > + Offset, > > + AcpiTableLength > > + ); > > + return; > > + } > > + > > + while (Offset < AcpiTableLength) { > > + Offset +=3D ParseAcpi ( > > + Trace, > > + 2, > > + "Serialization Action", > > + Ptr + Offset, > > + (AcpiTableLength - Offset), > > + PARSER_PARAMS (SerializationInstructionEntryParser) > > + ); > > + } > > +} > > diff --git > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.c > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.c > > index 09bdddb56e..d37ad7cacc 100644 > > --- > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.c > > +++ > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.c > > @@ -1,6 +1,7 @@ > > /** @file > > Main file for 'acpiview' Shell command function. > > > > + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > > @@ -52,6 +53,7 @@ ACPI_TABLE_PARSER ParserList[] =3D { > > { EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, > ParseAcpiDbg2 }, > > > { EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, > > ParseAcpiDsdt }, > > + { EFI_ACPI_6_4_ERROR_RECORD_SERIALIZATION_TABLE_SIGNATURE, > ParseAcpiErst }, > > { EFI_ACPI_6_3_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE, > ParseAcpiFacs }, > > { EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > ParseAcpiFadt }, > > { EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, > ParseAcpiGtdt }, > > diff --git > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.inf > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.inf > > index 63fc5a1281..904fea83de 100644 > > --- > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.inf > > +++ > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComma > ndLib.inf > > @@ -1,6 +1,7 @@ > > ## @file > > # Provides Shell 'acpiview' command functions > > # > > +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > # Copyright (c) 2016 - 2020, Arm Limited. All rights reserved.
> > # > > # SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -31,6 +32,7 @@ > > Parsers/Bgrt/BgrtParser.c > > Parsers/Dbg2/Dbg2Parser.c > > Parsers/Dsdt/DsdtParser.c > > + Parsers/Erst/ErstParser.c > > Parsers/Facs/FacsParser.c > > Parsers/Fadt/FadtParser.c > > Parsers/Gtdt/GtdtParser.c > > -- > > 2.25.1 > >