From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.60]) by mx.groups.io with SMTP id smtpd.web11.103.1623775019093560669 for ; Tue, 15 Jun 2021 09:36:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=R+v2miSB; spf=pass (domain: arm.com, ip: 40.107.21.60, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ELya97LG2ETg1FIoHwPcGbqI2qqhJZ9v2MAgWcbP0Pc=; b=R+v2miSBHC2KtAaT5wuAAqngEG7v0qefbgjvW/LoJ0a3BZY4DmNgRvD1KNhveAerGfLvuINk8WHqNEwUj3ditGRsPWmmamYcYNlsHWuYoOrjngFaomGD910qb4OAjTUlkIsofVQ3WD8LeC7Twpj3IaQmotQ6eo3u9O353EgYUO0= Received: from DBBPR09CA0013.eurprd09.prod.outlook.com (2603:10a6:10:c0::25) by VI1PR08MB4526.eurprd08.prod.outlook.com (2603:10a6:803:f1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22; Tue, 15 Jun 2021 16:36:51 +0000 Received: from DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:c0:cafe::41) by DBBPR09CA0013.outlook.office365.com (2603:10a6:10:c0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:51 +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 (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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT018.mail.protection.outlook.com (10.152.20.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:51 +0000 Received: ("Tessian outbound d8701fbbf774:v93"); Tue, 15 Jun 2021 16:36:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 537e5978dfd74c61 X-CR-MTA-TID: 64aa7808 Received: from 5ea5fa8d145b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5207DF84-AF1E-4B13-9732-D6C199C24846.1; Tue, 15 Jun 2021 16:36:45 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5ea5fa8d145b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 15 Jun 2021 16:36:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PH+k9ZZU7jA4PghfZ7ouqCbDFprCVcMmok3aterqqyAJTWhDSi6OGM7QAOYmovQwabbmvVcCzr6YvVhKdXor5iUw1jqCHQ41NTt60L5fWLkE+Lp5nLoCF8i2GvE+HYUugPQNPZf4q20BROhNXRWSFQwSc711J5XhxtyvdK6vXBrUFza6IOKFwfnSglb+396wFF3Zf7RgqBK2reAmJvqYyb4Fq32dWia8PCXqXi3hyvuRf2FJqBJZ7lVhQMR0hxAA3IEiDe8Qv3VKLbzTsZWolw9hZy49Ytq8rpOy3T2AEsus/t0vuEX2Fd4bchw4J0ew1Q4nWynZjBYA8m0am6f9aA== 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=ELya97LG2ETg1FIoHwPcGbqI2qqhJZ9v2MAgWcbP0Pc=; b=Wr0xVcpcNj3C4/txp9OOquMV0zQcELW4mn+yh1c1jdTuO+jDiXZ++e9X/0LCM/qvP4SnuO8VcHtS836QI6G+0oUMVAHTX8WF6XdhyMKj0RACaVZYmozqX8CLaTwsc9PDwY5DGEpCvP0zGiKXt5/+29fpBrRn/5UT+lzb9ef5LITB9Pgt0m4z5eAamPGlUKlBG3CBluqpH7rWhZTwIEJQyTRWYXkgR6G1ckGepqK+2SWLo7Nf26um4H4yEU3nzbTJX0N2nSv9BBaPizWIT/hbGXPnxCGQ9yDRBWfza+ojU5iz7HgoyR92kKQ6dFZpTkN94BLqSo9kQktG1kS3xsSGzQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ELya97LG2ETg1FIoHwPcGbqI2qqhJZ9v2MAgWcbP0Pc=; b=R+v2miSBHC2KtAaT5wuAAqngEG7v0qefbgjvW/LoJ0a3BZY4DmNgRvD1KNhveAerGfLvuINk8WHqNEwUj3ditGRsPWmmamYcYNlsHWuYoOrjngFaomGD910qb4OAjTUlkIsofVQ3WD8LeC7Twpj3IaQmotQ6eo3u9O353EgYUO0= Received: from AM6P192CA0099.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::40) by VI1PR08MB3968.eurprd08.prod.outlook.com (2603:10a6:803:e5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.23; Tue, 15 Jun 2021 16:36:42 +0000 Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::c2) by AM6P192CA0099.outlook.office365.com (2603:10a6:209:8d::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:42 +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; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:41 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 15 Jun 2021 16:36:21 +0000 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; Tue, 15 Jun 2021 16:36:21 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [PATCH v1 4/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.b spec Date: Tue, 15 Jun 2021 17:36:14 +0100 Message-ID: <20210615163618.85200-5-sami.mujawar@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20210615163618.85200-1-sami.mujawar@arm.com> References: <20210615163618.85200-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b76cb9d6-bc67-45bc-958c-08d9301bc72c X-MS-TrafficTypeDiagnostic: VI1PR08MB3968:|VI1PR08MB4526: 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: SOnDOL8piUjhXnVGAG33uCU152yEEyEnk/V7Scua8Q4troExPx6m0+568JcCYCK7SgP5xUxF44jHDjUQs051GJ3geCn6ZpPAqLxb+WLFaZWp/Pc1LD23O57bXRoJE+wbOYMLis4/cMHWvSi7WjKTWGN3AV+C76IG9bfidF8/NgXJzlsBEvRIVFZ0YnmenHHczsPxXBEsaIXoRI09Wo8Hbesx4/C9Ywfd9Ze7k3+HX55Pi3Wbr2zXVEGjI/wDPmcr0NwSfAVzCUr0rPyw/958ezCjZniSeRAfRmlA+prrtIcYNOufpk9HO1SToB2+4O3RVKBu5DZcJ6fWv8ohF9ijOkfjqbpdbqYen3lXX05eNFvOGvQEEREItvhla0s6Cpx7neE6zuqi6r02OjF4k6qgSAw7UNRxxHQI4MUn9bbS3CkSsa6FwJOOSGPmBthevl1sfuLM1iFmllrOmSWWkUvePC4ipqT9XsrwWRJlqZs4wmao7xcl7h5ETAmZVf+J3nbGgpdF7mK6TneJBp5YiGjZRnToOxzdzESlkGhSfV+/SvuLpslajbnVQJVjtmB7KBZg2eI17BVvX2NZjBR4RvmF3nf0EiNdSTqXZof+6vEwnKbLqdj+s7/VWCbgif/43bTEjpYUX7uVYuXXNkPFDs03b4N7GrxHJB4GqxDHG4xk6uYoqM5kfJz26FT3mdT9aJUHfLTM7aLwHrvbwHzSHCWwpKTx79hZxjKJWPyQMqQrMAknMqTwBjInDoorjzmvFJEUK+a6QK3r6TfED9M8Ve9WgXGNM6Ovcp+3o9ewaGUS3B0yrQDBVtifMZ7kKO+Pi3BZB4AYp732ETWmBtOOfvZIBIZN3G+59dXISqn+dZB86js= 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)(346002)(136003)(376002)(396003)(39850400004)(36840700001)(46966006)(1076003)(82310400003)(70206006)(2906002)(86362001)(82740400003)(44832011)(356005)(70586007)(426003)(4326008)(83380400001)(336012)(81166007)(26005)(2616005)(7696005)(5660300002)(8936002)(47076005)(6666004)(6916009)(186003)(316002)(15650500001)(36860700001)(54906003)(478600001)(8676002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3968 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6c97b14f-7c92-4808-b95e-08d9301bc184 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8+OhChfFkHhUYYoZli/M8d31QZCIuUT5rLowE1Q+5uIQ1baVWeAOjePlHr9SBlCJou0ahjVRQF1f9hSwAP5zIZLsWfInDOeNrkHcaVpuBFP1ImgJoK4quAbixX+MfWZcmocssEN0bQEE4K4jskVXLfI8nuZ4xLZ2qvus8U4Gj2sJ0Wwa7mqfmzVhPL75CdrtNS1VTKZqlwT5QAV8eU2d1pmu7nqO3oZUA9jVHRH5/aFarGZDpm1NYziChnUtqBXjZivoYwpufcfK0K6pt8/Rc/ZoTmvJhlBZj5TdfL3qy+C4CrgSoHOmjhJmYj+162sLmPefOVi03qPAkB76FyotxuyKp/dso7iFGkRiLx2ew0erJj5g/P+7ZF0O1pOVc5ZJWag/a1j/2iGKI2BcOswJv9QmKuQwX7LBvbLlZ1ImH+UXJyKEjIsxAz2bl8oFNE7EtaOpI3eDBwsG79tDlFEtW7T8uusoYOMMSwrTzZupb/WhHmCd4LYi+JeIpCTplvhI3d3zNBv0HJ8zFCCdLzrKHunn/ZUsNVQSB048J4ryu2bOleFZnZxPpSwCmKuMx3EWMPfZ7Ssa/XZ5AAuuFbZo0fWCzlrxvKIzSFgchH/PBE/wb0Tan0GpYCyxYnHZqBCmgHYSJtrs5kjjQbHo7ImR58aqWvlYhQW3JHznnRp1v3EtPg4LcOTpx+SV7O2FFBIHK5sEl8gSHqNQtREA1C5WHfDCyqzcdUOJNpfIPlAGtX50pMPFlwC7Ywzrah3SRWAlAGLO86hRmXLzXeZ4sqyaW3DDUn+0k5s0iloFifFhtQCsHhvn3Oyolb7LUYpxhPEM X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(39850400004)(136003)(376002)(346002)(36840700001)(46966006)(82310400003)(2616005)(478600001)(54906003)(6916009)(316002)(6666004)(26005)(8936002)(8676002)(186003)(86362001)(7696005)(4326008)(36756003)(82740400003)(83380400001)(44832011)(36860700001)(2906002)(70206006)(426003)(5660300002)(70586007)(47076005)(336012)(81166007)(15650500001)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 16:36:51.3393 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b76cb9d6-bc67-45bc-958c-08d9301bc72c 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: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4526 Content-Type: text/plain Bugzilla: 3458 - Add support IORT Rev E.b specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3458) 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 --- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 196 +++++++++++++++++++- 1 file changed, 191 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c index fcecaff5134256497bda87241f339076897c3ece..1507dd3a4d79e61024b0c5526e21ffdacb782251 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 @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/) @par Glossary: - Ref - Reference + - Desc - Descriptor **/ #include @@ -36,6 +38,9 @@ STATIC CONST UINT32* PmuInterruptOffset; STATIC CONST UINT32* ItsCount; +STATIC CONST UINT32* RmrMemDescCount; +STATIC CONST UINT32* RmrMemDescOffset; + /** This function validates the ID Mapping array count for the ITS node. @@ -100,6 +105,72 @@ ValidateItsIdArrayReference ( } } +/** + 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 = *(UINT64*)Ptr; + if ((Address & (SIZE_64KB - 1)) != 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 == 0) { + IncrementErrorCount (); + Print (L"\nERROR: Memory Range Descriptor count must be >=1."); + } +} + +/** + 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 != 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 array. @@ -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[] = { {L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL} }; +/** + An ACPI_PARSER array describing the IORT RMR node. +**/ +STATIC CONST ACPI_PARSER IortNodeRmrParser[] = { + 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[] = { + {L"Physical Range offset", 8, 0, L"0x%lx", NULL, NULL, Validate64KAlignment, + NULL}, + {L"Physical Range length", 8, 8, L"0x%lx", NULL, NULL, Validate64KAlignment, + NULL}, + {L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} +}; + /** This function parses the IORT Node Id Mapping array. @@ -601,9 +695,93 @@ DumpIortNodePmcg ( ); } +/** + This function parses the IORT RMR Node Memory Range Descriptor array. + + @param [in] Ptr Pointer to the start of the Memory Range Descriptor + 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 = 0; + Offset = 0; + + while ((Index < DescCount) && + (Offset < Length)) { + AsciiSPrint ( + Buffer, + sizeof (Buffer), + "Mem range Descriptor [%d]", + Index + ); + Offset += 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. This function also parses the following nodes: - ITS Group @@ -612,6 +790,7 @@ DumpIortNodePmcg ( - SMMUv1/2 - SMMUv3 - PMCG + - RMR This function also performs validation of the ACPI table fields. @@ -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 = %d\n", *IortNodeType); -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'