From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.6506.1674878328512307311 for ; Fri, 27 Jan 2023 19:58:48 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=V2kITa3C; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: zhichao.gao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674878328; x=1706414328; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=XWt/jppmxQdIXcEiMp1OQPSOK/2wdKEdoq2LOyFMwtQ=; b=V2kITa3CEfF5BN6DulTfeLW2gyaM46EniqyS/94uEidlhXBcX0afVneM 0MVWbPv5xAKqPs0PJfgwWTffGvbngs6tWOXEXaztlXztnKw7hleDqXqiE a0eNPMY0dYsEtsllrtoFMb1vORO9qfw8U5AXHwARC8oHXIOwvytDJFE8v 0BKFsOXYJiamo7fwXLpVaFJ0sQBgsGUkp2ByDBacRVHKoEo+nnjZSJ9z7 pw1rnPhjXk45BNqGJzg2vOtdNpqZ/sxWqlzxBj9evcIdvSEh9PELC2XDG WoPUhjpGRSZFqcwxGd1O8H3xd1nuqaxULuq5+Zo7O1HBd2HdQ6FRVt14J Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="310882842" X-IronPort-AV: E=Sophos;i="5.97,252,1669104000"; d="scan'208";a="310882842" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2023 19:58:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10603"; a="908878964" X-IronPort-AV: E=Sophos;i="5.97,252,1669104000"; d="scan'208";a="908878964" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 27 Jan 2023 19:58:47 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 27 Jan 2023 19:58:46 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 27 Jan 2023 19:58:46 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 27 Jan 2023 19:58:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6bor/rKMU5m30ZAJEt/gny1jppyc0OL+oHLMjUgViH5gBSAoIswv1/F3i4XPOADMozZ41WyaM9HnLOQxrggsJ4WzF4t4+AAkMy5WsqwjNDa1TqXaOB3OFLMzz9Dmc0vXhXOOyQA7urVb8qzSmAQbm1yuwH67prVuYN4ERUlY1ugWOo5Nxo1Zxhr0IvSAHmYDiLTRD7ipaXbjcEuvd5KF415uGgYV8eRw9sVKzZCbPfbV7sH8cFV8vJ+HFxtvf53bTU2oHpktBCMOYSsYT+tCbFycO7RXEaHSHXArZ309YPzQIMGCtVG+bN2ZUO1IPZNSdjKfmUhBtzvNp6x/aillg== 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=B9iuYQdvxAR9/zhLq60Dh6tcqySeVYjusOzx6chp22k=; b=XH37el/f0kR9QWVb5hb95xpPvemJavCjEOdtFl8+PJT89fKf4Q/83F77jpmEYNPAeRxuZtprN20sXxEPPufUOuRd5T3Lboj7G/3N6DF8UwW5ySSUC6ubX8xYFxR7lQI/noN2Mg+bXKscGTw66rOzhZ1aNQ6qtPbopkRU9Nm179mxpIK0HHhiVCxbEDx2rmNj/vS9gTivVV82WO/k+taT69cj7E45t7+bg/1xk/NnDTX1+f5bVlic/l5VMI4LpDPr7yTwyZyZ7iezduTDVLE0Y5K/leuEdLTpPNyTYCEygZAb12SGnEJaFDdxP3Srr4bxrGWd5mgqUQlfx0w8ztDbfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH7PR11MB6377.namprd11.prod.outlook.com (2603:10b6:510:1fb::13) by PH7PR11MB6029.namprd11.prod.outlook.com (2603:10b6:510:1d0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.25; Sat, 28 Jan 2023 03:58:45 +0000 Received: from PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::5f27:d428:eb21:fbeb]) by PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::5f27:d428:eb21:fbeb%9]) with mapi id 15.20.6043.028; Sat, 28 Jan 2023 03:58:44 +0000 From: "Gao, Zhichao" To: "devel@edk2.groups.io" , "jeshuas@nvidia.com" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Topic: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Index: AQHZBOoiSrp8Q6JeHU+4+NIsTgkCj66ggWcggA3hDQCABS0SsA== Date: Sat, 28 Jan 2023 03:58:44 +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=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB6377:EE_|PH7PR11MB6029:EE_ x-ms-office365-filtering-correlation-id: 206f8bd3-44f4-4eaa-1c8a-08db00e3f34c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HoNC7zhND5Ven8bneB6rPzblzUd+Tdc/huRYxTeJcPhI2JyLSQEzxZCNZ0XnsnrtnIRm2Zy3gcygSEFMn2jGbpvMl7pdrnIwhJeLLxEFGH9IOs1qhwVNoR7Cgx2ohxZiEUNWrW3hD4xho5VFmk8Hvko55n4foagzhLuXzQoglLSRWgNg+ClA+mgFROJua7+zathisAlfUyC/e9nzxzsmBOsU1DGCHOIzjrpTUPIpo+DRy2JWkBq/BAWcNOPQ7U53j0Vd0How3fPCd1zyrOXB9rXZ3b7u8CpehMZBekXUdrGxJkgzZj2cBgdd9xbXumdqnaCCvROLH5vnTpavQCzHgtci+UYcM255t2b3tdZfKIS2S1oGd9dFX4F/iskhhWSKXgyD2U5VXenRbI/a16PbYtFVfNUoXqqz+5RWuNC19lbPNpR8BoN8qIcf9nh3dvkIOsIPzIiEgo5n22EOABWTdNCFTVaUUoPkc/+jnDfxAP0wrDsN7vDNh+MWt3KaP6Nj8qncO81G//VnXpnY5LzYwR4fjutNPHlrT+1ToScZDaybnZu8QkpaahYkTd+oh8b1GMKNmsAsaR72gwCzAT1+Sw8mbC9OVpTHTkcyEAS8xOOroCPklOQQFCQjollLyUqH3GiIQ9+88ZmLrnpPARVVE8RHxTTnpDDyMT6NjGecuiDbBNUZqVHzveS9oM7Nf3cZQg1ui6EZfzWeefTDgBIP3sLYl/V6MZjEVDEwJ+g4oA3o1Wb3rx5r4X/MlPMiOpUA+HWEYw9laRb6CzZ5w29wlA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB6377.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(136003)(376002)(366004)(396003)(39860400002)(346002)(451199018)(86362001)(2906002)(33656002)(26005)(4326008)(66446008)(66476007)(9686003)(53546011)(8676002)(186003)(71200400001)(66556008)(66946007)(76116006)(64756008)(7696005)(110136005)(19627235002)(316002)(107886003)(966005)(6506007)(478600001)(38100700002)(30864003)(5660300002)(38070700005)(41300700001)(82960400001)(122000001)(8936002)(83380400001)(55016003)(52536014)(66899018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?tQG/XXExSMAu1XbgltPoG66KPI0Vrp8hyo3LX+GX7KCYKorp+UcY7hnLNHYW?= =?us-ascii?Q?ZchOmzxtb65I3DQtP5peZp7a/nRbLbOO257WF1v0f/6UHBAyL3ew8gCESa9u?= =?us-ascii?Q?164C0aB/NgyMeiCQvdpbovoHeFOT5ORXceN0SrOE1zWBeAQwkWn3NOF8jmhQ?= =?us-ascii?Q?JEdCYCJ4gJJlLgQGc6WPouwqDwkfJO+79B+++Y6xMkUq03ecAikLBYOGqKdQ?= =?us-ascii?Q?ZbMPTWzKuzAs9CUv8R3a4e0WhOA3FIRRaSWjyu16Kr480Xj31ahb2QBFmbei?= =?us-ascii?Q?fulQfQ8+ZCPQn1i6SXem/Ka8A8UF/KmbQ+m5/DHOcLwwZka2493MzjenQiMx?= =?us-ascii?Q?FHFnLewAiDQPIfB+tiDU0drVhQipvOJxsvkrugXZdanYb8EOqP/HLGW6t9pY?= =?us-ascii?Q?eewC44X6l9x7ljcpTVeSL/sth1VMKrypTQTQcPFUpLDn/SgWtlOl8nkXLnZ8?= =?us-ascii?Q?3WFv+DJp9VlCkrJO4LnQkXbjNt8rudpvAI6UG2aW225Js2NPIAL7ZYV9xT2P?= =?us-ascii?Q?EuALMUxQ/jG4+jbGQadkuNGiBwB+diemX1LYr81L98PJ1Joe7KGd5VyrpST3?= =?us-ascii?Q?RMNHDUZRen1gOz604LBunK9He5bP5bccr/LpCm2mwnrjHP+r3bAosbn01p5E?= =?us-ascii?Q?yLWyafQ/EeUYWsJ0ADbekEUh8l/FqTuduYgjrkJlx5b/4fhqFoATwspOs9bI?= =?us-ascii?Q?ONp8BtHYdKleXV254TrbvxcxddGGd3kJm8vxzxt5byOV/e5ym8r1ryja42nU?= =?us-ascii?Q?jE+lZPFau8x5C9pnsZeMEYpU/lwe/LQB4s5DoLUQJjpA+2JO7XXkOx3XG6KY?= =?us-ascii?Q?OmhDgQDMUUFK94u7tXxWPNSjoS3GIKVn668OCWWiutP7aHqAghtRg3Z8oJ47?= =?us-ascii?Q?0JACrrj+an6qjQBTsQM50sC7bkGKVJX2TXRdyKqagdYGfuYOcH2XPnUrHKRV?= =?us-ascii?Q?el+hu5/d0VQ7l9UDrp94sFohtgecw6rxGTfHVlN8+8OiYgHZlgp4q4cI2zUf?= =?us-ascii?Q?xfC8IBC7DuqNWHIj73bAcbcoD1StiO9TPBdsPQUTaqieVVMcE1FOded5Sxhw?= =?us-ascii?Q?NcMPe56L0MtG8nBqJ6TN69n3Z8Mq476SNQ3IqiqE+y/TuHhukrB72QNbt7RL?= =?us-ascii?Q?2rRV6vVJ1TCRoHQfwl6EoT0ARGCbSTFROfIygokPtRXmRrAlJzp7tmGQytBw?= =?us-ascii?Q?HvWWFnnrlgzV4gtI/XOD3+hg2x/Q2gDdBLRrbJ2KDZUPwYDEt46QgVK4Qiqv?= =?us-ascii?Q?DieZVGeL8kVEW3mkLI3BTFDfIL5cZkGoJ/cY0HrmOWMRAyP8MWvT9jubjuhN?= =?us-ascii?Q?NJdHwBrS7Y7Kc2j/ASc6M3GETwf2eSAuJ8M3+0yIfP96rLvbLHGQ1t1sMN9h?= =?us-ascii?Q?XN1Yb0OwhkXs7kL7rXZuEjpGJveUs6NGlQpfsUnqBo6Mb9s300vYdaMKtLpv?= =?us-ascii?Q?f68Vq0npfm9pqzLN75y0FMNOwXG+UtdUsa1MJBg8MoVVZLkvuKfqlVWnrAEu?= =?us-ascii?Q?gnWlnzLMxqSTwhBnsZ7IAqqMv3ucvXFdX4A5GLc1kPTH0nTZ7C4XMFFUxwb4?= =?us-ascii?Q?n0JOIfM7rHNrDYjeamOI+f0Nxvg1GW1po1bPR4QZ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB6377.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 206f8bd3-44f4-4eaa-1c8a-08db00e3f34c X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jan 2023 03:58:44.2016 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xIKFbMpqRnKHC/IOfmttwOFlAzGNhfBtiHaQTQW4saAD0g7KmajCQCJcEuo4veLJ4FjcLz0nJGCu2EEIpOT48A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6029 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can you share then code change link of your personal repo? The patch I down= load from this email cannot apply to the open source branch. Thanks, Zhichao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Jeshua > Smith via groups.io > Sent: Wednesday, January 25, 2023 4:55 AM > To: Gao, Zhichao ; devel@edk2.groups.io > Cc: Ni, Ray > Subject: Re: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser >=20 > Thanks for the review. What is the next step to get this merged? >=20 > -----Original Message----- > From: Gao, Zhichao > 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 >=20 > External email: Use caution opening links or attachments >=20 >=20 > Reviewed-by: Zhichao Gao >=20 > Thanks, > Zhichao >=20 > > -----Original Message----- > > From: Jeshua Smith > > Sent: Thursday, December 1, 2022 2:31 AM > > To: devel@edk2.groups.io > > Cc: Ni, Ray ; Gao, Zhichao ; > > 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 > > 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. t= his > > > > + 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. t= his > > > > + 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", > > + *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. t= his > > > > + 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 > > + (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, N= ULL, > > ValidateErstAction, NULL }, > > > > + { L"Instruction", 1, 1, L"0x%x", DumpErstInstruction, N= ULL, > > ValidateErstInstruction, NULL }, > > > > + { L"Flags", 1, 2, L"0x%x", NULL, N= ULL, ValidateErstFlags, > > NULL }, > > > > + { L"Reserved", 1, 3, L"0x%x", NULL, N= ULL, NULL, > > NULL }, > > > > + { L"Register Region", 12, 4, NULL, DumpGas, N= ULL, NULL, > > NULL }, > > > > + { L"Value", 8, 16, L"0x%llx", NULL, N= ULL, NULL, > > NULL }, > > > > + { L"Mask", 8, 24, L"0x%llx", NULL, N= ULL, 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)*(*InstructionE > nt > > 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/UefiShellAcpiViewComm > a > > ndLib.c > > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > ndLib.c > > > > index 09bdddb56e..d37ad7cacc 100644 > > > > --- > > > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > ndLib.c > > > > +++ > > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > 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_SIGNATUR > E, > > > > 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/UefiShellAcpiViewComm > a > > ndLib.inf > > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > ndLib.inf > > > > index 63fc5a1281..904fea83de 100644 > > > > --- > > > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > ndLib.inf > > > > +++ > > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewComm > a > > 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 > > > > >=20 >=20 >=20 >=20 >=20