From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.13820.1675218131480767584 for ; Tue, 31 Jan 2023 18:22:12 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=e3r7hSWS; spf=pass (domain: intel.com, ip: 192.55.52.151, 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=1675218131; x=1706754131; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=IUNTcfy3NzpCsCraBiEJ545sNBn40iHCownC9XXRTP8=; b=e3r7hSWSDuzGYt0BsDXytNupcBcDQslpzN72J8Vxc4ezves+z6JVAJg5 kg3vRU+ZWHliyszj28x82t40GE56HETgyigvqs9QoU3jSLNsX/HIk5X2+ YwWuegUVxxFN82WJA2GsJUh4mp/jYtzZG1SHkU1ENUhBBc6HDqt6TpfNK RLse7HyPRUe0HCQor5H9/6kBhQ9BOFD7RMsa8fSOwqoSDedmj34zTkI4c KvWWzW4KMG+gim+A8/zxdiZOpqGgdZvz05XEXQifhkNi3JiY/GZMXkuic AOB1jBshjNiQirgGDfdFXlQKDgKa1i0QE6Q1R6xF9il3Z5RSqmM6y8VST g==; X-IronPort-AV: E=McAfee;i="6500,9779,10607"; a="308362161" X-IronPort-AV: E=Sophos;i="5.97,263,1669104000"; d="scan'208";a="308362161" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2023 18:22:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10607"; a="788665834" X-IronPort-AV: E=Sophos;i="5.97,263,1669104000"; d="scan'208";a="788665834" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga004.jf.intel.com with ESMTP; 31 Jan 2023 18:22:09 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 31 Jan 2023 18:22:09 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 31 Jan 2023 18:22:08 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 31 Jan 2023 18:22:08 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 31 Jan 2023 18:22:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z/NxotixP7iQCU0EANL9mVWzGRVuOclG5jAH2x6+D1/HPivfqOIcWrqkOsyWNV4lfOGEb7PJJLdtzL+8C3r4VMsKJu4mSZoLXZa4A/V3apJLCQo4x3eRqwR9ODD9POiALm5cSxJU9Te9XtqFGksi3hbN2beLwqOBIrIv4h6zdl/Aj9NLAWH2/oBb59iBi8xAY15ZD4SW51Rp8dT4zh3n1dVHIoS+dWj0iY+b2ohp6vfQJjuRtlZi57/5uFf1fQ1vx/I6vdCv7hxrwn+dYlgJ7qqw8h8y6I3A7CN1qEYOu6prAyp8E5zi5HSZHaIDjpT05dTOEI5ZnXy+EKiZIt4MMg== 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=xPGZj266fRXKIiwk+Ayczu6SFATK11m9S+OdzsnfxvA=; b=nuWNuXhXZEJTUP+FT4BREdKLU/FxaEv7nHlnzkbX9twC3vCfo7VOu+ZWlSfk+f7IgwGgGY2DAlkBrYlwfdglowRHRm/XPh1H9Xn5AoSJ+JnLMEj4K6ixwyeQWC3n7BjzUmS9a70ut5HKh43/a+6nhw5at51Qa+XAqSA8RtN5Y3kKg8/ng4G4Y9BP+4dQrht0s1a5DWY7zWduB1dnAZ6joYYuUPKBHoOLpf2m5Y5/qjMUGGl4kvU83KkJuF9NShy6uuKVMlLsZqDkSE3i8O5FA7fH1K3e643A58TryIJ8/xSdaDc8f25XyKEOyRdyIEZSxsMPMyPTMHuR4STqdfUYcg== 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 MN2PR11MB4632.namprd11.prod.outlook.com (2603:10b6:208:24f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Wed, 1 Feb 2023 02:22:06 +0000 Received: from PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::5f27:d428:eb21:fbeb]) by PH7PR11MB6377.namprd11.prod.outlook.com ([fe80::5f27:d428:eb21:fbeb%8]) with mapi id 15.20.6043.036; Wed, 1 Feb 2023 02:22:06 +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+NIsTgkCj66ggWcggA3hDQCABS0SsIAFrCcAgACCYdA= Date: Wed, 1 Feb 2023 02:22:05 +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_|MN2PR11MB4632:EE_ x-ms-office365-filtering-correlation-id: 569bc581-eae0-4cb1-93ab-08db03fb1ce6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Bn7n1dkPvpelCyiknk62qHiYeg0T0PJlBD/PpdM08ZG8a9RGfXUK0Vw/bhi5TKA9YIau6eU3HwaL+IS1sVTNZkEUvmVpT+DRPx+AFMJPIRMqJkXrZ2/B9rjBJ6UrjUnSEUgqfVW4he5RuIgioIz/PNsbS24sf9LLcWLtNNlahGRih1rHvwRyK//SWzCkbkKkodKuSBb1ODNVRE/AbDJeNYob63TJyn1JXf/7HcojusDOT/mUzL89c5HK5l/U/7Bo5mSV6bwgCvtyPjBEhy8W68yozxZb0gs/dT8E/QcuEP1Gau6bvNHyACisa5afnhGHu4N+Te8eWMzKamxjJMElVlWyCpTIYAD6lid1B7AK59lDcrd60phkVHVCVrzsbwMl5prJ2kjS9iaTCJmiqqr5bAmhyiZ6BKBAtrTN9WPvoGGAE/+qzBKgHz5gV+yHGXMaq5t2jneysDiwLkzhSoxl1ijLmiRdXJtdH85+GYe/I1SlKBmV1LWqLoEoW8QKqs2ESAh2OTACnKUcMRVirJzyARZZJqgt1F0ex5KsoontxL8007Qe8c8/3ihUFx9av+gsUmjb9QqiwfpHKbXWAhQ6z6j1bwdyIjWPVPDpgme+7RMaGIjFDhC9tVW/o7wyw4EsQsoqMjEKe1+Z1uTm+ty8ih5s7BqIgf0ejwIH6w7HWLl9BD1WNuxzXDcfrjsGobZnPBkTWlLEckcVuxC6wqceAmdkKRJQsz/7NreDYksfZXLcQ81Ui4XO9o5u2J1JpzpGpUD0iwOy1rKtzAEBtGi1OQ== 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)(366004)(39860400002)(376002)(396003)(346002)(451199018)(19627235002)(38070700005)(478600001)(82960400001)(122000001)(38100700002)(83380400001)(33656002)(55016003)(107886003)(53546011)(26005)(186003)(9686003)(6506007)(7696005)(966005)(66899018)(41300700001)(52536014)(8936002)(316002)(71200400001)(110136005)(2906002)(30864003)(86362001)(66446008)(66476007)(76116006)(5660300002)(66946007)(66556008)(64756008)(4326008)(8676002)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?C4rp3H70Zb5ayQfMVSZV+ZKT68+juanA0UQu/pvzQ2RDtlA3OizDpijZJvlR?= =?us-ascii?Q?TcqVsgdgsr82GK6MCfyzvphTMe0mmzieOtsByzBVvumPLbRgP7fnIbyOuR4z?= =?us-ascii?Q?UeVqlB7JTsiiuHtCTLiSbEjudLj/9XzsNgvZctihpK0ZyCP1y2RfsTXZDk2t?= =?us-ascii?Q?w7Eu2pQi+xiqok/9HXMjrv5oLjP3TvBu5UsP4UVBbRWO78geAHNxNsMMRIRq?= =?us-ascii?Q?z6/rW4MP1QbHDeBRICyFdy38MzBX4x8QlWL9o0OK/n3Jzg51UJpXqOa5xcWw?= =?us-ascii?Q?u3ZkJLZirWnag0LO+eU0zR77GWpCntYEtJcAD7ZZDnmyHSTi2PwRTuytdSwq?= =?us-ascii?Q?FQnru6gLH2GrrDJ0F1ODtk8ZJfrsXT8lali1rE1xuZQA40L+42veOIF5R6ld?= =?us-ascii?Q?4Ae8TfrVoE4rS86CoGCf39qZJvLOqe8rxOVLUolIJ++NNYQgYMFbCv78urVZ?= =?us-ascii?Q?cubQc2fomrSVLpju9zgeZp3r0VgQDj12yjzhHfuoPCsrjFOx2eRQAKxYHNqV?= =?us-ascii?Q?zk7PhxCGiIDCbbOAtnCTLBWtrsaSTyjEuy4cxtPIYB/vn3jwIfRpBM2+Wpxh?= =?us-ascii?Q?sP5j/w95elqGOeQ4GKTRtZybbdwY9iv4XdNaON3Mv31nGY8h+JuH36j0QI5+?= =?us-ascii?Q?tMax5Pd3krMIq9U6dTguQgy8jh0j+UZ6DNfAB7HizIEzZdROciZ9vNSfDmdq?= =?us-ascii?Q?vyVGGejHzcC97Qc8aTRjFIVzy3LFS4Ht8w/f3YF+qv5wJcvhfIg/op1DoC1z?= =?us-ascii?Q?XjEl2lhEQZeYcFwllsXGfAMsPfN6vk6eTFaIBFT8oiJwgi2e+w70pA87slYL?= =?us-ascii?Q?J522t4enobmYqlG6L+RDQjklfEewNt9vdAjE5kfPmppAyl8MORbxiivPg6A7?= =?us-ascii?Q?YNnhFOzcLSCyD2HFlccg2o4LZxuyFfHU08Z8rZDTsH6tKuk6oXH4h9hPSthw?= =?us-ascii?Q?joumz+IpC73/ebkxdon+GBTBWlM03oL6OkEP2+HxNmVLy8Um+J1caoyVvIaz?= =?us-ascii?Q?Ck1a4hZNfaccWfuWSJzjTKr/KNVgkXJsQFBPnIN8yLPAKi/4FQYsOkANK2Tn?= =?us-ascii?Q?cpSYIj4XodTVWkJi91Fbri6jhtElyS8IyviEuZo6OexJSuGxK5W1RNWpRScQ?= =?us-ascii?Q?vvGnMSeyb80BUrqm7AD9AeB0MWcsAT46EUBWiyCQWa/gpBGy4C9y2j4aySFC?= =?us-ascii?Q?1M4g8bY1pZWt6iRT205tAgCCOmU6wHbFpG9JunMjf798hn2WVL+n88HJbY6K?= =?us-ascii?Q?g/hozxPj/KbItTg6tB3YkK4N6bKZUBJ4JgGwF9uPKvjmMGNGwuHUq52L02Rx?= =?us-ascii?Q?wF3w85rRUrjx7LgBeCxftILCUeHI9a7zB93qKliadAhaJWfh1l/bh71TWsJp?= =?us-ascii?Q?rKXxUd0mCejy8T9xNEkMmt1kYm2E+Hx1HgRB5g4VStDx0OLUxRM0J/vmsqcG?= =?us-ascii?Q?fD5FGe2i+/RBhAuB8ZphFngTzNjUFyLfpe8AareZZCHEeqd4G8lK3vxUm9Jd?= =?us-ascii?Q?8Re5mLbD5/dCgHUxYNbCxzifhckxqIX2vDXifLwYdXA+7FraqLsWJkatJTIA?= =?us-ascii?Q?69quamb58SMCLRpQK8gUXwSvoXFWi+atqgRhgtv3?= 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: 569bc581-eae0-4cb1-93ab-08db03fb1ce6 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2023 02:22:05.9293 (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: YCyKj85EGBEUVzEv/Jg3L0dKBot51kc0qK1mWgqzozGc9/EAX6wIbudmpbKKZarHkjY3/1Db/Rm0H/Yt8LsKtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4632 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 PR: https://github.com/tianocore/edk2/pull/3977 Thanks, Zhichao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Jeshua > Smith via groups.io > Sent: Wednesday, February 1, 2023 2:35 AM > To: Gao, Zhichao ; devel@edk2.groups.io > Cc: Ni, Ray > Subject: Re: [edk2-devel] [PATCH] ShellPkg/AcpiView: ERST Parser >=20 > Thanks. Does this work for you? > https://github.com/NVIDIA/edk2/pull/19 >=20 > -----Original Message----- > From: Gao, Zhichao > 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 >=20 > External email: Use caution opening links or attachments >=20 >=20 > Can you share then code change link of your personal repo? The patch I > download from this email cannot apply to the open source branch. >=20 > Thanks, > Zhichao >=20 > > -----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 > > > > 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 > > > ; 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/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.= this > > > > > > + 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.= this > > > > > > + 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.= this > > > > > > + 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, = NULL, > > > ValidateErstAction, NULL }, > > > > > > + { L"Instruction", 1, 1, L"0x%x", DumpErstInstruction,= NULL, > > > ValidateErstInstruction, NULL }, > > > > > > + { L"Flags", 1, 2, L"0x%x", NULL, = NULL, ValidateErstFlags, > > > NULL }, > > > > > > + { L"Reserved", 1, 3, L"0x%x", NULL, = NULL, NULL, > > > NULL }, > > > > > > + { L"Register Region", 12, 4, NULL, DumpGas, = NULL, NULL, > > > NULL }, > > > > > > + { L"Value", 8, 16, L"0x%llx", NULL, = NULL, NULL, > > > NULL }, > > > > > > + { L"Mask", 8, 24, L"0x%llx", NULL, = NULL, 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