From nobody Fri Apr 19 17:44:43 2024 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+83547+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 16365417812141.2853640983341847; Wed, 10 Nov 2021 02:56:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3EQ5YY1788612xLPcTApMli3; Wed, 10 Nov 2021 02:56:20 -0800 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.74]) by mx.groups.io with SMTP id smtpd.web10.10393.1636541779614081025 for ; Wed, 10 Nov 2021 02:56:20 -0800 X-Received: from AS8P251CA0002.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::15) by AM0PR08MB3730.eurprd08.prod.outlook.com (2603:10a6:208:fe::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 10:56:15 +0000 X-Received: from AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::95) by AS8P251CA0002.outlook.office365.com (2603:10a6:20b:2f2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83547+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 AM5EUR03FT039.mail.protection.outlook.com (10.152.17.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:15 +0000 X-Received: ("Tessian outbound e7ce0d853b63:v108"); Wed, 10 Nov 2021 10:56:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 301d2fb7ac18ff5e X-CR-MTA-TID: 64aa7808 X-Received: from 001aff9a7841.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 52AA916A-5288-4E1C-9C83-0078C2A1C125.1; Wed, 10 Nov 2021 10:56:09 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 001aff9a7841.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FC7bWQG/uvr+6k6QnAK2frB8sMh4T38lQiUA4gSISx+m8qdwe5gdh4ju0V1Z4m0zhQFQPR4llcMz22RxIEUEiOzFtH0K/uV26pJa8imev0w/tYqEOkGuEzK05Hy/7WyWbNdmoSvU3RjWLMifzmXUpN2LSaGuDbm/vhV7X+hmK6fqKORhdy0xLa/bxTJdGmxM9L8G/UtR5J+BYKhPHF19GKC6XhjA7cpekN1bHqKtAMU1sHYb7ZXpoVB+t8PgQQ19OMQzvG6J0chK3rWQI9KIMeeKOJW1CfmG9fSbaRAsAxEWWAwY+KSkU5bu/mAcm6BNm1FsEWjF4kUo/GiPNeWtzQ== 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=UGPX3jjd69ABy2d29X/oY6697pUoNuy4w+kxjIcFJQk=; b=FMBKjFVAP1pn/XlSEwuN5xkrxBFgjptocn5ODxFCkqmvhS5qf+k0q+tG3h/p7XrZuB9o2Abvr3O02gRK8IWuRoXvPymqFsWlJIhCYOEk2l+6PunB2MKwVRvwUmmtTjexEPXa4SAZe0ybBPjhIIN3GmO2NrUK6mDfVR3ESThDRfc5rX114T8IXg+SRfN3t4K1q68hxFpHFt+b9Txc1zUSL0XPwD+NRdy0cqMUl52fw3NgZgrRE8NNGRqq4tHHdeLrkgeAzKAxi9Hq6Gu2Xu1M+H8q3wPRq6lF7t2Gv4G5r4gpI0PRUgDVakVXY6uiJtBk7VXWde6/0MefmnAahB53vw== 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 DB3PR08CA0001.eurprd08.prod.outlook.com (2603:10a6:8::14) by DBBPR08MB4823.eurprd08.prod.outlook.com (2603:10a6:10:df::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 10:56:06 +0000 X-Received: from DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::e4) by DB3PR08CA0001.outlook.office365.com (2603:10a6:8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT043.mail.protection.outlook.com (10.152.20.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:06 +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.2308.14; Wed, 10 Nov 2021 10:55:26 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:25 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , , , , , Subject: [edk2-devel] [PATCH v3 1/8] MdePkg: IORT header update for IORT Rev E.b spec Date: Wed, 10 Nov 2021 10:55:25 +0000 Message-ID: <20211110105532.38696-2-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f85c684e-0905-4ab4-eefb-08d9a438b79e X-MS-TrafficTypeDiagnostic: DBBPR08MB4823:|AM0PR08MB3730: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +ZMVvXoCLWZDCIhjZDXHW4qRa2CHOKm8mim2GjyTILT4IUMVIqZ1SFAip2KCWf+8Lmqs4I4z/9vq2YT0P2fVcOAtFOovp8MyIo1dZs9dvnjJPQELB5XKlSYmShLZjb05o1RKdIPNBlphkpbvfGs9RraBUxJN1Um96skrJfUTFX1aYylfDalhhYMLeo6TX2l9YSsKhzj25PUtXGRNAY1K3li0XLNvpqPhFDtSQ94zH+/GzGoRL0K6FE6R+fu7neyLEnvvBQK7OQfBe5gB02VFq9zoPC86Z5g8TbehASVvuJFyD+gm2NBA5qBCURG7XCy56NxI6gfAXUr3lYn3IwTvO2fGh1Zvta3ry+bakDtSNyneoAXcJ4BiyMJCxFXnVSpNleKCWI74e237MCnPMO4cQket39/QfFFairjEz8126gRyLiobJKf5KPpXK/yX7TDHU2aHhhRfY799OoPrWCAHJcC4HQbAfSJDAPxrNqdufPZCkqH7dj4bPDNPl2QcX6nhqimJ/hnJ2QIjVSBKJsmVpESzrxdEeUKcG0qZHj2rvlH02lRxGZLnmg0sqmLhzCtYaeIRtJWw6/zdGMJMZNfvyYbu44r4MJ9fvYJR41+LMojayePDwyCr56C7XTq+OCosRW1p4KG5mfyu2qkmJIB/1VE8CBsukeaeYtc+bZ54bqYbjgaQJMljyV9f0d0rjU7o3HXDepC5qtaWjjK4H9yeST7u9dX8DkQ74SsyWQ3DIxJCd9muQLSDW5I4VLl9VT3bM2at5vre+v+9mgtjWv1GMj81e1LCIMBS9CkA0L/fUOVkus0DWdKNgQJwWRJbLmXoJkrdr4Fv9zlwiwFbHpPJvJVxZI7itFwtQlYfcgYeQU8= 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)(36840700001)(46966006)(2906002)(2616005)(426003)(44832011)(54906003)(70586007)(356005)(186003)(26005)(36756003)(83380400001)(81166007)(336012)(4326008)(5660300002)(7696005)(316002)(8936002)(47076005)(15650500001)(1076003)(508600001)(6916009)(36860700001)(70206006)(8676002)(86362001)(82310400003)(966005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4823 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f972ddb2-faa3-4ccd-2927-08d9a438b236 X-Microsoft-Antispam-Message-Info: sTiTlnrCjWakjZ++2wg/6a6qgNHEi0ZE8otOksANsIfqi5ayegCOofnaJPh92FkqsFwt6DJIWOPYGnnN9WsJYq4fgNLOPa66+SwagyzpxDfeOqoPKUyKM5L5yrRbC960u3WGDVGgHR7oZwaKN22gbYrlf/vYLTyDgt1iNN4BhHXKeh8xegM0jjQm0eOB8Q++rLOz19q1dXXqcBUwgP42ZXiiCTw6zwdqiKxSxYfd7wptEXh3sJEiNH7mhvwq+GYpnM5q2FzghOoHTAVbETfgQVa4nHjpi0KG3TVnRHjCigN9bi4iIMetSHpICyVipn10c2IBCyDL58pDrTVcq2Zx3qOUCYBhDzrapSM7zbaymJuYLK5W6bhxsRfDMhxtMm4wzNl7YxBktf6b6Nhwpi9mmEHGOhMVMNpyTSCNXGeMETXpEPhGVxiHU+4iLdNpSwDlGpoHHyykhOc7jjNRNPkBGqqV+Ub2L2Zm3Tbt0RfHlnvnIJ3rwLPoC0SVxpvDfJyKAD88OgFghwWi964Dn0r8Ty8LfLzE8kXCspJNr46d+UwKEufhON4m1thvSg8+0NHI21fKRgf64euu8VMCJSA0blXnsXD+rrKc05QfAFHTFHLWmyOTxKQZmniduE3Qk+9ktxSuC2HyhdH95lXllTAi9qUjU0yuAYIDP165gkKj88um7K9A750iwFTz5XBpHfNi2oRWTr1C+4Jbst7EH/CxplSCPoRuzdNHkB7Lf8r7cWGu6x73IZFPNDZcy6hckZbMYJ6+EXkXjbpMmA0xHjO4ETNPOX+ia22qfmkbkP8ASzd8C1r/zrvN0IddPvRVoaHyl5+8WOcFgZF6ITtGL4bXbw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:15.4876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f85c684e-0905-4ab4-eefb-08d9a438b79e 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: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3730 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: NZnrBxSQHY3K6rFtV7aHioCHx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541780; bh=wFyLhZWtgvsn3Mr6YqA+8GLMPboRxZ4893LDTbuZye8=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=qJX7gKL9Vzzm/AppdEv5ioFHpvlwId+J6dO3EFah22CfFCR3hAj06yShTlpW3oQUnSZ NGHzGQ0aKPGcRUc2EHNm4QQJ9KLGCsSizrrjWnJM0+EpxLmTU5zfokbTrh7SJnbBH2irC qfmcATrkVMN1qpd/OvCY5V3ghd+H8UM8T2M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541783428100003 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 header file to reflect these changes, and also rename the EFI_ACPI_IO_REMAPPING_TABLE_REVISION macro to EFI_ACPI_IO_REMAPPING_TABLE_REV0. Signed-off-by: Sami Mujawar Reviewed-by: Zhichao Gao Reviewed-by: Rebecca Cran --- Notes: v2: - Set EFI_ACPI_IO_REMAPPING_TABLE_REVISION to Rev 0 as [SAMI] setting to Rev 3 will break existing platforms. The problem is that existing code would not be populating the Identifier field in the nodes. This can lead to non-unique values in the Identifier field. =20 v3: - Submit patch series to update platform code to use the [LIMING] EFI_ACPI_IO_REMAPPING_TABLE_REV0 macro. Ref: https://edk2.groups.io/g/devel/topic/83618423#76799 - Removed definition of EFI_ACPI_IO_REMAPPING_TABLE_REVISION [SAMI] as EFI_ACPI_IO_REMAPPING_TABLE_REV0 has been provided for representing Rev 0. Also, a corresponding patch series for updating the platforms in edk2-platforms repository shall be submitted to the edk2 mailing list. - Include r-b received from v2 series. [SAMI] Ref: https://edk2.groups.io/g/devel/topic/83600724#76660 MdePkg/Include/IndustryStandard/IoRemappingTable.h | 66 +++++++++++++++++-= -- 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/In= clude/IndustryStandard/IoRemappingTable.h index 90504e3a6715be7facc6450c6ff0e1eab92cd3c7..e80164a07f4d561cd85994b4f78= 5e76f2eab4586 100644 --- a/MdePkg/Include/IndustryStandard/IoRemappingTable.h +++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h @@ -1,12 +1,19 @@ /** @file - ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049D - - http://infocenter.arm.com/help/topic/com.arm.doc.den0049d/DEN0049D_IO_Re= mapping_Table.pdf + ACPI IO Remapping Table (IORT) definitions. =20 Copyright (c) 2017, Linaro Limited. All rights reserved.
- Copyright (c) 2018, ARM Limited. All rights reserved.
+ Copyright (c) 2018 - 2021, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021 + (https://developer.arm.com/documentation/den0049/) + + @par Glossary: + - Ref : Reference + - Mem : Memory + - Desc : Descriptor **/ =20 #ifndef __IO_REMAPPING_TABLE_H__ @@ -14,7 +21,8 @@ =20 #include =20 -#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION 0x0 +#define EFI_ACPI_IO_REMAPPING_TABLE_REV0 0x0 +#define EFI_ACPI_IO_REMAPPING_TABLE_REV3 0x3 =20 #define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0 #define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1 @@ -22,6 +30,7 @@ #define EFI_ACPI_IORT_TYPE_SMMUv1v2 0x3 #define EFI_ACPI_IORT_TYPE_SMMUv3 0x4 #define EFI_ACPI_IORT_TYPE_PMCG 0x5 +#define EFI_ACPI_IORT_TYPE_RMR 0x6 =20 #define EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA BIT0 =20 @@ -55,7 +64,16 @@ #define EFI_ACPI_IORT_SMMUv3_MODEL_CAVIUM_CN99XX 0x2 =20 #define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED 0x0 -#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED 0x1 +#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED BIT0 + +#define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_UNSUPPORTED 0x0 +#define EFI_ACPI_IORT_ROOT_COMPLEX_PRI_SUPPORTED BIT1 + +#define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_UNSUPPORTED 0x0 +#define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_FWD_SUPPORTED BIT2 + +#define EFI_ACPI_IORT_RMR_REMAP_NOT_PERMITTED 0x0 +#define EFI_ACPI_IORT_RMR_REMAP_PERMITTED BIT0 =20 #define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE BIT0 =20 @@ -89,7 +107,7 @@ typedef struct { UINT8 Type; UINT16 Length; UINT8 Revision; - UINT32 Reserved; + UINT32 Identifier; UINT32 NumIdMappings; UINT32 IdReference; } EFI_ACPI_6_0_IO_REMAPPING_NODE; @@ -198,6 +216,40 @@ typedef struct { //EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE OverflowInterruptMsiMapping[1]; } EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE; =20 +/// +/// Memory Range Descriptor. +/// +typedef struct { + /// Base address of Reserved Memory Range, + /// aligned to a page size of 64K. + UINT64 Base; + + /// Length of the Reserved Memory range. + /// Must be a multiple of the page size of 64K. + UINT64 Length; + + /// Reserved, must be zero. + UINT32 Reserved; +} EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC; + +/// +/// Node type 6: Reserved Memory Range (RMR) node +/// +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + /// RMR flags + UINT32 Flags; + + /// Memory range descriptor count. + UINT32 NumMemRangeDesc; + + /// Offset of the memory range descriptor array. + UINT32 MemRangeDescRef; +// EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE IdMapping[1]; +// EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC MemRangeDesc[1]; +} EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE; + #pragma pack() =20 #endif --=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 (#83547): https://edk2.groups.io/g/devel/message/83547 Mute This Topic: https://groups.io/mt/86954328/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- From nobody Fri Apr 19 17:44:43 2024 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+83548+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 16365417818127.191965463108772; Wed, 10 Nov 2021 02:56:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id s8jzYY1788612xw5s85KEnfl; Wed, 10 Nov 2021 02:56:21 -0800 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.71]) by mx.groups.io with SMTP id smtpd.web10.10394.1636541779970836864 for ; Wed, 10 Nov 2021 02:56:21 -0800 X-Received: from AS8P251CA0026.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::17) by VE1PR08MB5072.eurprd08.prod.outlook.com (2603:10a6:803:10a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 10:56:15 +0000 X-Received: from AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::aa) by AS8P251CA0026.outlook.office365.com (2603:10a6:20b:2f2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83548+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 AM5EUR03FT039.mail.protection.outlook.com (10.152.17.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:15 +0000 X-Received: ("Tessian outbound d49ee2bec50d:v108"); Wed, 10 Nov 2021 10:56:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 78372f0f684dc4f2 X-CR-MTA-TID: 64aa7808 X-Received: from 495aa175618e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C139C002-CF25-4E24-9913-0E70E9454F1C.1; Wed, 10 Nov 2021 10:56:08 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 495aa175618e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LYHsBGEeyngE1+MMc04BdfUitQs3es9ghnL64wWsxVD1xdagV+F4kaNotmidmNAGwvuo/w2qnwKYc9Buva/hbH9mDMVYEQmkiWd475TnRd4G6ceAhx8plcBxM9MsqqYgWeCsyeiyTs7RCW7PawIjZkrlAdeC2zuv1mig5V4IZZ1nSuMjCYj5LqVlUT34tjofD2wzu35wkJbq65BL/LEiMok5HuOkThYUssoyXFZ3bKu7mb3AUhmbOs/loTXWm1qnX5D78IbEjGqbPb/fK4Qs+s/ojWEPqNX6LYzx8zj9a+06Q898wsi/hpwrhAYHczjpdmepckAULF6pg5EVCXspwg== 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=3OOUUTfPPP4OP/v8d4h3juHT5uQXOkv3++IFOS0SavQ=; b=d2YwtFK1eW2QKxv7fENwTsVbsXRHDZLJv137Kj0Ixk4QE7liYRJHNrKtlaaiF/3NpkgxMJDkkTaVF2DUNUGiipm9q0GY/dVgZsEaAGb83b5G7gevmG9RKMKxq+z6UEkVzX8ukdC2fXp7he9OffagiEwW07fDsQP8YZiGs6aMHJe7gRSOrb4o2824S8a2zWzzJj406bSRdkYlCR5sVkbjDDx3IkSsjE178CuxNQgkXkcEG3gCUcdMmKK49ctvPxaQ6llGIclw2W1DttYG6L4nCVo257KruTCuHKfytvqADYrf/moT0QJYypvpH4AN2Er3wPHluCVxLofXcWMwedMMhQ== 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 DB3PR08CA0003.eurprd08.prod.outlook.com (2603:10a6:8::16) by PAXPR08MB6733.eurprd08.prod.outlook.com (2603:10a6:102:15e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 10:56:07 +0000 X-Received: from DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::81) by DB3PR08CA0003.outlook.office365.com (2603:10a6:8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 10:56:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT043.mail.protection.outlook.com (10.152.20.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:07 +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.2308.14; Wed, 10 Nov 2021 10:55:27 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:27 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v3 2/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment Date: Wed, 10 Nov 2021 10:55:26 +0000 Message-ID: <20211110105532.38696-3-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 586dd052-a4b8-436f-37cb-08d9a438b7b3 X-MS-TrafficTypeDiagnostic: PAXPR08MB6733:|VE1PR08MB5072: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 5/9CkCl2xZ/QMDQB9/efhYUb/eLVRZJjuoh4u/jHghxWn7QRmppBsFwMfLxAGLKCAHN9g1ws2dVezxr4GRCUW0t//YW7UKxua+l8aQ9DAZLdpmFOthqBDpVKsra4rOpOMh4M9NoBsHjwsrZd36HUm+b1lQzaW8pvgBcwfXFycktqtQbLbAEhAFwT1wAiAD2XF4zitpEpB3pp9Nj1avg3HZYVXTRH9WfXYHw7eXxKgDcbP1KvNBHmq1qnxkCq66/cL5lPkbHgbpxL78mpYtEr02whnzng4NX0yJoTj9PPAQEtvv6WKyqRthrlzt6IVgnh2Zwwld1mA5GoHk10EBemT9cYEnOh/WLQXOAs6CerF+LFnecov8w8TBu8gNyhFy0rS0+fJXSSRRUMimlTtnpmxEdfK3Ir1Ym7qib8iX0WLxALo/cT8G5xeJbPKcOcdkI8ns4ZMz62inlSgKGBASEj0tB8k8ES8qiA2n+OBtPGPhajiS5Ir8MW072Dr2IbjgfdmLaW1nHwLvgsBvnb26ScodNt2T5cmho5eet35NM+LEKtM0eI5rN+lbrf1IqOeiIRis3Q7ENR1a4H4O6O7SyCQEgt/taeshWmBPx7dPqeE5Ys7XQFGHkC4hwmvXH6/vH3qUOrCGiJuWXgw4BB2N0TpApE2e4m9Z8tNE4Yb4Nye4P6C2cN5sIT8v5K6KxA+WvAk+vZzf6/+yeMjpP6D9RKFB02NPHftcoU6e2al310BFwtwoZiINYvCxTEcFz58KmEEDJUQwgxQpIhTAJj1Os1qWgGTT4XNGe18yrFsTNN1yLVqp6TUvRMnwkjjIHoENoo 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)(46966006)(36840700001)(44832011)(7696005)(83380400001)(966005)(336012)(4326008)(81166007)(47076005)(82310400003)(36756003)(508600001)(426003)(2906002)(86362001)(1076003)(2616005)(5660300002)(8936002)(356005)(316002)(26005)(6916009)(36860700001)(70206006)(186003)(8676002)(54906003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6733 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ce7d8489-d99e-434c-ab79-08d9a438b291 X-Microsoft-Antispam-Message-Info: YIbId8A0qzaf8L0QuZgeM89cmrB35eqRnmfM9mrWsfvzYqX8iYffHADRcRIk3Nwg4pXv8Bx7bNvHZ0sEB8CMHrqlvfZA5oTGRHbTbVcXtcYEnqH42JeHgQ36hrVjTPSi09ONgT8Lwn4Hm5q3qbBK5g+DLCzwuwas1Ophs1/I4s79hUStQsgY5GU2jJ6Ud9J4EYaQP49WVypsXcD9MpWrABzrbhvi3vVSPXoXDw30DRxsFzL9t2xIXGtlK7azq6A5oZ9gjM32bmxj2eJS1B/A14qqFXOHtlM4Z+nT3fEp8qxYPs4pf4U/Bt7v3k1V63Gi+gprEV4OXI/DZlcblE0dsOzQZogHe9+fC9LW9pMQCjrv4aupqKA8rniSplfCu81xvL/+Jb3GfbSmQYLSP0HiGLKHpVkrFIHA351iLR+mqiOxkRIrnnORNZoVpAuFAAhLDrAQFPITw/Ax5mxi3EyRkO4MklyhcSp2s7TfHlGLpBXxMPa5i6uDhM1Dm7fA20tQkMDJvAvKKvRfbfhz2bYlakIMzcBTcfVQntnhoBVT8x5JpxlqMI13Li6br2MqbMt0M4xVIIiJcSlCCXAK2ljFdCX1RvuSbIuPSt9DKWvd+7L8OkN9mTqFp13dePWQ6DIMH3E15oYtlRwTiufdxZXk02oMMGWZ9K8YeVciJ0qoodFCBjJCNhgJiEON7qOuiyMBvnuKwmUNW46sVcICDnVdvG7q+SsQet/bf6BHR7BmuIWfDt3m5NXNecpcusMzPBN6cb0aVRkYNLiERasKBoko3UZky9tiZpLXkk75HZ9IYRA= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:15.6185 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 586dd052-a4b8-436f-37cb-08d9a438b7b3 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: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5072 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: j9kj979s0JRrbk7ow8gKsh4vx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541781; bh=ryrNXIKvegCCSm19YqTGZ7pUONBkEmrzOxeFLVAP+IQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=j6f2/s//rIsGlOvNfAkFWdAgVDY9ebnKUHJQheAspxEgw7jUbUY+2KhxxpAtwcods88 JZRHwIqngENWewPke2BiRxFJzS1J77DOLeg4HxpwWfAvnVF0WMazBwFh3kt5I4SH9C8gk xpDm1GmRUw+zDc0jquOrwV+xKtHyWnJMWaw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541783411100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some field names in the IORT table parser were longer than the OUTPUT_FIELD_COLUMN_WIDTH plus indentation, resulting in loss of the output print alignment. Therefore, abbreviate the field names. Signed-off-by: Sami Mujawar Reviewed-by: Zhichao Gao Reviewed-by: Pierre Gondois --- Notes: v2: - No code change since v1. Re-sending with v2 series. [SAMI] =20 v3: - No code change since v1. Include r-b received [SAMI] from v2 series. Ref: https://edk2.groups.io/g/devel/topic/83600717#76655 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 1= 3 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index f7447947b2308d35d4d2890373778f0fd2f97f9e..fcecaff5134256497bda87241f3= 39076897c3ece 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -1,11 +1,14 @@ /** @file IORT table parser =20 - Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. 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 D, March 2018 + + @par Glossary: + - Ref - Reference **/ =20 #include @@ -144,15 +147,15 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] =3D= { {L"Span", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Model", 4, 32, L"%d", NULL, NULL, NULL, NULL}, {L"Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL}, - {L"Reference to Global Interrupt Array", 4, 40, L"0x%x", NULL, NULL, NUL= L, + {L"Global Interrupt Array Ref", 4, 40, L"0x%x", NULL, NULL, NULL, NULL}, {L"Number of context interrupts", 4, 44, L"%d", NULL, (VOID**)&InterruptContextCount, NULL, NULL}, - {L"Reference to Context Interrupt Array", 4, 48, L"0x%x", NULL, + {L"Context Interrupt Array Ref", 4, 48, L"0x%x", NULL, (VOID**)&InterruptContextOffset, NULL, NULL}, {L"Number of PMU Interrupts", 4, 52, L"%d", NULL, (VOID**)&PmuInterruptCount, NULL, NULL}, - {L"Reference to PMU Interrupt Array", 4, 56, L"0x%x", NULL, + {L"PMU Interrupt Array Ref", 4, 56, L"0x%x", NULL, (VOID**)&PmuInterruptOffset, NULL, NULL}, =20 // Interrupt Array --=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 (#83548): https://edk2.groups.io/g/devel/message/83548 Mute This Topic: https://groups.io/mt/86954329/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- From nobody Fri Apr 19 17:44:43 2024 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+83546+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 1636541757961331.13296556510204; Wed, 10 Nov 2021 02:55:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0a5MYY1788612xozI5Zq6Ukb; Wed, 10 Nov 2021 02:55:57 -0800 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.42]) by mx.groups.io with SMTP id smtpd.web10.10389.1636541755893363686 for ; Wed, 10 Nov 2021 02:55:57 -0800 X-Received: from AM5PR1001CA0044.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::21) by DBBPR08MB4347.eurprd08.prod.outlook.com (2603:10a6:10:c8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 10:55:51 +0000 X-Received: from AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::cb) by AM5PR1001CA0044.outlook.office365.com (2603:10a6:206:15::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Wed, 10 Nov 2021 10:55:51 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=temperror 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+83546+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT029.mail.protection.outlook.com (10.152.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:49 +0000 X-Received: ("Tessian outbound 7b0bcc4a550a:v108"); Wed, 10 Nov 2021 10:55:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 73d623092b8e767c X-CR-MTA-TID: 64aa7808 X-Received: from d8fb13ec933b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5CC84200-A58D-4357-A97D-372701F462A1.1; Wed, 10 Nov 2021 10:55:33 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d8fb13ec933b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:55:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YMFC+anr/9XfW0HuyEsxx1qK4PBntAo2NEReBrr//2Q1UHh3AKJEyja9rySMW0dh9Up/RLx6FrzkFtk/mNJTSiM10VJ/zaaYUqWB5yHJwtyM3IkcQhh9zFz0Pv7v10fNto3bxPpb4S8XGR1z+OX+BXSFVMd/xsjrq6EwmWWLYdRejRS8AvNXeb2PF5zLn1cr2RktHL1EGhYEJHpw4VsaQn0GxGKspm/nhQ3CTP4tYdnwL7uctLCmiEfBqJ6LJKeDKqAnmkvcqnffPtUs1cF912zpzjL6pt5/oOlZTC/wjKyS1b4KEc+D94DdikDqMJC64LOYwTyKSvlqfHjfHiGNRQ== 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=LOofdiaKx98V3AzFeV7bI4s05ifv1cS4Q3MD7UIu/Ow=; b=KaJUsYw9YDlfJYEmYWcenUB+ZyeHUfgEOAIHnbkH9NgRg5+cYGFu18mZYkutx/+1j3D0bZS11m5W4u/LCvx2GFr0DfuTYKYfHwXsQPysrGURzJnisz5KNJshJ8soxooVz7wIdD5pdNGU+o0NfWs+K4i82IPF6iPCSM7kmkxbgoMB0Ydp137TAo6hWbNi71A7iAU7aQ4OLMxuQ9wUk4mMKsjH6iqSmAIlT2KGnZeJGI/7xzomDdkSwrLtBuIdsewEDMfDQcFomqkvsr1XjiBHCRkjt+OBvYoNv29BA9dmfhkDdNJnIFO5LqmpfDIOQWtJS5ManBuHeDgqVj2IEoHXeQ== 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 AM6P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::23) by AM9PR08MB7088.eurprd08.prod.outlook.com (2603:10a6:20b:41c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 10:55:31 +0000 X-Received: from VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::82) by AM6P191CA0010.outlook.office365.com (2603:10a6:209:8b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 10:55:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 VE1EUR03FT037.mail.protection.outlook.com (10.152.19.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:31 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 10 Nov 2021 10:55:29 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 10 Nov 2021 10:55:28 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:28 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v3 3/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.b spec Date: Wed, 10 Nov 2021 10:55:27 +0000 Message-ID: <20211110105532.38696-4-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3616ae4-6c24-46a2-32b4-08d9a438a86e X-MS-TrafficTypeDiagnostic: AM9PR08MB7088:|DBBPR08MB4347: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: TfHqUspQCLRSPrKlsEqXk7mYeQQZfq1delEj36jPp8Kj+N1EE20esgJ0q98QspiiyXTjA/ds6ExgXPwyuvyywv9N1tfrlrmlkIGsmV8s9eR/osGAbHMWEyjlJAF2raApM3EeKR4JZec6YImVooQlUAL/vp/0ip0Pddm9RNowIhUK8snsisteBsSEyTtH+cBX9I5uNuaLwPucLnmXCuIB/J3+261rcz0Z74RIIuVAvh533xf1/qMSiHZV9MEKt03hj/FD4N5Hxlpq2nJaHgzOVX22MloShAzaRMLYgJYJBAmcRnz7H5yAE4oPRaDX1LTrBDfwB656kTRYRMrDlJ951JZomslLs4mr/5vCBy/75E8Qd/uzasV1NMuk4q0rCSVPpQVp6kU9+F1ZUDBCF5Pb5jMhIRJMB1T+BLpOdx3XjPwcsTUjyyxJuhuojz0+DSPA6EAGgUVaBPgKr+pgr2jVaNWHNdOLUo/7vhRNwTX6V7Ef+6UufesTBiXpQZMKwvMlgp6Wj4EYGdsuYZ88wdm/5nBbKqY1C6wnU/9CxMd3Pqzxwb+mB0+1kHpfzEyGDu+72Qk/LpnM5uFXoLPXub6s+pBKmjFr9rGm+oCwsZ/sN1nrzB/FPqvAYdR5Ga0l2aE2rVnPmGD0fd0wGbGupwKaZ3oc3qOemzZWJQmIjQrTu4zkptymNztuS/3RnSOI9/pVBTSbC4y3LLHt1ttbwDs7wXfnqw0+beVD3YsotxxkDPMNuun8g1g7B9FFi2fesOIbKCilmJ7phAHwBSVf1JTTjH4QswNd/yATw4UVXgQ/n2VYVMohDJ/GponUNx1K48ItcZfinGCwoj3VNsjYFObMLKLcVSd53N4V7JDq92qwrpA= 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)(36840700001)(46966006)(426003)(86362001)(82310400003)(36860700001)(2906002)(26005)(186003)(70586007)(70206006)(54906003)(47076005)(316002)(356005)(1076003)(2616005)(508600001)(15650500001)(8936002)(83380400001)(7696005)(8676002)(81166007)(6916009)(44832011)(4326008)(36756003)(336012)(5660300002)(966005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB7088 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 1a99fa12-e557-4e18-706c-08d9a4389d46 X-Microsoft-Antispam-Message-Info: zAev1vbgTfAH5JfI8pgQpYBDDOS5HJJ5UHKMLSUJeASCjKzAzO7tFQpznLA486+VESjTm96S3zX2yXDAfdUWs2dJkE6uAPXaTVu8DLC0v+YyY4nRsS8q/LnrA/PWC2aFdkDeucOK3SPIa7ra2ZJqt55nEGKuLWe9d3tTG+QxSE6gF+vzTmBr4BecdoeabcbnhBrNKLns2DEMDTpYgB3XX1FqCDZHXjPSK5f62J4w/JTazGX5V8oNRFAMZCEuWb+020HeJQPfoicleVYAOKpcaIRlyjCE6QlISxqTSZTXHUvo2xXzviJd535NNU1ydt/WRqlO0k6sy3qb16+ymKWsU0tu1bgqAb7ZS0jIUz+ePBpRx0OLxaBOuwRtNNeoUXtYN5JqXxhfE5Vfq5eQFOZl6neiiOlNg30QYPZXuv544BVYx9XOsRpCoM3GFSCo9+/xY1aR20fiZRiXM10/j3yPXqp65NP8toNe2i4g6LRDuulPKUicKc6Q7qdajfhHIcvvb+qu/FthDyc3XXPp5cbUPI0jeFd/WzyeyFXT6oAyvFQ/Gjd3jW8uvEQNlrXFpa4rY1fenz2/Ylm/FBz1Qd61d4CT9NdmLjv0F16qOS8dIkcrNjhf5tXcJIsLW1dHaJVst3qPTe91o+k5AAQ5s2XQUPsu/gBmbzR83eOA/ckhHYe69Mgw4ZLxfpE162eJp0ql1M6e9GAYtqW+RMSULWYqjnWRblxmfxYx4dgQRNrDEcGaLRmN6l4cO68niBVLSxOKVF/IufgvhLSU5t5wPMYJOiv+5wfoxUDcBehLrjqzEPuX77yjOS+4pcIFLD2raG5ytPlzdQ0Qkvmy4y091Rkflw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:55:49.9744 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a3616ae4-6c24-46a2-32b4-08d9a438a86e 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: AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4347 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: izgqCU4lO4fV53wT8l1INgUwx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541757; bh=U6YQuSV/RqRJs5Z60PzZe69GAgh67l858irmGrYbAI0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=QDWWM40+bRvGIfcLfNSXrAEDqGs99ssBGZSEigp+6IRuy1+i0btxLXCwlY8g7HJr2RO QtzgVA+T3hjEnZI24650wnA4CLNX+W6QH5nPsG/Aa29PxUfzwJHMggBsWuUTlAnQvx09B VwlCvybLY/GeKenccGoDg6lrDWE84nMGl5c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541759716100001 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] =20 v3: - No code change since v1. Included r-b received for [SAMI] v2 series. Ref: https://edk2.groups.io/g/devel/topic/83600720#76658 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 (#83546): https://edk2.groups.io/g/devel/message/83546 Mute This Topic: https://groups.io/mt/86954325/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- From nobody Fri Apr 19 17:44:43 2024 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+83549+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 1636541805250303.2901315266878; Wed, 10 Nov 2021 02:56:45 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id JBe9YY1788612xUKaBDmtIWS; Wed, 10 Nov 2021 02:56:44 -0800 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.42]) by mx.groups.io with SMTP id smtpd.web08.10431.1636541803704171270 for ; Wed, 10 Nov 2021 02:56:44 -0800 X-Received: from AS8PR04CA0149.eurprd04.prod.outlook.com (2603:10a6:20b:127::34) by HE1PR0801MB1756.eurprd08.prod.outlook.com (2603:10a6:3:7e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 10:56:37 +0000 X-Received: from AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::9d) by AS8PR04CA0149.outlook.office365.com (2603:10a6:20b:127::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Wed, 10 Nov 2021 10:56:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83549+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 AM5EUR03FT019.mail.protection.outlook.com (10.152.16.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:37 +0000 X-Received: ("Tessian outbound 7b0bcc4a550a:v108"); Wed, 10 Nov 2021 10:56:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a0e88d25082c7491 X-CR-MTA-TID: 64aa7808 X-Received: from 64040ff652d5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1A925617-4136-4092-AB5C-3399665C9460.1; Wed, 10 Nov 2021 10:56:31 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 64040ff652d5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B3xWkMgXq3gwCTYazHGPlfQz5YJYDQN8c9kWWrXDI60ZtxKsp5TvtlJJJzvmGCpex0Usi7MHG/hG4bhzilhvj2vgKF4uLWEQCtrZ9anp76p6abpyKPm7E3ITbhmuX6xxbShRQGQCNPk7nenduaS3HL8kI46jgLXPSyW4NQNNDcGp8oVdm7BD0scOVxI+rgCxS8/RbcKz7y4xJtDWRehpEDdO07LwbG4tqQpMKy/2Mol5d1Nuwo5fZwbT4by+jaCPSePnBx9admP6xfgZqlsEIcbBMgTAzdeULEdCufKLhlrLVpU/Dw7MG+9ud1UjV+XW2hLaE65XrwFKZfkwBmiIgg== 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=DXOpsZpaWViuEqi+cxTqQC/yKrF9dTX8+4QgHccCgnA=; b=HjiegUB6G71UXh9/ApZ2gHlANbv7myFWenpdpOb6wQ23gcDfpjdsdRBKLvRYrefGxnZyUgKc20uHnX4/xsK0Db9hnpGOcJA2c0YB0vri7VMuIc5ptRUFyJjKodeHJHuxgCO04vXvENES2amS9UyPOw+oKRnsnTS/+VfnNRtF17WqNB0Idm6ncu7Ln1UI/qVgaTfbUCO/udJNch5oZ8UAaEr3MTq1NFad5dOYXRiClBEmvgUoEA/ZJB/m8SiYrU5Beb0IqC3zH6o0fal2sWGeOAslCXcmNE3G6STrqDgZ9iMrwjSFTwSfgt84/IybvQ2rnkWUmRUkpePBSrOO9h0U1g== 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 DB7PR05CA0042.eurprd05.prod.outlook.com (2603:10a6:10:2e::19) by PAXPR08MB7351.eurprd08.prod.outlook.com (2603:10a6:102:229::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Wed, 10 Nov 2021 10:56:29 +0000 X-Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::c3) by DB7PR05CA0042.outlook.office365.com (2603:10a6:10:2e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:29 +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.2308.14; Wed, 10 Nov 2021 10:55:29 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:29 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v3 4/8] DynamicTablesPkg: Handle error when IdMappingToken is NULL Date: Wed, 10 Nov 2021 10:55:28 +0000 Message-ID: <20211110105532.38696-5-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d2f7342-4213-4bdb-18de-08d9a438c4b5 X-MS-TrafficTypeDiagnostic: PAXPR08MB7351:|HE1PR0801MB1756: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5236;OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: TBvuxqFwGsM2XXkjkJqwLGu8StEtPBbDyHu9fiwFk3Y+RMEV5b3K3R4pIuSVy4FojyYawrfv4nbdFZgwuOsprG5O763wQvxTTDEZ+8AO46WreVbIRAiiUYVk31cvY71Ki0IKhiBNOZmgSH9hgkhB5GBotpUezrmhimHBUMvnfor2buRsDoHeiXsXMVDp8R4af3wf3oJE3uKsppovQIa7N1tWnVoAI9XRV9jWu0TNIXldUzWlaVgj6hzSU+4U8TfToB8+/dFtRCy9jr+f5fBlRO0YLkgZhT1jb6hQ9coWbkXvJPsoIDTy1cJVMpni2WB6qQjaQiq3laIJUlHGyCVie7aomhyG7DayMACE/qqmF4BoPHJ6E1Ac7hj0YjPKY98MUyenpNHFKLNfziqxrKbCJc6UoIgTQRZyoVpqGuwak4AnnoF0J10ksTc+5c3caXG/EHET7OzcA3WB96RHh4EpTrv2US3uoc3EHc3p9V4yWfUkAPJ5cn300iPhePPn6mMrMeRb2b6k/D6QETbk+t/C5PQHMJ2Z8gNMl7BxGciqBgbW9iCs1/Dxq5kOnb4qoyW0DFyZ2dAnHgYYZtnsEFalIEwp2pG5AA2YQ1a0lxtFwjkp0YhBb/jey2fy8dUH30iRhVUVWvPzcyHaVyxuCAGO+fc57S04ez/4FDH+Gb2gMCm/otQYVbP69pDvd0BX5e1VOTS6eA8Un1AMtVK/NVwGJqAIEirquVyasX099lewXjcWH1z+hXxPHpetGVWZBdOfXaav9H80YmsxIcmBGDB0xJB6WjXGSg3LluSW3qs1KFPa8L8mKZLxpwZQ8AraOEiaEezVHAWDuhfKcY1dehB4tnkllScg4jJ7ftVqSAWI+v4= 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:(6029001)(4636009)(36840700001)(46966006)(336012)(82310400003)(36756003)(316002)(186003)(47076005)(83380400001)(6916009)(1076003)(2616005)(86362001)(508600001)(426003)(7696005)(70586007)(356005)(36860700001)(70206006)(44832011)(4326008)(8936002)(81166007)(5660300002)(8676002)(54906003)(2906002)(966005)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7351 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7beeb4b4-fd47-4816-a160-08d9a438c021 X-Microsoft-Antispam-Message-Info: pBSmKINg0QBsYqltBdDVIp5BummYYwYhQpj06Irp4ZsdP5jYcDeNds4lbXfUvcJNliq8AM4zN4fp/NPmMx/jxB2WWXSGccQPKReVRwTtemWk+81KrvpqxWQravAgXeTEpJA1SbDnl1kfToxvRk4MD5OiToQ0K/eGEZMs0Wvqt9ogR2oLWIIHKO2adLMYlxyYEeU1vtyFzsF/cjQ+ljSaoQjo2KHv9UX6Z6Es/7joUtssRRHevohdNDlH/WhT4tmIokzv0YHV8Ov9Wfevl+hfGQua4LbW10iOQEGABj+5+sfiJ66cW7gxUWZA8Qb3eLQHz7klYFM+Qs59+eSyqx5ONjNqNWV8UpOS7iO6VezgiXn3k3gIn+UD/BPOP2N093UNICIfRzodO0OUYSujCiCU7mBb66UGXTxJx1oWlimhIGXA0IVsKk1Fm6rawMIdnHyd9mhh6FLAgYH2wZVPJ+rP0CpUBmTAIXRM5YRoxz1HZbbMqqTeo/3A45IIJ1vBA7Sh/tCMLeIEQ+yzlv+x87Zq8i6I0uKh8ZgJ/pp2j5LDspB4zSdgdG//pisFV4prhYVxuQXGEO+6T8n99UGrlnCkYD/5AAz2lt9DZnG33dbjXtNMnfY6kyK+c5dwYN7ROAaLWgiXRMhmUUZcBG1bFTpBa5SjT2oV+QlvUyJPTJ8xbLZYBlz/ZMSoFLMwid89YN5bpxzVaOiCGbG1lFpa1zaUXl3jZP284dflnC/zwFgFqj+QhsJahB8crp7kO+9RXfpX4LD3csyt+c6wNYLm/dYIkR0OqGMdoWWLoZJ/1EJix19uNLcusgQ/5yBXCLCVwxaL X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:37.4372 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d2f7342-4213-4bdb-18de-08d9a438c4b5 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: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1756 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: rQoNcltpLqYUikF1fFdwBTikx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541804; bh=aT0egexjKET2Ulxqv02iZjGRfVCV85mWWF5FNBk92Jg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=JXCqJsyQbkQvfwZnNJ5KaWCWy7R76cyN4kVgxfc6u7pX0QfBhTB6Cig6io3k/m7S1uk cnsvpSh/hCG2wwJ+uZjYgWUuLdqVFwDEKgC1bTp5JhJR5wseMB6YOXHoBWUepPCFzpcVg VHBo0hJhls4JSlNRDvYaqguMgtrsgIAfe4Q= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541806507100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add error handling when the IdMappingCount is not zero and the IdMappingToken is NULL. Signed-off-by: Sami Mujawar --- Notes: v3: - New patch in this series. Moves error handling code for [SAMI] IdMappingToken from patch v2 6/8 and v2 8/8 into this patch. Ref: https://edk2.groups.io/g/devel/topic/83600728#76662 https://edk2.groups.io/g/devel/topic/83600726#76661 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 75 ++++= +++++++++++++--- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 349caa8006bc34ca789cb3e321a0f87c0cd4ff0d..a1714dbedd3e34e2716e828092a= ac169461c43c9 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -899,8 +899,19 @@ AddNamedComponentNodes ( return Status; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + // Ids for Named Component IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)NcNode + NcNode->Node.IdReference); @@ -1004,8 +1015,19 @@ AddRootComplexNodes ( RcNode->Reserved1[1] =3D EFI_ACPI_RESERVED_BYTE; RcNode->Reserved1[2] =3D EFI_ACPI_RESERVED_BYTE; =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + // Ids for Root Complex IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)RcNode + RcNode->Node.IdReference); @@ -1233,8 +1255,19 @@ AddSmmuV1V2Nodes ( } } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + // Ids for SMMU v1/v2 Node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuNod= e + SmmuNode->Node.IdReference); @@ -1349,8 +1382,19 @@ AddSmmuV3Nodes ( SmmuV3Node->DeviceIdMappingIndex =3D NodeList->DeviceIdMappingIndex; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + // Ids for SMMUv3 node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuV3N= ode + SmmuV3Node->Node.IdReference); @@ -1463,8 +1507,19 @@ AddPmcgNodes ( return Status; } =20 - if ((NodeList->IdMappingCount > 0) && - (NodeList->IdMappingToken !=3D CM_NULL_TOKEN)) { + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + // Ids for PMCG node IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)PmcgNod= e + PmcgNode->Node.IdReference); --=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 (#83549): https://edk2.groups.io/g/devel/message/83549 Mute This Topic: https://groups.io/mt/86954331/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- From nobody Fri Apr 19 17:44:43 2024 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+83550+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 16365418104901013.7244056392055; Wed, 10 Nov 2021 02:56:50 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id GoEnYY1788612xMMuC6D2uaF; Wed, 10 Nov 2021 02:56:50 -0800 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com (EUR01-DB5-obe.outbound.protection.outlook.com [40.107.15.74]) by mx.groups.io with SMTP id smtpd.web08.10433.1636541809254541019 for ; Wed, 10 Nov 2021 02:56:49 -0800 X-Received: from AM5PR0101CA0018.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::31) by AM5PR0801MB1713.eurprd08.prod.outlook.com (2603:10a6:203:34::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 10:56:46 +0000 X-Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:16:cafe::97) by AM5PR0101CA0018.outlook.office365.com (2603:10a6:206:16::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 10:56:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83550+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 AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:46 +0000 X-Received: ("Tessian outbound d49ee2bec50d:v108"); Wed, 10 Nov 2021 10:56:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4b5e38f3fee99a49 X-CR-MTA-TID: 64aa7808 X-Received: from 8fc8ef87a881.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3FEF2204-17A9-4E2C-9C99-11F8B8E74175.1; Wed, 10 Nov 2021 10:56:37 +0000 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8fc8ef87a881.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HGdddbMuPXYRtksrm26ZiESI8RbYL/hRmkeJ8sDjWKzxyfpoWfJlOyzmMsuyZfpHVSqjFr6/A7uryNkh14xELZY0F6aK6hmLGpkpj9F+LAIv0GwiHzf9LEFOkX8DFlI0PaIZv7iTWI5+SwUa1x4JV1CHt/fieTWcunZVPRlXGBAsDukDughjMftzKcBLu2E/NmorCgF8H9dBlZyy+vToJgBHtXiXzwvPJxsABLJrzfhisT82sRAVycoRZml8tGMgg1qSGjno51zQNO10htNjmneWZKPlt1SK2mlvPg5iAilPBGP+TbSEShrPXTAcR1UZiM6FgdCGQFPYTOdgzvoojg== 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=1cuPBtKThRFRRUtihAGjhnPc5YbAovJxuxzv8RohF+Q=; b=X2GbtcoN8FMa6mFTSMWdtJOWud7GBtVGrpR9DlP3OMyVzmLK29Qk0jv+kW9evUWFRTnGpIIhDEb05J+Z20BjFkoBtg4zjGh6CymbTxsfLnCF5zCktxXjoBrDMoChWtW2icl2GRWehfphz5iWjSTvWJFkXwnQrJyomv2Ih6yOCjrovwspJcZbAgo3cW/V8A9Cir1ghXpBvKr8tWBSu1DzDhKA554cUty21jThu94Sz1ESvoDdT8lys0T24jaieZ/4EAOMgbsd7igY3SuOFCeuLO2X/Skx8eCJrCULdsWqoeLuLdLXFXAg0b5oGSZwZineVSXzSPenCXxK4Mk6VPkXYQ== 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 DB7PR05CA0042.eurprd05.prod.outlook.com (2603:10a6:10:2e::19) by GV1PR08MB7346.eurprd08.prod.outlook.com (2603:10a6:150:21::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 10:56:32 +0000 X-Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::30) by DB7PR05CA0042.outlook.office365.com (2603:10a6:10:2e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:32 +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.2308.14; Wed, 10 Nov 2021 10:55:30 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:30 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v3 5/8] DynamicTablesPkg: IORT set reference to Id array only if present Date: Wed, 10 Nov 2021 10:55:29 +0000 Message-ID: <20211110105532.38696-6-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 90500c12-5f40-4701-a4f5-08d9a438c9f1 X-MS-TrafficTypeDiagnostic: GV1PR08MB7346:|AM5PR0801MB1713: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: qEcL/Vb9m0DmKgG4aVU5vXX7aGDAZuan+t84/dhSXEBF2/N5aZ0zpkq284XfbKmThShghRzrB7wjD+1/kKolu44i6BhFya5oYhWEH2abdtXfLT3X+ALk9Z205jlYjbV6K7ct7D9yMIMmKZBfrdnqJDch437MSonylw1VulqWFO4cfKjqDj9YM66LTxTttIPP9K5h4uERJ746+tiyhelTTUXSbnlFo0hNgNWE3Vfd71aXxIr10yL/TbX774jN3IDOCDLz0NTgxbnJlC72amstFs0IVylvAX1k8FF5nQ87JrWh1MvGYVtdzTm9HrNBuzOq5PvQhQLt4SI2IhcRQ51XYMo9q1HoBZ0ltLkPt9Oyl2ID3w8GkWFRRg9wggLAIk/LqXwaB7GAE/c/0rf4RlzW7Ww1oGTs3iGnB2JukX4zSfpbiinScADOHEyAq5sXHc++zCVf1+/bJrBbXR10d/iGiD1YEuOEMy5ce1wIYnPukKvXYRDYYQUILCsPi726C3Z6tQZgCq97/0dymAIxBrq+yXI9WMduwarjIttO9BC8caPcSlHuWQXjKCBRUKNlbc7yDcN/PT/XucB4H1n3BcXam47LbN9+ge3qoz2h7T0YYM+aUI6dkoQFvC1/mJAIp+AMd6WY/IKh4z2ETUkiGm/Df4k5ha8plXlFPrYlGpmfJbuLy61rN03uGTrZZPHjysIQ+AjXt1Cra2+X30Otm5YqlP8YG9jv2Y1Oer/Y8Ktzz58= 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)(36840700001)(46966006)(508600001)(26005)(6916009)(356005)(36860700001)(83380400001)(4326008)(81166007)(2906002)(1076003)(44832011)(2616005)(336012)(47076005)(8676002)(36756003)(8936002)(316002)(70206006)(186003)(82310400003)(7696005)(5660300002)(86362001)(426003)(54906003)(70586007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7346 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f08ac0a9-09c2-4293-93aa-08d9a438c190 X-Microsoft-Antispam-Message-Info: 1fA4rU6ajfDDytl38O8fE5AJrMrdV9N91bRscUYT27y6mCO7LAD1QgomkX5OIr4fpihgqf9qtcVPI/wmV3srKKmh9l3wnANGvjk2kH1wNaFmtVPYgLQGriYc9DX2C8geSlfxwyiezeDW2fRMCKfEsAXq6odFI9/HI5azKtKZ+kRd1KI1RPf4KDHTi6wJVHsxCwSscctmozmOf3iZ4UERs4Db7o+HdXVusOLSCiP4qOdv8GpRjpoZhAnB/AQDxACx65gxwmHkSZFldwgnVzLlv7j+tqA4qdUGPoMueNZ2vY6xfase2kT6HgLtYLgW+MTQjO/USVOFmj9U3liACHFaLyr9tl1aZJF3ARhT7TpuptGzuZn5AoAcU9+F3t55f2/B8LtEM3U3cvmNbBSNCudIaYQWzpcmjDLBR8Sz9THaBGuygiCWq0Dr2uE9iwtwrl+mfJcBmYGtWppWI5esrJLEFaA2aLN4i7ap7A00DVm7qCe02j2Mmz4zGlU7WOdH7RJxPI4hxoxusV417KnT+qe+up82DLdxxKN3nSMp2KJIy2GfTZU+hgmZ6ma5sBbPs6abWtDDYcE3qLCSBWVpB+5Efl5A0mRJZCYaykVzxAJWBMvN0AlKS0/vgOizP+64ewfys8dGfgTLHd8qOIstkhAtSco4GioSyLIoGgbxRqBMvxUuED/7apkX6BZPvVRcfLv79FAU7Oabo28b3H3KMWonKA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:46.2186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90500c12-5f40-4701-a4f5-08d9a438c9f1 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: AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1713 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: ucIZl8H49rwGPblOuWOOmZ4Ex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541810; bh=AJl5CWlUN/rSk33C7S5qJlycq7YC1ZefXz+FsiCwoq0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=F72eAT3dLAJdFVh7JzxTZMZS2e95IAPWh0fG/hwwG54UJw6oBkvjGN8d2ZAcCPqY1c4 I3PJeUDt8Ng/r8HPpIXE7PtZ/w1ESIhzQcuwTpcgKfRW5JVzecrBV0A9Np9qR8odllZPb YjGrPKklb73UbUWrp+dq9JaX6elgaGO4tPg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541810790100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The IORT table generator is setting up a reference to ID array for nodes even when the ID Mapping count is zero. This is not an issue as an OS would only access the ID Reference if the ID mapping count is not zero. However, it would be good to set the reference to ID array to zero when the ID Mapping count is zero rather than populating it with an incorrect value. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois --- Notes: v2: - No code change since v1. Re-sending with v2 series. [SAMI] =20 v3: - No code change since v1. Re-sending with v3 series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 29 ++++= +++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index a1714dbedd3e34e2716e828092aac169461c43c9..46ff1e6d03852daa2058b8bd13f= 4b18f775aba6e 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1,7 +1,7 @@ /** @file IORT Table Generator =20 - Copyright (c) 2017 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2017 - 2021, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -870,9 +870,9 @@ AddNamedComponentNodes ( NcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; =20 ObjectNameLength =3D AsciiStrLen (NodeList->ObjectName) + 1; - NcNode->Node.IdReference =3D - (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + - (ALIGN_VALUE (ObjectNameLength, 4))); + NcNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : ((UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + + (ALIGN_VALUE (ObjectNameLength, 4)))); =20 // Named Component specific data NcNode->Flags =3D NodeList->Flags; @@ -1001,7 +1001,8 @@ AddRootComplexNodes ( RcNode->Node.Revision =3D 1; RcNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; RcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; - RcNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE= ); + RcNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE); =20 // Root Complex specific data RcNode->CacheCoherent =3D NodeList->CacheCoherent; @@ -1182,11 +1183,12 @@ AddSmmuV1V2Nodes ( SmmuNode->Node.Revision =3D 0; SmmuNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; SmmuNode->Node.NumIdMappings =3D NodeList->IdMappingCount; - SmmuNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_= NODE) + - (NodeList->ContextInterruptCount * - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) + - (NodeList->PmuInterruptCount * - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); + SmmuNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : (sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) + + (NodeList->ContextInterruptCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) + + (NodeList->PmuInterruptCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT))); =20 // SMMU v1/v2 specific data SmmuNode->Base =3D NodeList->BaseAddress; @@ -1352,8 +1354,8 @@ AddSmmuV3Nodes ( SmmuV3Node->Node.Revision =3D 2; SmmuV3Node->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; SmmuV3Node->Node.NumIdMappings =3D NodeList->IdMappingCount; - SmmuV3Node->Node.IdReference =3D - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); + SmmuV3Node->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); =20 // SMMUv3 specific data SmmuV3Node->Base =3D NodeList->BaseAddress; @@ -1482,7 +1484,8 @@ AddPmcgNodes ( PmcgNode->Node.Revision =3D 1; PmcgNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; PmcgNode->Node.NumIdMappings =3D NodeList->IdMappingCount; - PmcgNode->Node.IdReference =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_= NODE); + PmcgNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE); =20 // PMCG specific data PmcgNode->Base =3D NodeList->BaseAddress; --=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 (#83550): https://edk2.groups.io/g/devel/message/83550 Mute This Topic: https://groups.io/mt/86954332/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- From nobody Fri Apr 19 17:44:43 2024 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+83551+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 1636541812599408.1586388240595; Wed, 10 Nov 2021 02:56:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5ozlYY1788612xfpmwYn6ORJ; Wed, 10 Nov 2021 02:56:52 -0800 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.69]) by mx.groups.io with SMTP id smtpd.web11.10425.1636541811130289305 for ; Wed, 10 Nov 2021 02:56:51 -0800 X-Received: from AS8P251CA0010.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::8) by HE1PR0802MB2523.eurprd08.prod.outlook.com (2603:10a6:3:e1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 10 Nov 2021 10:56:44 +0000 X-Received: from AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::56) by AS8P251CA0010.outlook.office365.com (2603:10a6:20b:2f2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:44 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=temperror 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+83551+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT039.mail.protection.outlook.com (10.152.17.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:42 +0000 X-Received: ("Tessian outbound e7ce0d853b63:v108"); Wed, 10 Nov 2021 10:56:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 792f62d5199df015 X-CR-MTA-TID: 64aa7808 X-Received: from b48aafaeb067.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 27DAEB33-EC31-4B2A-B471-372EC870E0BE.1; Wed, 10 Nov 2021 10:56:35 +0000 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b48aafaeb067.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aooZ4kKU3Nevh1E5H5Ou/W3S8BdLcf7+AjXyZ2tgAcGLzHvs/DO1Y0HI0IM6yU4oE4t3EYA43C2u3wtPV4rmMIulhnyQRtL4KXvFN0oMneSEGojkHO8tmc1/98+Qk/qqzxTxc6YPJM1P7l6ruyWIZUI1qR2nfnDLnZOcDEh1IVsATL/n1mRfdSiNzTVMO/d1NpOCiOloF+UW118fDw1dv10nkVoXfohZyEre7xensCFjnptaqY64lVI9Lrx0q5dUF8TUtxRyqU3u6ppinPuQEZEnXiOqPagPhMzB2g3Uk50WeQ4tBeYM39TdLl6xuXG5ElGf+1K5OYPlUsKag5M7NA== 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=mLUH+7+JVdhRGBNrP7FstTXNO2wLU2UoQk1IKrc+ic4=; b=PdW7IrJLGyr06elvbOiK6Gzml0cf2Fnf7O0diQwMTDnksioQEnznBhVub9lbjf5rzCrR27WX4O+LklMBHDMnpxJq+kBVWA4ZEXOHzRHJARTWJzNHGcMHnNN8gsnpaqy8Kc2ixyZ7dAV7xOPHs55hcHmfmBcnesDVdk7ITzhaudkZk2Qyy/RuupUnS+BDoMOu/aatAaqBMfPN0be2rWgElTd/RDS8cEl8+bnUShFZKLFX5xbU35sUUrwg9p8UZOK/PMpQIdOZM2Jc2bC5nIsf1d1mXd4/Z1d4kiHnefNwP2oTaCFZTnk+Y/pNF9m2IcExGLWonDUEonj0v9sQYzLXwg== 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 DB7PR05CA0048.eurprd05.prod.outlook.com (2603:10a6:10:2e::25) by PAXPR08MB7368.eurprd08.prod.outlook.com (2603:10a6:102:22a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 10:56:33 +0000 X-Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::82) by DB7PR05CA0048.outlook.office365.com (2603:10a6:10:2e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:33 +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.2308.14; Wed, 10 Nov 2021 10:55:30 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:30 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v3 6/8] DynamicTablesPkg: IORT set reference to interrupt array if present Date: Wed, 10 Nov 2021 10:55:30 +0000 Message-ID: <20211110105532.38696-7-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df89d40b-851c-45bd-1a28-08d9a438c7cb X-MS-TrafficTypeDiagnostic: PAXPR08MB7368:|HE1PR0802MB2523: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: rqrSrbGkMIUhTPSGYBXscGUC49KqS4kDflbkJJEFkuvuFlRCh6s3KZekA8KQfNCeBxImokWbclKSQNTyTJklyxAylRiGvsLdSXzVGzzoVMQPmoh6eBDzq8QkbD1SbD4QJilzka/F5qnwaWFgSdft/iD4+ns8flSwk6wo82qYKZ1A4gUv3cnsgB8e/HZ+imaRprBnI5VoypXITNc5TDTilkRjVC9LJlVcO3QUYulrittULdU5FxmR1Ag3Qwi3RadH7vRxrZwDDj4BXXfMpA0LFuk+J9orwFg7jG5aqh0NNX/g3aRykpLRRXuGgWN0Tj2JKRZZZ4vl1qPr3tNknEKP76GXHganqTH8z48igsMF6NdfeWFx86C0NjdseRV3F+KasDNKp6PPpvjEz6a8NYfh3I7JlY1sqIjwkM3/ZfqCvvMIyLwecr+e9MuI6b3uaqgne6JCTocGdGkFUOIrjI1Bi8tXmkKHYVEXnuS01I4mQkpoI3xpLfp2XZHBTOVojx9u5K6MXye9OQOzEIg3edvD1F8jnx4iBcgrQkER/Rqobrh40WDE5Ta2eugdVB02RRC+yQff3dyJCXUAqeaXB2PmHuk+diSHL80guuiJIM4LpN1gZzftAAaD5SPi56l8FEQdUuhuL3A76FADKZpnFpBlzA6Byc+tk4Kfe5jJAi9/GOY6Z0X+JMC3+0Im4HbU0vN5JHsP+Nmo9aZPCvP0OqzOIA9vPuI5znQwLii1K2lIvfdY6MCcbQ37vt3AZ3WKgfpEXdnOOnPrxZMTvxAl6D1fNBDhahvbLOno10xMXYAxfgspanlg7qwb4jblp/+HaKgf 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)(36840700001)(46966006)(316002)(966005)(508600001)(2616005)(426003)(1076003)(356005)(81166007)(44832011)(5660300002)(2906002)(8936002)(4326008)(6916009)(82310400003)(36860700001)(47076005)(7696005)(86362001)(70206006)(36756003)(186003)(54906003)(70586007)(336012)(83380400001)(26005)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7368 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3c0ce140-3dbd-488b-8582-08d9a438c258 X-Microsoft-Antispam-Message-Info: OGbGMQOUOjH3CHSBGqi6TSMoyiT8VmeRLu+dcZAshcdiCplAV447XucKK89i2yw83uVeyh6AwUGoTa6pNgySrJk9zdUiQVr6FcbW3HPQJ3oqb//sqEGvHCxJWpagJqhNzXVoSlnWt9YNDDcTAYIv75y0UoUlA3rCrhYSffrtih467z5H+XUX24ityDCy9CqdhVpTZW+vxftR83TJhP5OAklWO8BEkQuU93tdNMvmufAzi4i/kKHsePmr2VGTDEMd7B9Y9Of+Ho8wW6WlT6La1OIB2KIALhO8rNkSDZhRNW5lItLSle2dC8eQcT6Hggopjdxq5fE/vltswT1YU9pmWtTgdf5a5MCFTBu9P4UUvANHlvRrnzYQnGqPEVqI/lM+StFzy/xje4ydBHgBICweuyjo8ay+RcD5LRasxh+cFtfBMQE2wRNzy5jjbRipEyFJYjaQ8E2lwcDKZMYwfkosXs2ZTOfDP6xOddtSoL+MlG3RNIN+G4wDA4v54zpaVW5J87nTST7QTN0+ztZ9OGpL3vxi/Zq78yICoKPLiAEskJRdFxQFvkf++iW76kMv28wnPcEbTOqu1GKpAODVma5F6OmalVwhc3TT1ZNzVfLy6Bn+QT/ZMk0rAJJxXKKSRy4IBW/qANO43OxAxLVO4HT2Q4CrlEYna6Lk64oeZDJlKiVQoLUowT4kuq7tHTgCd5xan6ByV9/iv339kkzn6K55O6jDJGLHdcfk1WVa59mHXC5DhCYI+AM5USgykWGXYWpec46gmkgq31it2V9RpXxULnp71Le80/qmvuuanqK+NqU= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:42.6066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df89d40b-851c-45bd-1a28-08d9a438c7cb 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: AM5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2523 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: z755VcJJ4UGxeERxKsTCO4M4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541812; bh=pGjHoVprpEKo/whEf8i3J+hNMEU08hHbpyah9q7XYaw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=C3BUjuItmXS4Ofb0VYuyDimczFmrPYAj0E15OF8DuMq1BGUXW/3wmhr94APlZuCrqTb spSystGIZCTM27YxLVyNMqPD4lB173+qKFBLOmFRysA0DCanNn9E+7RyPWRC3ukFMDgDh rt4PF5QpR92LyL/HaTvJ+QKRfDk4ocLiIfA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541812954100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The IORT generator is populating the reference field for Context and PMU interrupts even if their count is zero. Update the IORT generator to set the references only if the interrupt count is not 0. Also add checks to ensure a valid reference token has been provided. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois --- Notes: v2: - No code change since v1. Re-sending with v2 series. [SAMI] =20 v3: - Move error handling for IdMappingToken. [PIERRE] - Moved error handling for IdMappingToken in a separate [SAMI] patch in v3 series. Ref: https://edk2.groups.io/g/devel/topic/83600728#76662 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 82 ++++= +++++++++------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 46ff1e6d03852daa2058b8bd13f4b18f775aba6e..4c7e99f8c05fdf0a490abb9677e= 54862efa1ddf2 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1158,6 +1158,7 @@ AddSmmuV1V2Nodes ( EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * ContextInterruptArray; EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * PmuInterruptArray; UINT64 NodeLength; + UINT32 Offset; =20 ASSERT (Iort !=3D NULL); =20 @@ -1200,47 +1201,74 @@ AddSmmuV1V2Nodes ( SmmuNode->GlobalInterruptArrayRef =3D OFFSET_OF (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE, SMMU_NSgIrpt); =20 + Offset =3D sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE); // Context Interrupt SmmuNode->NumContextInterrupts =3D NodeList->ContextInterruptCount; - SmmuNode->ContextInterruptArrayRef =3D - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE); - ContextInterruptArray =3D - (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode + - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE)); + if (NodeList->ContextInterruptCount !=3D 0) { + SmmuNode->ContextInterruptArrayRef =3D Offset; + ContextInterruptArray =3D + (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode + Offset); + Offset +=3D (NodeList->ContextInterruptCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); + } =20 // PMU Interrupt SmmuNode->NumPmuInterrupts =3D NodeList->PmuInterruptCount; - SmmuNode->PmuInterruptArrayRef =3D SmmuNode->ContextInterruptArrayRef + - (NodeList->ContextInterruptCount * - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); - PmuInterruptArray =3D - (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode + - SmmuNode->PmuInterruptArrayRef); + if (NodeList->PmuInterruptCount !=3D 0) { + SmmuNode->PmuInterruptArrayRef =3D Offset; + PmuInterruptArray =3D + (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode + Offset); + } =20 SmmuNode->SMMU_NSgIrpt =3D NodeList->SMMU_NSgIrpt; SmmuNode->SMMU_NSgIrptFlags =3D NodeList->SMMU_NSgIrptFlags; SmmuNode->SMMU_NSgCfgIrpt =3D NodeList->SMMU_NSgCfgIrpt; SmmuNode->SMMU_NSgCfgIrptFlags =3D NodeList->SMMU_NSgCfgIrptFlags; =20 - // Add Context Interrupt Array - Status =3D AddSmmuInterruptArray ( - CfgMgrProtocol, - ContextInterruptArray, - SmmuNode->NumContextInterrupts, - NodeList->ContextInterruptToken - ); - if (EFI_ERROR (Status)) { - DEBUG (( - DEBUG_ERROR, - "ERROR: IORT: Failed to Context Interrupt Array. Status =3D %r\n", - Status - )); - return Status; + if (NodeList->ContextInterruptCount !=3D 0) { + if (NodeList->ContextInterruptToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Context Interrupt token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->ContextInterruptToken, + Status + )); + return Status; + } + + // Add Context Interrupt Array + Status =3D AddSmmuInterruptArray ( + CfgMgrProtocol, + ContextInterruptArray, + SmmuNode->NumContextInterrupts, + NodeList->ContextInterruptToken + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to Context Interrupt Array. Status =3D %r\n= ", + Status + )); + return Status; + } } =20 // Add PMU Interrupt Array - if ((SmmuNode->NumPmuInterrupts > 0) && - (NodeList->PmuInterruptToken !=3D CM_NULL_TOKEN)) { + if (SmmuNode->NumPmuInterrupts !=3D 0) { + if (NodeList->PmuInterruptToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid PMU Interrupt token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->PmuInterruptToken, + Status + )); + return Status; + } + Status =3D AddSmmuInterruptArray ( CfgMgrProtocol, PmuInterruptArray, --=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 (#83551): https://edk2.groups.io/g/devel/message/83551 Mute This Topic: https://groups.io/mt/86954333/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- From nobody Fri Apr 19 17:44:43 2024 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+83544+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 1636541751692406.58832661595716; Wed, 10 Nov 2021 02:55:51 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 678OYY1788612xr9QtWKWjRQ; Wed, 10 Nov 2021 02:55:51 -0800 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.47]) by mx.groups.io with SMTP id smtpd.web09.10582.1636541749645039062 for ; Wed, 10 Nov 2021 02:55:50 -0800 X-Received: from AM9P195CA0016.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::21) by AS8PR08MB7356.eurprd08.prod.outlook.com (2603:10a6:20b:447::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 10:55:46 +0000 X-Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:21f:cafe::28) by AM9P195CA0016.outlook.office365.com (2603:10a6:20b:21f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 10:55:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83544+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 VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:46 +0000 X-Received: ("Tessian outbound d49ee2bec50d:v108"); Wed, 10 Nov 2021 10:55:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7bf7476e61918c55 X-CR-MTA-TID: 64aa7808 X-Received: from c2fe87a01108.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0B85C578-636A-4686-8FD3-5820FEC40B4C.1; Wed, 10 Nov 2021 10:55:38 +0000 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c2fe87a01108.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:55:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vb1jQLGqaLcBAIOsfCLNb6wgQcdYUVZBkZIFPTJHp0mDoLItETR7evzz5DAeiquZcb/6ObYvLkigKHuwKSu92bTVNI9xMSzK73/65ZpZwd8NcOD5mh/mOtyBqGJenz1Uskv7/c2H6Gxjfe4AY+l0SnheQVru8LUp+AJ2Sd/J3Hdx2X3KOV0fCSRVEbqSBeyNJm1J3AO9/lj66PqVeFSj9xzPDqc7ezFMPUQB3jBmb3DZLh2Y8ATeKW0DnJxRfJNFs1VhOFkDYow+QSM+14pDYvWevM34/nT+L4JggXCWt1wnHUzdbqxvzJnuF31l3Hi9DziJQi5o9RHpGKNJ1PRU/g== 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=Jy7QEE7P3zNOWgZPrLFqSFZi7v5KLEm/xwfkvBIDGp0=; b=MhaSsXfvR95sYuWKue/6gxzC6DtvVPbowYgEaJfe/3gsk4NGfNmpLEjSOPecCvIWdo8bkH+ayWA/He0uQGuqWCqxfFhZWTg0Ixi4m71h68voth1BAecOr55Gq7WV1lf+mnimS4M10U7XaqdJHmZgnfP5uUcCh3JupexuTJbZr+PRJ69JTQDteJrD40eOq4OxSS6vmJRpT5PBNtbaa/oUQ7qD/K1RU3I6xXK7xwGqinkSl/EEVAJjjZp320m3vaw2a3wm+biU/q61tmZgZye460rJpXyl35sutVxh+aKz2FW8Dk5Lj4S5bygqWYeInd78R4SoezQLvVHsigj8nmbKow== 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 AM6P191CA0004.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::17) by DB6PR0801MB1621.eurprd08.prod.outlook.com (2603:10a6:4:39::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 10:55:33 +0000 X-Received: from VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::b2) by AM6P191CA0004.outlook.office365.com (2603:10a6:209:8b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 10:55:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 VE1EUR03FT037.mail.protection.outlook.com (10.152.19.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:33 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 10 Nov 2021 10:55:31 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 10 Nov 2021 10:55:31 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:31 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v3 7/8] DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.b Date: Wed, 10 Nov 2021 10:55:31 +0000 Message-ID: <20211110105532.38696-8-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34f309ca-29ad-419f-00ad-08d9a438a62c X-MS-TrafficTypeDiagnostic: DB6PR0801MB1621:|AS8PR08MB7356: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: UIE5I48sUx+jjFxlGNkWpidLD99w/1leEOQCiEw6gDlgJgy3Syu2p/FvXwcoZD42UHmKwp+Hf0emjV51JEC6cAWRjyZbDQWw8RtQMhrt/F+0iq70cQkrx35A+W87DBiGCzlW7GcclBuqKMjucVXh1+myJOXG5nq74S/Qu5/pMSaXAJnaqipS90Ug2OpYx/Y5jn1JaEV2h9B/ARvJ1aunFgy8OZLdNdlFdtK/t3BLBs0nKdaq8U9wi0vUXaM2psoaTV5vQHftWJl8Y34HSc/npCC+b7Kl+2KVitma+3itY55xyPXbkAhibpezd13snjSiFEGmFJboH2RQO9YZUiTnLarwoeYb4Tv2Ab91ztpVNwhNGATOMiYD0fxwBkQsBZoOhljvujGepX4KBNCBNodMH8ah2Mi9HKW/eiCNxFSBk0mdSpjdJZw8MIF2rxcvAU1+zM1GIw79jVm41+jo2+mwOtg2Q0eAcHhUDSzeb7BgPVDmgGWy2kv2aFcv/xYASo4FYQ1gsSqEj68N0DO+Qe6KoFC0XYrPiC/V+HDeQlsphyLw7ZJLuoAMjK1u1P1TOfG8snCl2JbZ5rkMSwCxTSEP054JguOPYzWMFR0rgHTVK5pD7n9+T60pqr/tYDE47Xb6KtYL3yyXQXpDsSWfm7YdtjQZ6xQR/JJhhETR6SDGcJEbQ5fIx5ZaKzX3/ByLdzbSl3IdiaL2IXUXmhsaHf82qLneuoUtqBI05PsLGC1KjgzsU1RaSM3Xp4LchtNdJgC8xq0qLnHpyQyX6I6IrYPIaBMqmpkYTdCzWL+HLRpYLpnSEZRppVO2W3uActI7MAaJ1YJnmYfI5LMwzEhakYtDaCXq2ivadmHNxZpeB6a30XI= 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)(46966006)(36840700001)(70586007)(2906002)(19627235002)(36860700001)(1076003)(15650500001)(508600001)(70206006)(47076005)(54906003)(6916009)(8936002)(316002)(336012)(356005)(86362001)(82310400003)(966005)(81166007)(2616005)(5660300002)(426003)(4326008)(36756003)(8676002)(186003)(7696005)(26005)(83380400001)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1621 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b0c5270e-e49a-4374-9c0b-08d9a4389e60 X-Microsoft-Antispam-Message-Info: SAzuvUnDwOT2SgeR+5N+vMetq/u/g17HO02gB9zuLW4Ausp/4LkLs1UHlR+vnuuxEO+eK9htL0AG0NApQKkvYGZ83qBdbN6CDqzW8Hmlra9hsj/MoceeWwfsEKm0k4dR35hCdTO61VbC2d8csYdxyDPTNvNjrLM0RDABB03ApCxcmow4KNW9qI/6j51Kj9+627l3Q2v42Me6dd27BsqE5ngrut8E0VLVgxvZSMgELtx/w6ZK4dX36p7GD8P7OhD+9iVumo8mkapVPOlFyXCJRRUvcnmp0sYdo9rsIlUWaPSt32AVi7hRJ0F294KArw7gNQVkcN08QMPJ+i1lTueabJOU+ETm51TqEOOO67SPvTM66tSf0f6KXwKMBq1NRj43Ckrs6Ff78ncwHIInaBHUFPKoBXIOqbUZlYpldReQGLX1nC6xXuKzc/cu65lO+wBXDnjDHKFc0r+RrmyJXWEG9q2+rY0ZYUoYGWUqRtX2xisEPxonXIjnkzAkvPrYXjW4WwWsD9wSspVmuvGbcoD+FIDs0jf0ayLkUPVFQUNjOcLIWpwjO8Yaw9uPjqXzCbC6kRml//ovXLHZSyeDpOzjQ+p2Md0yYZkh2hJyWFKiDe2gU8dWkVRUCrJ4nuJ7HlwxBMDMhK710a4YG1auxy+0q/ow0UqpIVA3xgkDrbnFdxPymdg3Ks5zCYoLc+b/2DY2/BCOQ/EsmSovaiH+9DcTRMyL/WHdLKhS/qi8b5ztOdDNk3davJ/iyWaYB+xq6j17WZpERfn2knaHRd2dG0AWUYvOCM5TO0p7Xpj1kVDmf37JsG7TMR9Tv/u7+QkUGedEy78q5k0YuKAdzKxlRO60KQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:55:46.1481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34f309ca-29ad-419f-00ad-08d9a438a62c 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: VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7356 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: fTZfG6NCT8LqBiNPG6RLnyZPx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541751; bh=ranUhJSq3pIvaaDG9wAYE+bv/ogdm2GGA00ERx3sSYc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=NGBmTPNJuDSd2fEs2DTnObcw/7hvQ23GMJY6xQFZ1YzGjnkhpvRwn8uGuqmhYDCyeF3 Q1zxfHLAwhIBl7etktVdvZVDeMlKBe8zZIreJUhlq6tXfq3ERNZRgPy76SsZKQh7lE/x9 eTYFQlLQ+rMt/ftlO5vHJ90yG/TR/ckf9k8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541753185100002 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 Arm namespace objects to: - add Identifier field to IORT nodes. - introduce enums to represent RMR nodes and Memory Range descriptors. - add definition of node type 6 - Reserved Memory Range node. - add definition for Memory Range Descriptors. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois --- Notes: v2: - No code change since v1. Re-sending with v2 series. [SAMI] =20 v3: - Move Identifier field before Flags field in [PIERRE] CM_ARM_RMR_NODE. - Add description for CM_ARM_MEMORY_RANGE_DESCRIPTOR [PIERRE] field. - Updated based on review feedback. [SAMI] Ref: https://edk2.groups.io/g/devel/topic/83600723#76659 DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index f19c9c70666970bb70b6aa09f064bb10a9a67112..9fb08eef4aa4b4b51c5c7946a08= 451219e89d622 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -59,6 +59,8 @@ typedef enum ArmObjectID { EArmObjSerialPortInfo, ///< 35 - Generic Serial Port Info EArmObjCmn600Info, ///< 36 - CMN-600 Info EArmObjLpiInfo, ///< 37 - Lpi Info + EArmObjRmr, ///< 38 - Reserved Memory Range Node + EArmObjMemoryRangeDescriptor, ///< 39 - Memory Range Descriptor EArmObjMax } EARM_OBJECT_ID; =20 @@ -467,6 +469,9 @@ typedef struct CmArmItsGroupNode { UINT32 ItsIdCount; /// Reference token for the ITS identifier array CM_OBJECT_TOKEN ItsIdToken; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_ITS_GROUP_NODE; =20 /** A structure that describes the @@ -498,6 +503,9 @@ typedef struct CmArmNamedComponentNode { the entry in the namespace for this object. */ CHAR8* ObjectName; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_NAMED_COMPONENT_NODE; =20 /** A structure that describes the @@ -526,6 +534,9 @@ typedef struct CmArmRootComplexNode { UINT32 PciSegmentNumber; /// Memory address size limit UINT8 MemoryAddressSize; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_ROOT_COMPLEX_NODE; =20 /** A structure that describes the @@ -568,6 +579,9 @@ typedef struct CmArmSmmuV1SmmuV2Node { UINT32 SMMU_NSgCfgIrpt; /// SMMU_NSgCfgIrpt interrupt flags UINT32 SMMU_NSgCfgIrptFlags; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_SMMUV1_SMMUV2_NODE; =20 /** A structure that describes the @@ -604,6 +618,9 @@ typedef struct CmArmSmmuV3Node { UINT32 ProximityDomain; /// Index into the array of ID mapping UINT32 DeviceIdMappingIndex; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_SMMUV3_NODE; =20 /** A structure that describes the @@ -628,6 +645,9 @@ typedef struct CmArmPmcgNode { =20 /// Reference token for the IORT node associated with this node CM_OBJECT_TOKEN ReferenceToken; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_PMCG_NODE; =20 /** A structure that describes the @@ -946,6 +966,46 @@ typedef struct CmArmLpiInfo { CHAR8 StateName[16]; } CM_ARM_LPI_INFO; =20 +/** A structure that describes the + RMR node for the Platform. + + ID: EArmObjRmr +*/ +typedef struct CmArmRmrNode { + /// An unique token used to identify this object + CM_OBJECT_TOKEN Token; + /// Number of ID mappings + UINT32 IdMappingCount; + /// Reference token for the ID mapping array + CM_OBJECT_TOKEN IdMappingToken; + + /// Unique identifier for this node. + UINT32 Identifier; + + /// Reserved Memory Range flags. + UINT32 Flags; + + /// Memory range descriptor count. + UINT32 MemRangeDescCount; + /// Reference token for the Memory Range descriptor array + CM_OBJECT_TOKEN MemRangeDescToken; +} CM_ARM_RMR_NODE; + +/** A structure that describes the + Memory Range descriptor. + + ID: EArmObjMemoryRangeDescriptor +*/ +typedef struct CmArmRmrDescriptor { + /// Base address of Reserved Memory Range, + /// aligned to a page size of 64K. + UINT64 BaseAddress; + + /// Length of the Reserved Memory range. + /// Must be a multiple of the page size of 64K. + UINT64 Length; +} CM_ARM_MEMORY_RANGE_DESCRIPTOR; + #pragma pack() =20 #endif // ARM_NAMESPACE_OBJECTS_H_ --=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 (#83544): https://edk2.groups.io/g/devel/message/83544 Mute This Topic: https://groups.io/mt/86954321/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- From nobody Fri Apr 19 17:44:43 2024 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+83552+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 163654181714046.71389635273988; Wed, 10 Nov 2021 02:56:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id oYmGYY1788612xf7yUFHrJ8n; Wed, 10 Nov 2021 02:56:56 -0800 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.81]) by mx.groups.io with SMTP id smtpd.web12.10333.1636541815243875607 for ; Wed, 10 Nov 2021 02:56:56 -0800 X-Received: from DB6PR0501CA0034.eurprd05.prod.outlook.com (2603:10a6:4:67::20) by VI1PR0801MB1709.eurprd08.prod.outlook.com (2603:10a6:800:59::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 10:56:48 +0000 X-Received: from DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::96) by DB6PR0501CA0034.outlook.office365.com (2603:10a6:4:67::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 10:56:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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+83552+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 DB5EUR03FT027.mail.protection.outlook.com (10.152.20.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:48 +0000 X-Received: ("Tessian outbound e7ce0d853b63:v108"); Wed, 10 Nov 2021 10:56:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7587b63608ac86b2 X-CR-MTA-TID: 64aa7808 X-Received: from 2f29d90232e6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6BBB1B23-7DF9-4100-A5A1-6EC4D304EAF9.1; Wed, 10 Nov 2021 10:56:41 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2f29d90232e6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 10:56:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5f2k7pAE9HEZIqQQqhoP1ZbAaiJG8/9rYPLUamF4Bhfe2WT8Vy38+G9v+RMm94CfJs5kZ4m3sBpkr8wgd5IPewK6gc87ZJjjAxATBY+oyDnHC0tHZiuXnPxAfKwHuNxBES3158sZkqNlENw+CpLVPsdnrwlkSIa+jKPjvsep1RsqMFn2WN6kk553cEAL4ak2I2XVvs2LbGRbMD2pwa33UTNfS2mEB58nAb2YYA8Pv/jwGzw5gnEiRfKGQl6/fcgylqLtMrv69mjQTVrK4j8MD6M2xfgZZaOscdNgJI5ToMrmRgYvAbrQ1FDJyUF1rokyWgsS8+hzNn3gHpjZ/JiCA== 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=D9HLtV7tPQyfP4NcHB3O6Qnuuurq9tVrnkwmHDa6nIg=; b=VqAArl2lTmq2gx4OJ09mPoJohe9+aDgDLPPzT1bogR0a9IJgrNpvke61WZO2TFZhHqKPpFQFjPMQRTWYvfUIx9MjMzqJ8XnwF1u6K22zH6XAXQqqiVQCs80NJtUEdTpp1S25LHbebOTPBmEM36SfyeDARwDHxbPsqV/zPissjRV2kDv9TUtQC49C9VbeyIKm/S4PoMk83ZcqtnJ+N+xgJRSadg4cprsfTqIiAEGv8aVQ9AxtW24upapbRw4naAltxIsBSCtCyhYBXYd4cYF9b8b2gqDLaAWT5RQwAI/hIcnn7ZbgD1KYbLCH7pkiO88qP32dPYZOtQs2pioPAiUmXA== 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 DB7PR05CA0041.eurprd05.prod.outlook.com (2603:10a6:10:2e::18) by AM0PR08MB5041.eurprd08.prod.outlook.com (2603:10a6:208:162::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 10:56:35 +0000 X-Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::55) by DB7PR05CA0041.outlook.office365.com (2603:10a6:10:2e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 10:56:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;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 DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 10:56:35 +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.2308.14; Wed, 10 Nov 2021 10:55:31 +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.2308.14 via Frontend Transport; Wed, 10 Nov 2021 10:55:31 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v3 8/8] DynamicTablesPkg: IORT generator updates for Rev E.b spec Date: Wed, 10 Nov 2021 10:55:32 +0000 Message-ID: <20211110105532.38696-9-sami.mujawar@arm.com> In-Reply-To: <20211110105532.38696-1-sami.mujawar@arm.com> References: <20211110105532.38696-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf522c9b-14d1-4dc0-9c09-08d9a438cb0b X-MS-TrafficTypeDiagnostic: AM0PR08MB5041:|VI1PR0801MB1709: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yu7cqOn037gdmhj+iZYKzNvoLfKCXgPeZGEUyP519e3dOxrZxiRnfuxfiT5srNkWNWWnMzZr4xR91br0sP9/gCJYh7xWYbZMZcqak+KYja53fL++mu/G8eFSQGCYeOb5htT7c+3tHy2G8nwYOq/YLhN/L6ykyOWmZ31M4iiB96mKW+ro+zw/L+vUYg3zL1PhWe3x+CMkzmT5pSerqyLMlgKb6izD6chsWPuDZClFZdd5G/W+vL2HqkC58dmvmRauAxzlZ1EaL2bleXWXZCUmtYS5shALCbKaPdNwrEajazrHZEkWksmuCXBCGYK4EA4MxLB3JPvU/lxnyaKmgCsID3lViqJrVRUhpW4gedzKMuE7bYwcTZwOrn4Uw/JmnYrOAaVnAnHcWe2+O09P4+z22S//MB/W2qdVB/OtaWGMtoaZJ5niPS7T+YLIn/9N4QtwqcCzvr29dDzOrVntPpV0/gaCQiGOfKpWKYxODQdKXs4Gm19sRzKVPk3fb4G5mBb5H5g/EBTUwBKVpcD0oJIiJ+FsqYbFbEqp2b8Muvg4uGWxbbklPcwjHRJbzbzCR/KUf537E8jxEDkSuCpjZ5tPAiIh50wUdOVRUL9tgQKAvTZ2zyXobN8fXopbAfkqoepf+X0phpWvLEJHySb4H5lSTszcCIpOjp/0c5v8cEFsQCbe2mSw2GuE4SrbJrf3zXiK7Q6ym6pZu8PhJoLwK2rJF+JWqnQvP0f0llA45dP0ZI1k37JW+CnikViDGEI9xhnaSEJuBphBY07Z65ciaumucx37oZ2G/otMxqozJdXxxfVQ3opGePl84y4VYhmWcjNQe0hY/bXKFPEK150FSGwiJvedwJxaxTaObzCpxYYH4GA= 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)(36840700001)(46966006)(8676002)(186003)(356005)(19627235002)(54906003)(70586007)(70206006)(81166007)(83380400001)(2906002)(1076003)(5660300002)(47076005)(316002)(8936002)(15650500001)(26005)(30864003)(36860700001)(336012)(82310400003)(966005)(36756003)(508600001)(426003)(44832011)(2616005)(4326008)(7696005)(6916009)(86362001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5041 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: af8048d0-563d-4303-0f85-08d9a438c372 X-Microsoft-Antispam-Message-Info: WQtzja1LEMnpGyP8qut6MbExLddyqB247bcnK8k00+y5OIvmu1c9EeKEMD0NQMPX5HU50QBxCI2vnwajaMEVVPN75HipbPVuEQNIHQ4/bxJ1H3JA4pVxeNcCrKafqpRhzH5sKq0PPNiPhcFCI9H9Tr6kM6ZKD8wQocYSMfQRU4CbmGRuJFIrp1x29a1ybuPlhXgnD+ZY2cHdfYcBFHI9SH4Ar7BLvec+5OwAlsU/Fwrk27PsqaK+anusi4dmLNFfjgAstR+9068lk6bh3UZimaF8IHRxItDSTF/9F/9MzDM1n/T8BbiVEexFFkUKSsmlmeiKgw0jrg6vnsi89OBoRZfAdzQPg6ff8gX/SCq2Ol1Cf3gXbGvDT9Z3ZAhhMVVjrFmw7krwG/0vkAMrqRTSkmFf0tQbWHfzgSBJDVQRAlfaayvZRO9KTbfsqlUjPL48KQnCvCXnu37xx4G9w9D0K9RjZf4XHFTap+7SMa9+9jZ0ylN6llFS96o2uhLVFAecyr7lkpq2L8blFfdOcTR5Ehg/bwNFb4kX7IGgvYoic+ncqz+1Ryfm3qaNvM0fRk/OYMA9/PD6UVRDx3cVg6m8K7B+RMyUKTeEcyo4ZRMYOJW23vOogk87gIXHR76B3D6R35sKyjhnWbxUBpZREMozwUjsMQRgLGsJce4xbbecZWqIa0CaHwfY771OUS3ihHZerm+sl5R6KINvD0NEQENn85VLz4oQFzu4Yey2mddPGuJ0nfFGslqQ6Eh7JxPMOkUnewskhrExI31pGUcQSUBwb6oq65WUn2i2GhqrHdPayihjV3nO4fW6066TwvldLKEQZdxQ9Z4rFP6XuhPoDmXJmw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 10:56:48.1205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf522c9b-14d1-4dc0-9c09-08d9a438cb0b 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: DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1709 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: 7V9T98jmC09x2GNMaiov3YTGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636541816; bh=2VFJ9aw7Nfkm3B5mub8Cujp9kUu54gymLniqHZm2v/A=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=F1wSwiA3yEwe71diQ90D5SlIkmxhlmoU/SFgW/eMv2j5c1EYFi4MPYtP9/im1pOCXC0 vrVg3mz8kKitEFCDPYuF1BLWBC3yd9JdT6C7LH1Y1rUJFEHfYixouanVnJzIslGRGFyvI XcG11/uhl5CPOL5AvU+KbnnFhkIIWHOhmZk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636541819470100004 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 generator to: - increment IORT table revision count to 3. - populate Identifier filed if revision is greater than 2. - add support to populate Reserved Memory Range nodes and the Memory range descriptors. - add validation to check that the Identifier field is unique. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois --- Notes: v2: - The macro EFI_ACPI_IO_REMAPPING_TABLE_REVISION was set to [SAMI] Rev 0 as setting to Rev 3 will break existing platforms. Therefore, set the max supported IORT generator revision to 3. =20 v3: - Move error handling for IdMappingToken. [PIERRE] - Moved error handling for IdMappingToken in a separate [SAMI] patch in v3 series. Ref: https://edk2.groups.io/g/devel/topic/83600726#76661 DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 586 +++= +++++++++++++++-- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h | 5 +- 2 files changed, 559 insertions(+), 32 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 4c7e99f8c05fdf0a490abb9677e54862efa1ddf2..9b687f0165e6136f2f24749d27d= ee27edaff1b31 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -5,8 +5,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): - - IO Remapping Table, Platform Design Document, - Document number: ARM DEN 0049D, Issue D, March 2018 + - IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021 + (https://developer.arm.com/documentation/den0049/) =20 **/ =20 @@ -37,9 +37,11 @@ Requirements: - EArmObjSmmuV1SmmuV2 - EArmObjSmmuV3 - EArmObjPmcg + - EArmObjRmr - EArmObjGicItsIdentifierArray - EArmObjIdMappingArray - - EArmObjGicItsIdentifierArray + - EArmObjSmmuInterruptArray + - EArmObjMemoryRangeDescriptor */ =20 /** This macro expands to a function that retrieves the ITS @@ -96,6 +98,24 @@ GET_OBJECT_LIST ( CM_ARM_PMCG_NODE ); =20 +/** This macro expands to a function that retrieves the + RMR node information from the Configuration Manager. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjRmr, + CM_ARM_RMR_NODE + ); + +/** This macro expands to a function that retrieves the + Memory Range Descriptor Array information from the Configuration Manag= er. +*/ +GET_OBJECT_LIST ( + EObjNameSpaceArm, + EArmObjMemoryRangeDescriptor, + CM_ARM_MEMORY_RANGE_DESCRIPTOR + ); + /** This macro expands to a function that retrieves the ITS Identifier Array information from the Configuration Manager. */ @@ -177,13 +197,16 @@ GetSizeofItsGroupNodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetItsGroupNodeSize (NodeList); @@ -250,13 +273,16 @@ GetSizeofNamedComponentNodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetNamedComponentNodeSize (NodeList); @@ -322,13 +348,16 @@ GetSizeofRootComplexNodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetRootComplexNodeSize (NodeList); @@ -400,13 +429,16 @@ GetSizeofSmmuV1V2Nodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetSmmuV1V2NodeSize (NodeList); @@ -471,13 +503,16 @@ GetSizeofSmmuV3Nodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetSmmuV3NodeSize (NodeList); @@ -542,13 +577,16 @@ GetSizeofPmcgNodes ( (*NodeIndexer)->Token =3D NodeList->Token; (*NodeIndexer)->Object =3D (VOID*)NodeList; (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; DEBUG (( DEBUG_INFO, - "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p, Offset =3D = 0x%x\n", + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", *NodeIndexer, (*NodeIndexer)->Token, (*NodeIndexer)->Object, - (*NodeIndexer)->Offset + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier )); =20 Size +=3D GetPmcgNodeSize (NodeList); @@ -558,6 +596,83 @@ GetSizeofPmcgNodes ( return Size; } =20 +/** Returns the size of the RMR node. + + @param [in] Node Pointer to RMR node. + + @retval Size of the RMR node. +**/ +STATIC +UINT32 +GetRmrNodeSize ( + IN CONST CM_ARM_RMR_NODE * Node + ) +{ + ASSERT (Node !=3D NULL); + + /* Size of RMR node + + Size of ID mapping array + + Size of Memory Range Descriptor array + */ + return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE) + + (Node->IdMappingCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) + + (Node->MemRangeDescCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC))); +} + +/** Returns the total size required for the RMR nodes and + updates the Node Indexer. + + This function calculates the size required for the node group + and also populates the Node Indexer array with offsets for the + individual nodes. + + @param [in] NodeStartOffset Offset from the start of the + IORT where this node group starts. + @param [in] NodeList Pointer to RMR node list. + @param [in] NodeCount Count of the RMR nodes. + @param [in, out] NodeIndexer Pointer to the next Node Indexer. + + @retval Total size of the RMR nodes. +**/ +STATIC +UINT64 +GetSizeofRmrNodes ( + IN CONST UINT32 NodeStartOffset, + IN CONST CM_ARM_RMR_NODE * NodeList, + IN UINT32 NodeCount, + IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer + ) +{ + UINT64 Size; + + ASSERT (NodeList !=3D NULL); + + Size =3D 0; + while (NodeCount-- !=3D 0) { + (*NodeIndexer)->Token =3D NodeList->Token; + (*NodeIndexer)->Object =3D (VOID*)NodeList; + (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*NodeIndexer)->Identifier =3D NodeList->Identifier; + DEBUG (( + DEBUG_INFO, + "IORT: Node Indexer =3D %p, Token =3D %p, Object =3D %p," + " Offset =3D 0x%x, Identifier =3D 0x%x\n", + *NodeIndexer, + (*NodeIndexer)->Token, + (*NodeIndexer)->Object, + (*NodeIndexer)->Offset, + (*NodeIndexer)->Identifier + )); + + Size +=3D GetRmrNodeSize (NodeList); + (*NodeIndexer)++; + NodeList++; + } + return Size; +} + /** Returns the offset of the Node referenced by the Token. =20 @param [in] NodeIndexer Pointer to node indexer array. @@ -707,6 +822,7 @@ AddIdMappingArray ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the ITS Group Nodes. @@ -723,6 +839,7 @@ EFI_STATUS AddItsGroupNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOffset, IN CONST CM_ARM_ITS_GROUP_NODE * NodeList, @@ -759,11 +876,17 @@ AddItsGroupNodes ( // Populate the node header ItsGroupNode->Node.Type =3D EFI_ACPI_IORT_TYPE_ITS_GROUP; ItsGroupNode->Node.Length =3D (UINT16)NodeLength; - ItsGroupNode->Node.Revision =3D 0; - ItsGroupNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; ItsGroupNode->Node.NumIdMappings =3D 0; ItsGroupNode->Node.IdReference =3D 0; =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + ItsGroupNode->Node.Revision =3D 0; + ItsGroupNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + ItsGroupNode->Node.Revision =3D 1; + ItsGroupNode->Node.Identifier =3D NodeList->Identifier; + } + // IORT specific data ItsGroupNode->NumItsIdentifiers =3D NodeList->ItsIdCount; ItsIds =3D (UINT32*)((UINT8*)ItsGroupNode + @@ -814,6 +937,7 @@ AddItsGroupNodes ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the Named Component Nodes. @@ -830,6 +954,7 @@ EFI_STATUS AddNamedComponentNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableIn= fo, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartO= ffset, IN CONST CM_ARM_NAMED_COMPONENT_NODE * NodeList, @@ -865,10 +990,16 @@ AddNamedComponentNodes ( // Populate the node header NcNode->Node.Type =3D EFI_ACPI_IORT_TYPE_NAMED_COMP; NcNode->Node.Length =3D (UINT16)NodeLength; - NcNode->Node.Revision =3D 2; - NcNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; NcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + NcNode->Node.Revision =3D 2; + NcNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + NcNode->Node.Revision =3D 4; + NcNode->Node.Identifier =3D NodeList->Identifier; + } + ObjectNameLength =3D AsciiStrLen (NodeList->ObjectName) + 1; NcNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? 0 : ((UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + @@ -949,6 +1080,7 @@ AddNamedComponentNodes ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the Root Comp= lex Nodes. @@ -965,6 +1097,7 @@ EFI_STATUS AddRootComplexNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProto= col, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableIn= fo, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartO= ffset, IN CONST CM_ARM_ROOT_COMPLEX_NODE * NodeList, @@ -998,12 +1131,18 @@ AddRootComplexNodes ( // Populate the node header RcNode->Node.Type =3D EFI_ACPI_IORT_TYPE_ROOT_COMPLEX; RcNode->Node.Length =3D (UINT16)NodeLength; - RcNode->Node.Revision =3D 1; - RcNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; RcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; RcNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + RcNode->Node.Revision =3D 1; + RcNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + RcNode->Node.Revision =3D 3; + RcNode->Node.Identifier =3D NodeList->Identifier; + } + // Root Complex specific data RcNode->CacheCoherent =3D NodeList->CacheCoherent; RcNode->AllocationHints =3D NodeList->AllocationHints; @@ -1129,6 +1268,7 @@ AddSmmuInterruptArray ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the SMMU v1/v2 Nodes. @@ -1145,6 +1285,7 @@ EFI_STATUS AddSmmuV1V2Nodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInf= o, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * NodeList, @@ -1181,8 +1322,6 @@ AddSmmuV1V2Nodes ( // Populate the node header SmmuNode->Node.Type =3D EFI_ACPI_IORT_TYPE_SMMUv1v2; SmmuNode->Node.Length =3D (UINT16)NodeLength; - SmmuNode->Node.Revision =3D 0; - SmmuNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; SmmuNode->Node.NumIdMappings =3D NodeList->IdMappingCount; SmmuNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? 0 : (sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) + @@ -1191,6 +1330,14 @@ AddSmmuV1V2Nodes ( (NodeList->PmuInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT))); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + SmmuNode->Node.Revision =3D 1; + SmmuNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + SmmuNode->Node.Revision =3D 3; + SmmuNode->Node.Identifier =3D NodeList->Identifier; + } + // SMMU v1/v2 specific data SmmuNode->Base =3D NodeList->BaseAddress; SmmuNode->Span =3D NodeList->Span; @@ -1333,6 +1480,7 @@ AddSmmuV1V2Nodes ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the SMMUv3 No= des. @param [in] NodeList Pointer to an array of SMMUv3 Node Ob= jects. @@ -1347,6 +1495,7 @@ EFI_STATUS AddSmmuV3Nodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInf= o, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, IN CONST CM_ARM_SMMUV3_NODE * NodeList, @@ -1379,12 +1528,18 @@ AddSmmuV3Nodes ( // Populate the node header SmmuV3Node->Node.Type =3D EFI_ACPI_IORT_TYPE_SMMUv3; SmmuV3Node->Node.Length =3D (UINT16)NodeLength; - SmmuV3Node->Node.Revision =3D 2; - SmmuV3Node->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; SmmuV3Node->Node.NumIdMappings =3D NodeList->IdMappingCount; SmmuV3Node->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + SmmuV3Node->Node.Revision =3D 2; + SmmuV3Node->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + SmmuV3Node->Node.Revision =3D 4; + SmmuV3Node->Node.Identifier =3D NodeList->Identifier; + } + // SMMUv3 specific data SmmuV3Node->Base =3D NodeList->BaseAddress; SmmuV3Node->Flags =3D NodeList->Flags; @@ -1461,6 +1616,7 @@ AddSmmuV3Nodes ( @param [in] This Pointer to the table Generator. @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. @param [in] Iort Pointer to IORT table structure. @param [in] NodesStartOffset Offset for the start of the PMCG Node= s. @param [in] NodeList Pointer to an array of PMCG Node Obje= cts. @@ -1475,6 +1631,7 @@ EFI_STATUS AddPmcgNodes ( IN CONST ACPI_TABLE_GENERATOR * CONST This, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInf= o, IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, IN CONST UINT32 NodesStartOf= fset, IN CONST CM_ARM_PMCG_NODE * NodeList, @@ -1509,12 +1666,18 @@ AddPmcgNodes ( // Populate the node header PmcgNode->Node.Type =3D EFI_ACPI_IORT_TYPE_PMCG; PmcgNode->Node.Length =3D (UINT16)NodeLength; - PmcgNode->Node.Revision =3D 1; - PmcgNode->Node.Reserved =3D EFI_ACPI_RESERVED_DWORD; PmcgNode->Node.NumIdMappings =3D NodeList->IdMappingCount; PmcgNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 3) { + PmcgNode->Node.Revision =3D 1; + PmcgNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + PmcgNode->Node.Revision =3D 2; + PmcgNode->Node.Identifier =3D NodeList->Identifier; + } + // PMCG specific data PmcgNode->Base =3D NodeList->BaseAddress; PmcgNode->OverflowInterruptGsiv =3D NodeList->OverflowInterrupt; @@ -1581,6 +1744,273 @@ AddPmcgNodes ( return EFI_SUCCESS; } =20 +/** Update the Memory Range Descriptor Array. + + This function retrieves the Memory Range Descriptor objects referenced= by + MemRangeDescToken and updates the Memory Range Descriptor array. + + @param [in] This Pointer to the table Generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] DescArray Pointer to an array of Memory Range + Descriptors. + @param [in] DescCount Number of Id Descriptors. + @param [in] DescToken Reference Token for retrieving the + Memory Range Descriptor Array. + + @retval EFI_SUCCESS Table generated successfully. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The required object was not found. +**/ +STATIC +EFI_STATUS +AddMemRangeDescArray ( + IN CONST ACPI_TABLE_GENERATOR * CONST This, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, + IN EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC * DescArray, + IN UINT32 DescCount, + IN CONST CM_OBJECT_TOKEN DescToken + ) +{ + EFI_STATUS Status; + CM_ARM_MEMORY_RANGE_DESCRIPTOR * MemRangeDesc; + UINT32 MemRangeDescCount; + + ASSERT (DescArray !=3D NULL); + + // Get the Id Mapping Array + Status =3D GetEArmObjMemoryRangeDescriptor ( + CfgMgrProtocol, + DescToken, + &MemRangeDesc, + &MemRangeDescCount + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to get Memory Range Descriptor array. Status = =3D %r\n", + Status + )); + return Status; + } + + if (MemRangeDescCount < DescCount) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to get the required number of Memory" + " Range Descriptors.\n" + )); + return EFI_NOT_FOUND; + } + + // Populate the Memory Range Descriptor array + while (DescCount-- !=3D 0) { + + DescArray->Base =3D MemRangeDesc->BaseAddress; + DescArray->Length =3D MemRangeDesc->Length; + DescArray->Reserved =3D EFI_ACPI_RESERVED_DWORD; + + DescArray++; + MemRangeDesc++; + } + + return EFI_SUCCESS; +} + +/** Update the RMR Node Information. + + This function updates the RMR node information in the IORT table. + + @param [in] This Pointer to the table Generator. + @param [in] CfgMgrProtocol Pointer to the Configuration Manager + Protocol Interface. + @param [in] AcpiTableInfo Pointer to the ACPI table info struct= ure. + @param [in] Iort Pointer to IORT table structure. + @param [in] NodesStartOffset Offset for the start of the PMCG Node= s. + @param [in] NodeList Pointer to an array of PMCG Node Obje= cts. + @param [in] NodeCount Number of PMCG Node Objects. + + @retval EFI_SUCCESS Table generated successfully. + @retval EFI_INVALID_PARAMETER A parameter is invalid. + @retval EFI_NOT_FOUND The required object was not found. +**/ +STATIC +EFI_STATUS +AddRmrNodes ( + IN CONST ACPI_TABLE_GENERATOR * CONST This, + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtoc= ol, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInf= o, + IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort, + IN CONST UINT32 NodesStartOf= fset, + IN CONST CM_ARM_RMR_NODE * NodeList, + IN UINT32 NodeCount + ) +{ + EFI_STATUS Status; + EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE * RmrNode; + EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray; + EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC * MemRangeDescArray; + UINT64 NodeLength; + + ASSERT (Iort !=3D NULL); + + RmrNode =3D (EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE*)((UINT8*)Iort + + NodesStartOffset); + + while (NodeCount-- !=3D 0) { + NodeLength =3D GetRmrNodeSize (NodeList); + if (NodeLength > MAX_UINT16) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: RMR Node length 0x%lx > MAX_UINT16. Status =3D %r\n", + NodeLength, + Status + )); + return Status; + } + + if (NodeList->MemRangeDescCount =3D=3D 0) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Memory Range Desc count =3D %d. Status =3D %r\n", + NodeList->MemRangeDescCount, + Status + )); + return Status; + } + + if (NodeList->MemRangeDescToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Memory Range Descriptor token," + " Token =3D 0x%x. Status =3D %r\n", + NodeList->MemRangeDescToken, + Status + )); + return Status; + } + + // Populate the node header + RmrNode->Node.Type =3D EFI_ACPI_IORT_TYPE_RMR; + RmrNode->Node.Length =3D (UINT16)NodeLength; + RmrNode->Node.Revision =3D 1; + RmrNode->Node.Identifier =3D NodeList->Identifier; + RmrNode->Node.NumIdMappings =3D NodeList->IdMappingCount; + RmrNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE); + + // RMR specific data + RmrNode->Flags =3D NodeList->Flags; + RmrNode->NumMemRangeDesc =3D NodeList->MemRangeDescCount; + RmrNode->MemRangeDescRef =3D (NodeList->MemRangeDescCount =3D=3D 0) ? + 0 : (sizeof (EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE) + + (NodeList->IdMappingCount * + sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE))); + + if (NodeList->IdMappingCount > 0) { + if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Id Mapping token," + " Token =3D 0x%x, Status =3D%r\n", + NodeList->IdMappingToken, + Status + )); + return Status; + } + + // Ids for RMR node + IdMapArray =3D (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)RmrNode= + + RmrNode->Node.IdReference); + + Status =3D AddIdMappingArray ( + This, + CfgMgrProtocol, + IdMapArray, + NodeList->IdMappingCount, + NodeList->IdMappingToken + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to add Id Mapping Array. Status =3D %r\n", + Status + )); + return Status; + } + } + + // Memory Range Descriptors for RMR node + MemRangeDescArray =3D (EFI_ACPI_6_0_IO_REMAPPING_MEM_RANGE_DESC*)( + (UINT8*)RmrNode + + RmrNode->MemRangeDescRef + ); + + Status =3D AddMemRangeDescArray ( + This, + CfgMgrProtocol, + MemRangeDescArray, + NodeList->MemRangeDescCount, + NodeList->MemRangeDescToken + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to Memory Range Descriptor Array. Status =3D = %r\n", + Status + )); + return Status; + } + + // Next RMR Node + RmrNode =3D (EFI_ACPI_6_0_IO_REMAPPING_RMR_NODE*)((UINT8*)RmrNode + + RmrNode->Node.Length); + NodeList++; + } // RMR Node + + return EFI_SUCCESS; +} + +/** Validates that the IORT nodes Identifier are unique. + + @param [in] NodeIndexer Pointer to the Node Indexer. + @param [in] NodeCount Number of IORT Nodes. + + @retval EFI_SUCCESS Success. + @retval EFI_INVALID_PARAMETER Identifier field not unique. +**/ +STATIC +EFI_STATUS +ValidateNodeIdentifiers ( + IN CONST IORT_NODE_INDEXER * CONST NodeIndexer, + IN UINT32 NodeCount + ) +{ + UINT32 IndexI; + UINT32 IndexJ; + + for (IndexI =3D 0; IndexI < NodeCount; IndexI++) { + for (IndexJ =3D 0; IndexJ < NodeCount; IndexJ++) { + if ((IndexI !=3D IndexJ) && + (NodeIndexer[IndexI].Identifier =3D=3D NodeIndexer[IndexJ].Ident= ifier)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: UID %d of Token %p matches with that of Token %p.\= n", + NodeIndexer[IndexI].Identifier, + NodeIndexer[IndexI].Token, + NodeIndexer[IndexJ].Token + )); + return EFI_INVALID_PARAMETER; + } + }// IndexJ + } // IndexI + return EFI_SUCCESS; +} + /** Construct the IORT ACPI table. =20 This function invokes the Configuration Manager protocol interface @@ -1625,6 +2055,7 @@ BuildIortTable ( UINT32 SmmuV1V2NodeCount; UINT32 SmmuV3NodeCount; UINT32 PmcgNodeCount; + UINT32 RmrNodeCount; =20 UINT32 ItsGroupOffset; UINT32 NamedComponentOffset; @@ -1632,6 +2063,7 @@ BuildIortTable ( UINT32 SmmuV1V2Offset; UINT32 SmmuV3Offset; UINT32 PmcgOffset; + UINT32 RmrOffset; =20 CM_ARM_ITS_GROUP_NODE * ItsGroupNodeList; CM_ARM_NAMED_COMPONENT_NODE * NamedComponentNodeList; @@ -1639,6 +2071,7 @@ BuildIortTable ( CM_ARM_SMMUV1_SMMUV2_NODE * SmmuV1V2NodeList; CM_ARM_SMMUV3_NODE * SmmuV3NodeList; CM_ARM_PMCG_NODE * PmcgNodeList; + CM_ARM_RMR_NODE * RmrNodeList; =20 EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort; IORT_NODE_INDEXER * NodeIndexer; @@ -1781,6 +2214,27 @@ BuildIortTable ( // Add the PMCG node count IortNodeCount +=3D PmcgNodeCount; =20 + if (AcpiTableInfo->AcpiTableRevision >=3D EFI_ACPI_IO_REMAPPING_TABLE_RE= V3) { + // Get the RMR node info + Status =3D GetEArmObjRmr ( + CfgMgrProtocol, + CM_NULL_TOKEN, + &RmrNodeList, + &RmrNodeCount + ); + if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to get RMR Node Info. Status =3D %r\n", + Status + )); + goto error_handler; + } + + // Add the RMR node count + IortNodeCount +=3D RmrNodeCount; + } + // Allocate Node Indexer array NodeIndexer =3D (IORT_NODE_INDEXER*)AllocateZeroPool ( (sizeof (IORT_NODE_INDEXER) * @@ -1984,6 +2438,37 @@ BuildIortTable ( )); } =20 + // RMR Nodes + if ((AcpiTableInfo->AcpiTableRevision >=3D EFI_ACPI_IO_REMAPPING_TABLE_R= EV3) && + (RmrNodeCount > 0)) { + RmrOffset =3D (UINT32)TableSize; + // Size of RMR node list. + NodeSize =3D GetSizeofRmrNodes ( + RmrOffset, + RmrNodeList, + RmrNodeCount, + &NodeIndexer + ); + if (NodeSize > MAX_UINT32) { + Status =3D EFI_INVALID_PARAMETER; + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Invalid Size of RMR Nodes. Status =3D %r\n", + Status + )); + goto error_handler; + } + TableSize +=3D NodeSize; + + DEBUG (( + DEBUG_INFO, + " RmrNodeCount =3D %d\n" \ + " RmrOffset =3D %d\n", + RmrNodeCount, + RmrOffset + )); + } + DEBUG (( DEBUG_INFO, "INFO: IORT:\n" \ @@ -2005,6 +2490,19 @@ BuildIortTable ( goto error_handler; } =20 + // Validate that the identifiers for the nodes are unique + if (AcpiTableInfo->AcpiTableRevision >=3D EFI_ACPI_IO_REMAPPING_TABLE_RE= V3) { + Status =3D ValidateNodeIdentifiers (Generator->NodeIndexer, IortNodeCo= unt); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Node Identifier not unique. Status =3D %r\n", + Status + )); + goto error_handler; + } + } + // Allocate the Buffer for IORT table *Table =3D (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize); if (*Table =3D=3D NULL) { @@ -2053,6 +2551,7 @@ BuildIortTable ( Status =3D AddItsGroupNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, ItsGroupOffset, ItsGroupNodeList, @@ -2072,6 +2571,7 @@ BuildIortTable ( Status =3D AddNamedComponentNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, NamedComponentOffset, NamedComponentNodeList, @@ -2091,6 +2591,7 @@ BuildIortTable ( Status =3D AddRootComplexNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, RootComplexOffset, RootComplexNodeList, @@ -2110,6 +2611,7 @@ BuildIortTable ( Status =3D AddSmmuV1V2Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV1V2Offset, SmmuV1V2NodeList, @@ -2129,6 +2631,7 @@ BuildIortTable ( Status =3D AddSmmuV3Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV3Offset, SmmuV3NodeList, @@ -2148,6 +2651,7 @@ BuildIortTable ( Status =3D AddPmcgNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, PmcgOffset, PmcgNodeList, @@ -2156,7 +2660,27 @@ BuildIortTable ( if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, - "ERROR: IORT: Failed to add SMMUv3 Node. Status =3D %r\n", + "ERROR: IORT: Failed to add PMCG Node. Status =3D %r\n", + Status + )); + goto error_handler; + } + } + + if (RmrNodeCount > 0) { + Status =3D AddRmrNodes ( + This, + CfgMgrProtocol, + AcpiTableInfo, + Iort, + RmrOffset, + RmrNodeList, + RmrNodeCount + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Failed to add RMR Node. Status =3D %r\n", Status )); goto error_handler; @@ -2239,11 +2763,11 @@ ACPI_IORT_GENERATOR IortGenerator =3D { // Generator Description L"ACPI.STD.IORT.GENERATOR", // ACPI Table Signature - EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE, + EFI_ACPI_6_3_IO_REMAPPING_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_IO_REMAPPING_TABLE_REVISION, + EFI_ACPI_IO_REMAPPING_TABLE_REV3, // Minimum supported ACPI Table Revision - EFI_ACPI_IO_REMAPPING_TABLE_REVISION, + EFI_ACPI_IO_REMAPPING_TABLE_REV0, // Creator ID TABLE_GENERATOR_CREATOR_ID_ARM, // Creator Revision diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h index bbf8aaf9efa38a75626a49af6f380b1c8c1a0629..afe2089b1dc20ed671583e2a309= cc1a46c3404c6 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2018, ARM Limited. All rights reserved. + Copyright (c) 2018 - 2021, ARM Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -25,6 +25,9 @@ typedef struct IortNodeIndexer { VOID * Object; /// Node offset from the start of the IORT table UINT32 Offset; + + /// Unique identifier for the Node + UINT32 Identifier; } IORT_NODE_INDEXER; =20 typedef struct AcpiIortGenerator { --=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 (#83552): https://edk2.groups.io/g/devel/message/83552 Mute This Topic: https://groups.io/mt/86954335/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-