From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.53]) by mx.groups.io with SMTP id smtpd.web10.1988.1675190114845394265 for ; Tue, 31 Jan 2023 10:35:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=BzgoooEp; 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.93.53, mailfrom: jeshuas@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwojtRmVlCLRmOVI0fW1JN32VZv5N96QOfA/JVIaIymRNhAgONXef0HUQPEcmfmKpaIK0L+XRNPkfPLKyTwGU34AQC7a7Lj/43XDmFH7zmHdfvqMXndQiev40aujA4N1S13uXEwkss58bZhnVpIIWdP5GCTP0KqTiiLVZNedxU1zeoJkVsjJvcN9P6J9dXWYeiFok3JITvcyRIJ1+pGuGELAaQb8Bxo+jyJGzm0wxjCkrgZ9jrkgZ6hnZ64PGiWk7fKuBz7DCvZKv6GtDacBOx8jw2JNJ+FEoBqFQnLelYirOUCP4FyQLhaFMeNUs9/ppB5C6MEaqCNI5bES7jf2nA== 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=tTqgshJyTScYT3PhPPwx74lxS5e7pEq9J0BNStlm40M=; b=FUkIUvRsMpsdDtcnKDV6DFBYAob/dS6uB4BUWl2JkbnKForB7ualJ+DV0bmG7wrNURcSHsru7zATYwOSkqgVXPHu6ko8UrTlvzlBUvPh+AEN841bRt/FKm7sr7/ANhiQ49I4DDjEtI8/16TlbzmEGIfjyYNBW67tB0BobwA6Yt8TaSylz18l/fLzRDpBIXzKvVjEj0X7ix3g/EiqYcjseyWrQFeYS70WHbj0VdVs1bc3E3a6OrWC4NE53DRZGztdbHgR4EZI5zSdjjxoWmf1tbYf0T5EPSv6XnO6wr7+VK5enFBdf3CArW1taap5pcqUV84z7Bk0ejMxlqMa7SAUBQ== 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=tTqgshJyTScYT3PhPPwx74lxS5e7pEq9J0BNStlm40M=; b=BzgoooEpnDWOxKxsrTl8IZd3ScpM2h3cGTbV1JedFtCe8BqsYxEMSD7ZABV/PpYC76cgAQuS8Hs7XmhirWTlA7UIJ5jhgs/Dqi+YhwRLM6lMeqnWdCFRGVquNPz8W4nKWOeFfGT8v7U0E6scb2m/1u4Y5vv6j6kyaQ2NR2TG/T/zVe4tGviGBDB87SAJh5zKwcihfhzGXej0UK8mz/V8XO3C7nWD0V5peTdPC6cuiKL1y6lecUtDZEB8m2oLa3EGBvwKTJ2pyuqe/yq5P6kGLd2HP3RdmeTIGeqsQzq9xpLa/VpHDoNE73qswiV2pE/CZsr6ZpTE3wC6bVfnQ5C1bw== Received: from DM6PR12MB3371.namprd12.prod.outlook.com (2603:10b6:5:116::27) by CH0PR12MB5058.namprd12.prod.outlook.com (2603:10b6:610:e1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 18:35:12 +0000 Received: from DM6PR12MB3371.namprd12.prod.outlook.com ([fe80::16b4:6123:2a9a:8355]) by DM6PR12MB3371.namprd12.prod.outlook.com ([fe80::16b4:6123:2a9a:8355%7]) with mapi id 15.20.6043.023; Tue, 31 Jan 2023 18:35:12 +0000 From: "Jeshua Smith" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Topic: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser Thread-Index: AQHZBOoYyhC+NCpeNEepgzG3w9X5qK6ggY6AgA3gikCABS21AIAFq53g Date: Tue, 31 Jan 2023 18:35:12 +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_|CH0PR12MB5058:EE_ x-ms-office365-filtering-correlation-id: 9b1b3967-8d0a-4583-6b0e-08db03b9e360 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cpb7XD1N8fWPZyEAkSJGtU28dY1eepMfIUS/dHpzeS7bwVkh6frr8a0xHQM6MxvZzGeBVWb8wZUH0dWdqO0iqF9lXEdNorzmuw83ifgD7GjBm3Q3SootpYl3V2RXdYD5v5MgS15H7Z9lHkz1S0tPpDSfjLK4Ugv/0kR6qeBqTaiEATWsLQKG9dNdQF1wK4ohB7qp2/SoH7RSqYi84Q2nh/GhFfIw9RsXbAkZVZrjPMrQOo0MY5x/vA/L+82B4BxTePH4bMNKvhafqIgruITiyXEEGR1bcrl+3sb5cQGt77Oiua68Jeamw6y8qlbe35LNL95EsLnt9p9yfPccP184nGaFLKgpbgrjPiwqDHJqCS4FNoJtzlBaZzo1ieVMvZZd51ETEBzY5by+7vl7TmHJfZKA9551vdfPNuDNA4244jPHvhEs1o0UaEuD7IOsMWYb9z2qyZHbu5gGXI+lR/RjvNLA6EMbFaAp0Ciwvr2gUG2zhVfk85hsQsovCG7Th6ZML8NuvUBRY4yWDp0AvTXE42rD+VsMWcx6iqptcAoULnhn9A/mTvIOUAUc6dB46C476VBO6SVllU9rogrBu5hCZWfnW163PqLtTnsmATTOzpaZVegUnP18AfFdsm+3bBKfcJQiY7e4/SVLvYoS9Z35IJgCbGuUmYZgmtRe7LA/Wjc1JBstDowsYatxReOhc4TqAdAWgklSkI9acyvV5Zu3jSiGFTqtsUmsrhzCie0u8L0= 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)(39860400002)(346002)(136003)(376002)(396003)(366004)(451199018)(86362001)(38100700002)(38070700005)(76116006)(2906002)(5660300002)(33656002)(71200400001)(7696005)(110136005)(966005)(478600001)(52536014)(55016003)(66556008)(4326008)(316002)(19627235002)(66946007)(8676002)(66476007)(30864003)(41300700001)(64756008)(8936002)(186003)(122000001)(83380400001)(9686003)(66446008)(6506007)(53546011)(66899018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WAQW5WNQEcU5wlVxk3lc0+j7yFD78GT3h4Om7k0JXE+5Zaz+19wvAtDjevcI?= =?us-ascii?Q?GaSdLBKfTKFdGZZlK9mDLnNbaYP/nWTvVlEGp6GC6E0sWALk7Hq8lZkN0MVo?= =?us-ascii?Q?yfbUyjjgIUPTEtQZ+rQLbdeuI2WWbOUhSh4DXbC2UXE0+/9QJllz7O8ndHSu?= =?us-ascii?Q?6UMzLWBZ5aR8RnsenPA8YNmyCCBWC4sU7VSs4e6cQIjwbmximKIpXQdstRFQ?= =?us-ascii?Q?abu5WO3v65rEEMgsy0WFlL5eg/K9ZkG+gzNBQoZEUvJlBZXe72rATvDV9sHu?= =?us-ascii?Q?KVjLfN14SdMUxaj7susX8N2SPnXg2t8l2M2+IpA9sHCNw/L+R4B3uqhK0T/0?= =?us-ascii?Q?UCu8UoMil4nl6GBZ2YAywjqxdostwZAlz4uHA71CmCj140hobu3sgObEzJYD?= =?us-ascii?Q?Xf58M2tgxND2R1TCiAb2hOJhUoGA2BfqofrJwVhTbptDinWR2dtRrGQ44K65?= =?us-ascii?Q?76+7Onqrf3gt9pfyGNFWCl8sVz6XWBBIY0+TrWloCwU3Gh9cKKo3k3M6wAH4?= =?us-ascii?Q?ySPTHjTNGLoabUMl6zxZohDKD7SVJB1tCVOwu+FSln1Jek+GC2Ly/Gy0Tkkb?= =?us-ascii?Q?BU+lPSr71W0cRyDdjtpejQejeH+Iip9G9Eua2eda4FltLKZpaCQC25TpFTRZ?= =?us-ascii?Q?ItJbOsEIs7AKNl3dqtPRc2Wbi7B1byZPd/F/6DZutwQw8k+JoUtBMUT+Ad6u?= =?us-ascii?Q?cZy2zO3oE/ndP3o6qmecRzxY2yD/wZOM6rKQWbHl56t43FI3suYQoBKLHXoH?= =?us-ascii?Q?YKLMdWFob55TGw0fca/Qli9kTrRNuIrxq65HjX8K3CEIayowTTEGsHMDLnw8?= =?us-ascii?Q?qVc7OYJrvx0vK6N3alZhOU80V1MesLWOt2RibEO3G1wl2DW2AxJejjN6lxNl?= =?us-ascii?Q?4bNKrN0sMWeIrBdUgk8NYCPRk2NfY09xYEH0JfD8tgbj1c95GQYCib6V7rb2?= =?us-ascii?Q?4zh0ctyy8Jnn/08v2Og3J3q+uyziOZoq+STYb9Z6/Y+fYlYmqcjczbFdKrLD?= =?us-ascii?Q?4f81wIQTU1TLLSUa2sL8TIaVO2RWWZuBaBCVlDLVAU8XmKcixodPQG73UKEp?= =?us-ascii?Q?2+Dx71mRJbjiIPiMNs0dtj5YNoGAgxc32olS4Oyevm+/E7HCTKzBfL3NgE4a?= =?us-ascii?Q?1ERCl88I4iR9WExN9V3qzhUsOzgrJzASVFAYu0igAMl85MqAjNFbvJ6Q7p9L?= =?us-ascii?Q?QqMStIWHY+u4jVmlbOCcHIzwk8c9FI5o7olFxYBmYdR9QrUPDi4hR2QABmE+?= =?us-ascii?Q?OJdK3DIcMc1o7KZ/STeju0LSTU4d8bAfQ5Gkyu/P9p+b6wUHzhZYWp1VeNeT?= =?us-ascii?Q?38grTQ7DtUi4Rgs5eEo66pwcxGX7TujlgCdIv1drqCI+Dwt8upELaDxLJ4T0?= =?us-ascii?Q?8b6+fjTiPgfPUyorDNuLWOHBjilmflsH+jJ8zN5+7dj5JoOaU7q8MJVNvY8F?= =?us-ascii?Q?c1l5L8JhAnJWTPr5xMHhm/sseKBuDeqo86VQVE/POG1tUPBGHHnDymcLQ0pa?= =?us-ascii?Q?iJIgTuprWUqbEIbHPP97eEgUplvsFn3H9oph4KggTKEJruNi2C/DvuLfqK9t?= =?us-ascii?Q?YSAlhZogN85mR5DJ7xM1Mu4fKeAMX6yFbnbJUbIb31dJX7aw/e/mHTBmztyi?= =?us-ascii?Q?dlBMf1lDzi2z7eBxVadL9x1uNABMnU5y8THr3/Bl34WS?= 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: 9b1b3967-8d0a-4583-6b0e-08db03b9e360 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2023 18:35:12.1480 (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: CoZVkixcgvf1ZZFU4LHCifFyTbqll3CQCb4QtACk86lAbGY0p6KxFEEFNKjPoVguz4j/XcROWLU5jEmc9fGBow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5058 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks. Does this work for you? https://github.com/NVIDIA/edk2/pull/19 -----Original Message----- From: Gao, Zhichao =20 Sent: Friday, January 27, 2023 8:59 PM To: devel@edk2.groups.io; Jeshua Smith Cc: Ni, Ray Subject: RE: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser External email: Use caution opening links or attachments 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=20 > 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 > > Thanks for the review. What is the next step to get this merged? > > -----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 > > 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=20 > > 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/ErstPars > > er > > .c > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstPars > > er > > .c > > > > new file mode 100644 > > > > index 0000000000..e2af0c44b4 > > > > --- /dev/null > > > > +++ > > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Erst/ErstPars > > er > > .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",=20 > > + *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",=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. 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=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=20 > > + 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 >