From nobody Mon Feb 9 18:18:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76658+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1623923765064774.5192349460284; Thu, 17 Jun 2021 02:56:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id B2GKYY1788612xp1UTpQsvxu; Thu, 17 Jun 2021 02:56:04 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.58]) by mx.groups.io with SMTP id smtpd.web08.5537.1623923758114873117 for ; Thu, 17 Jun 2021 02:55:58 -0700 X-Received: from AM6P193CA0109.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::14) by VI1PR08MB5552.eurprd08.prod.outlook.com (2603:10a6:803:ff::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Thu, 17 Jun 2021 09:55:54 +0000 X-Received: from AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::11) by AM6P193CA0109.outlook.office365.com (2603:10a6:209:85::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Thu, 17 Jun 2021 09:55:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76658+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT014.mail.protection.outlook.com (10.152.16.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 09:55:53 +0000 X-Received: ("Tessian outbound 9d3d496fabe8:v93"); Thu, 17 Jun 2021 09:55:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f64af449d231979f X-CR-MTA-TID: 64aa7808 X-Received: from c0cf15c0c5fb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 37FC3DA3-BD8E-4487-A123-E9EAA871C86F.1; Thu, 17 Jun 2021 09:55:47 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c0cf15c0c5fb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 17 Jun 2021 09:55:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aU+8YGa8+wzsKUS0OJo9r7rmX6bv0y5qCyXJzsIBywbmgNZuTuhwrm/k3iBTonDStvXQNb+/I4Nyc9wjfY/8th9sG0L5tAyOGzIcmCpEjVcAlOmEKkIXsB6FJzNtmTvmAAjP4jZeFltIzb3KPVby78QO0yWoSV/vlg9eFTcSeRMese8W0xxQpDVVBjuj8phQaGviLzP+046hKj1tg7I6hBKcg0JY74Z5VOV1IYOOBLxa/VfdTqwqvc1ZACGTgL81CMKv+zq7BkEljRLVgGol/GhyiSkqhB7PJD4wViICTWxVtW4UhUf19a5eRjYzmLxK5mnCuTIlr8nh7mvo85blqg== 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-SenderADCheck; bh=KiTB1vJEpb/QbW0Krm6hP7YAJDl1+TRvNvq76WgeVOQ=; b=EGwE00yjfiqpBhHs6eYkvGDpDpYF57DgbRbWpiJw/7mFbCR7xYpGiBwEVI2op5fiJ+Y/jHxiZkcgDtKkjA7rro9o6skUBW4KRE2QiBzsk0eiY4i/Y4AdII/F4kpHomwGklauR4YUxndNOKMRiGBxDz9nRpTh9UZoZTuF2gWd3SkMK5KLn1vLLULLlmv9Cf6Xb258ixzlR3ZmGNCu9RPlL200uHTGz0KTEmup9XxYO4AMSBrWKw4gDxu8AoJvpW1DhYdQ3TqW2rgOEea+sMogxJav9SMh99utbu9mHaAWugSttfHQ8/L20ExmSrZqIRIZeRcbZN6OCCb/k6da5DiuUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM6PR08CA0035.eurprd08.prod.outlook.com (2603:10a6:20b:c0::23) by VI1PR08MB4608.eurprd08.prod.outlook.com (2603:10a6:803:c0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Thu, 17 Jun 2021 09:55:44 +0000 X-Received: from VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:c0:cafe::d5) by AM6PR08CA0035.outlook.office365.com (2603:10a6:20b:c0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15 via Frontend Transport; Thu, 17 Jun 2021 09:55:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT055.mail.protection.outlook.com (10.152.19.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4242.16 via Frontend Transport; Thu, 17 Jun 2021 09:55:44 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 17 Jun 2021 09:55:41 +0000 X-Received: from E114225.Arm.com (10.1.196.43) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 17 Jun 2021 09:55:41 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v2 4/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.b spec Date: Thu, 17 Jun 2021 10:55:33 +0100 Message-ID: <20210617095538.93280-5-sami.mujawar@arm.com> In-Reply-To: <20210617095538.93280-1-sami.mujawar@arm.com> References: <20210617095538.93280-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a39c53b2-5a07-4bec-8f17-08d93176187a X-MS-TrafficTypeDiagnostic: VI1PR08MB4608:|VI1PR08MB5552: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fGyqpK7HLqSD6sWDJzXDi+VrPailuRUT1zhoC3F6OqYezq4oni8ZxCZysnxid4VG8axzVA7bKeHOdNElzDKgUcafYkzLBWjXwibCnuU9RWOUR/XmEvVEJeFbDQYKCWvEWFSXa3rI5+T+uqbk4QEgrSgxpGmYl9rf41Lw5+6R8TInxw4sWExqDVwf9LHumsX88R5IbRrn03NuXGZgYEBDszBI105LvTnCQ8vy58gJpkb0+dBTiMeaO6MWuio/3OhXSSXximvB34hyoCZzAb1ca/+w9f/2ExudGnKM7Fx9+pi1OomLMqD7ygQ8YGs38n/3nlwM6N+o5xJwPeTTt6nJ/n1Bo136hM/8wHg2hQerJ50h/7HU/P6O9Rs2JH6xw+X9eEvqftHR/8Rzudsow3vmUz2dpAE+0z2zRPv3N2qdRPKL132/QiTVqtfqlq5hsu47vDF35ji+hxHQgowD2tokv+j/XSTKe+v0EmtICKd/2sr1d9UYcKJwfpgO5X6ZkClEIIykdC9ra1Rpu0vfJeykXmjOpComtvRD+e5I0cTjMYYUW4Og7afrowNnIzRDoA9F5Y3mIES8cfLUcbhFGCeDdybXcm/S1/JgqU2OsifOF1YVQsMD9P4jMeVyJ8nkLDih++YqRbZGXOK3zNuMzrKH4oSBYGp7CzMsa30UQ9oxcz95c+DhMi5fJURJL4+z9/Xt9odNqbo+rSTWYLanABeGnxN84WCgq2wvbA4sLH5doZOEmlw7JjGEIKSEy4JJxqGuwlz+1td1+qPq1LrAL2vFtjZi6ZQhdDF4LiIZP2NCimMBsOFOj/7J321TVfisRBe0cIlH0FUUaI64xbqGeJRVqza5H9jjmAB05K7hWMzjacA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(396003)(346002)(376002)(136003)(39850400004)(46966006)(36840700001)(356005)(6666004)(478600001)(70206006)(7696005)(2616005)(2906002)(81166007)(8936002)(82310400003)(70586007)(5660300002)(336012)(47076005)(83380400001)(82740400003)(86362001)(1076003)(186003)(6916009)(26005)(54906003)(8676002)(44832011)(426003)(4326008)(36860700001)(36756003)(15650500001)(316002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4608 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b828a4c-d58d-4f55-82cd-08d9317612f6 X-Microsoft-Antispam-Message-Info: HDP8hr0yREPupemyYdLjLpD8k8hW7lma1hUrKUHfAtT6E2mlpCUEUf7RoZ2RwqM7tzU5UqNu/YJsWyU4xhqS8DQB8AJOC9lMg1/3zgVtBixjDbIehR9S/TTBlZkxb/6cVpd1PFkEoDm9C8A3gV/OK8JAksiYipsn4lfbv7A3ziLQvwtCh5RuN7ckIqv5IIsCcrD2BmKysFf8oMbvwwPXD0jRFFtKlG12cQnACWu8ZAQZ/jU0V5B4imjdGk7IpSusgeA9eI0O+i/sLLK9RZzOXPAKPfWFdmjWle3opVJbC3eadNG6mnTMmTvJ0FuQVE8S3i1V/8V0K0xiEShQDicFUl7aRFU4FUPi7kWeruXF40SMMz8Fcqq1lAOt/NIoPZIh6nBYIN+YZkfmv7eEohKDlHYm9UjEZ5yqvAwuvb92sNtYE1pfZ9sua2YT3/6DS9NamOeklMoUAfyPC1oZunJ2gOmWtK6TqxQRxHcEa2cdN79lcXdZUkErx2WkZ0iT16nG4rE/SNfwYV8ZSMiSk/0480dmStxA/G1pXoDcoAEabinpjXK05sdUssVUJcC/8jyE+dHY6IKzDLG/j5X9dEQvBUmwZiiksZn8H/qqQcyKVY7qKZCIwUUzeZtg9/eiC8nGwHtIIpFpjIAmRJQj7b3fA2MX7WCzvdBdAR4ScU7NDQJYCDddCRYklo03MdawDYjGUTCg6WtnFRjcbxOaYq5p3iu5K5K7Sr+ZJQMiHgxFCbYRESZkGhYVjkZN8GEEZ/c9PC50y27OTwEHYmR6lyFuqSyK+jyiKnIBcae3pVDAPYgn27IFUhVkkRF/lhNm9Lbh X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 09:55:53.5533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a39c53b2-5a07-4bec-8f17-08d93176187a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5552 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: Osu6NXXLM5YA9BMYYnhBtC2Ux1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1623923764; bh=N2XTKn7m74yJmsihZxSYziaOycSLATfQzeLcE7vJzMU=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=SoqKyo8jSJ0oGhSS2iv/Wfp4FjUtre4EPiXtrXr80qvQYLhE/ZTURekiV2KlsmSbQrF +/UWyu7NLM6QxbLNKaBlO6fn1vrzv7C17JJBwoelcjmXlqu8k+rFK9AjF2cCa97X58+oq TcepKMMGUwRyROoRnozu3AIanWGaHf18jGs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bugzilla: 3458 - Add support IORT Rev E.b specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3458) The IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E and Rev E.a: - increments the IORT table revision to 3. - updates the node definition to add an 'Identifier' field. - adds definition of node type 6 - Reserved Memory Range node. - adds definition for Memory Range Descriptors. - adds flag to indicate PRI support for root complexes. - adds flag to indicate if the root complex supports forwarding of PASID information on translated transactions to the SMMU. Therefore, update the IORT parser to: - parse the Identifier field. - parse Reserved Memory Range node. - parse Memory Range Descriptors. - add validations to check that the physical range base and size of the Memory Range Descriptor is 64KB aligned. - add validation to check that the ID mapping count is set to 1. Signed-off-by: Sami Mujawar Reviewed-by: Zhichao Gao --- Notes: v2: - No code change since v1. Re-sending with v2 series. [SAMI] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 1= 96 +++++++++++++++++++- 1 file changed, 191 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index fcecaff5134256497bda87241f339076897c3ece..1507dd3a4d79e61024b0c5526e2= 1ffdacb782251 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -5,10 +5,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): - - IO Remapping Table, Platform Design Document, Revision D, March 2018 + - IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021 + (https://developer.arm.com/documentation/den0049/) =20 @par Glossary: - Ref - Reference + - Desc - Descriptor **/ =20 #include @@ -36,6 +38,9 @@ STATIC CONST UINT32* PmuInterruptOffset; =20 STATIC CONST UINT32* ItsCount; =20 +STATIC CONST UINT32* RmrMemDescCount; +STATIC CONST UINT32* RmrMemDescOffset; + /** This function validates the ID Mapping array count for the ITS node. =20 @@ -100,6 +105,72 @@ ValidateItsIdArrayReference ( } } =20 +/** + This function validates that the address or length is 64K aligned. + + @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 +Validate64KAlignment ( + IN UINT8* Ptr, + IN VOID* Context + ) +{ + UINT64 Address; + Address =3D *(UINT64*)Ptr; + if ((Address & (SIZE_64KB - 1)) !=3D 0) { + IncrementErrorCount (); + Print (L"\nERROR: Value must be 64K aligned."); + } +} + +/** + This function validates that the RMR memory range descriptor count. + + @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 +ValidateRmrMemDescCount ( + IN UINT8* Ptr, + IN VOID* Context + ) +{ + if (*(UINT32*)Ptr =3D=3D 0) { + IncrementErrorCount (); + Print (L"\nERROR: Memory Range Descriptor count must be >=3D1."); + } +} + +/** + This function validates the ID Mapping array count for the Reserved + Memory Range (RMR) node. + + @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 +ValidateRmrIdMappingCount ( + IN UINT8* Ptr, + IN VOID* Context + ) +{ + if (*(UINT32*)Ptr !=3D 1) { + IncrementErrorCount (); + Print (L"\nERROR: IORT ID Mapping count must be set to 1."); + } +} + /** Helper Macro for populating the IORT Node header in the ACPI_PARSER arra= y. =20 @@ -113,7 +184,7 @@ ValidateItsIdArrayReference ( { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \ { L"Length", 2, 1, L"%d", NULL, (VOID**)&IortNodeLength, NULL, NULL }, \ { L"Revision", 1, 3, L"%d", NULL, NULL, NULL, NULL }, \ - { L"Reserved", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }, \ + { L"Identifier", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }, \ { L"Number of ID mappings", 4, 8, L"%d", NULL, \ (VOID**)&IortIdMappingCount, ValidateIdMappingCount, NULL }, \ { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ @@ -253,6 +324,29 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] =3D { {L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL} }; =20 +/** + An ACPI_PARSER array describing the IORT RMR node. +**/ +STATIC CONST ACPI_PARSER IortNodeRmrParser[] =3D { + PARSE_IORT_NODE_HEADER (ValidateRmrIdMappingCount, NULL), + {L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL}, + {L"Memory Range Desc count", 4, 20, L"%d", NULL, + (VOID**)&RmrMemDescCount, ValidateRmrMemDescCount, NULL}, + {L"Memory Range Desc Ref", 4, 24, L"0x%x", NULL, + (VOID**)&RmrMemDescOffset, NULL, NULL} +}; + +/** + An ACPI_PARSER array describing the IORT RMR Memory Range Descriptor. +**/ +STATIC CONST ACPI_PARSER IortNodeRmrMemRangeDescParser[] =3D { + {L"Physical Range offset", 8, 0, L"0x%lx", NULL, NULL, Validate64KAlignm= ent, + NULL}, + {L"Physical Range length", 8, 8, L"0x%lx", NULL, NULL, Validate64KAlignm= ent, + NULL}, + {L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} +}; + /** This function parses the IORT Node Id Mapping array. =20 @@ -601,9 +695,93 @@ DumpIortNodePmcg ( ); } =20 +/** + This function parses the IORT RMR Node Memory Range Descriptor array. + + @param [in] Ptr Pointer to the start of the Memory Range Descrip= tor + array. + @param [in] Length Length of the buffer. + @param [in] DescCount Memory Range Descriptor count. +**/ +STATIC +VOID +DumpIortNodeRmrMemRangeDesc ( + IN UINT8* Ptr, + IN UINT32 Length, + IN UINT32 DescCount + ) +{ + UINT32 Index; + UINT32 Offset; + CHAR8 Buffer[40]; // Used for AsciiName param of ParseAcpi + + Index =3D 0; + Offset =3D 0; + + while ((Index < DescCount) && + (Offset < Length)) { + AsciiSPrint ( + Buffer, + sizeof (Buffer), + "Mem range Descriptor [%d]", + Index + ); + Offset +=3D ParseAcpi ( + TRUE, + 4, + Buffer, + Ptr + Offset, + Length - Offset, + PARSER_PARAMS (IortNodeRmrMemRangeDescParser) + ); + Index++; + } +} + +/** + This function parses the IORT RMR node. + + @param [in] Ptr Pointer to the start of the buffer. + @param [in] Length Length of the buffer. + @param [in] MappingCount The ID Mapping count. + @param [in] MappingOffset The offset of the ID Mapping array + from the start of the IORT table. +**/ +STATIC +VOID +DumpIortNodeRmr ( + IN UINT8* Ptr, + IN UINT16 Length, + IN UINT32 MappingCount, + IN UINT32 MappingOffset +) +{ + ParseAcpi ( + TRUE, + 2, + "RMR Node", + Ptr, + Length, + PARSER_PARAMS (IortNodeRmrParser) + ); + + DumpIortNodeIdMappings ( + Ptr + MappingOffset, + Length - MappingOffset, + MappingCount + ); + + DumpIortNodeRmrMemRangeDesc ( + Ptr + (*RmrMemDescOffset), + Length - (*RmrMemDescOffset), + *RmrMemDescCount + ); +} + /** This function parses the ACPI IORT table. - When trace is enabled this function parses the IORT table and traces the= ACPI fields. + When trace is enabled this function parses the IORT table and traces the= ACPI + fields. =20 This function also parses the following nodes: - ITS Group @@ -612,6 +790,7 @@ DumpIortNodePmcg ( - SMMUv1/2 - SMMUv3 - PMCG + - RMR =20 This function also performs validation of the ACPI table fields. =20 @@ -753,9 +932,16 @@ ParseAcpiIort ( *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset - ); + ); + break; + case EFI_ACPI_IORT_TYPE_RMR: + DumpIortNodeRmr ( + NodePtr, + *IortNodeLength, + *IortIdMappingCount, + *IortIdMappingOffset + ); break; - default: IncrementErrorCount (); Print (L"ERROR: Unsupported IORT Node type =3D %d\n", *IortNodeTyp= e); --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76658): https://edk2.groups.io/g/devel/message/76658 Mute This Topic: https://groups.io/mt/83600720/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-