From nobody Fri May 17 10:34:26 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+91090+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 1657101438184376.2093832401498; Wed, 6 Jul 2022 02:57:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dQZWYY1788612xg7CFuSNHvp; Wed, 06 Jul 2022 02:57:17 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.71]) by mx.groups.io with SMTP id smtpd.web10.4298.1657101436656466771 for ; Wed, 06 Jul 2022 02:57:17 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=kr5SnIi297wgylhlv2KNnZBNoCMCg/XubOwJBfOQgbCFf7/bVmx5DNscoXNJyUrciwNE1997HRD8MPnVEj4l1ll+Kc7rDj/YBhI9FwpDBoFWDhNnBiLJKThnaTf0W9HmRfOYIrsOPrzD5vkpOWsg3tT/Z1bZdrf4lIz2nMYt1KPn36F9A58xHLRjIeZe/xcflr271cvl6ucsd2uLPoKg3Mk0s5zw8tuyz8VMf09EmHm2qZmG4RiH/6YuyYmQYq8nmHPvbaKAlaUHCEEgCRprywnaiOljty8fEam4mKpeuNWbBHLdmCiAfrX7KnowcdufWOmhW4HLcUz9m/PTcXDb3A== ARC-Message-Signature: i=2; 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=Yu3uRj1WkF+VwGitIyvUIWuW1Wcn9GOeN/q8jw0vilA=; b=QKhoIHpm8oqK8ooOUko+Er7Uuf+PW1wPMFMg5MOd04VXZ4mk7V92x3y54gjuyYFbqouPUtkHIquUAc5Xxh/JbBcyCmYjfQeGfmNnd6ec+sjDUMHwV9Qacxl8SBZOwQRIfKL74v55l96gyVAS0fEVf5yRqYZBqPpBqBQKNK/nZb1um+jMDipxRNz96MT3zdHk6Kq9LaCtToD7Mcvdb9rEphowDPTr47odhduR8TfBNLdi4Ojlve8L0wBlrLha3LRGEZ+6qbjqILiGLTDFx5Y0lY8gCip0yRZ6regJOe3z932GPXA4a0mFHTACuFSAKjnlFJsPUp2uTAgMFJTIUsjquQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AM5PR0601CA0031.eurprd06.prod.outlook.com (2603:10a6:203:68::17) by AM6PR08MB5128.eurprd08.prod.outlook.com (2603:10a6:20b:e3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.18; Wed, 6 Jul 2022 09:57:12 +0000 X-Received: from AM5EUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:68:cafe::95) by AM5PR0601CA0031.outlook.office365.com (2603:10a6:203:68::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:12 +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+91090+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT051.mail.protection.outlook.com (10.152.16.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:12 +0000 X-Received: ("Tessian outbound 190453a6d737:v122"); Wed, 06 Jul 2022 09:57:12 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6b3a15d18e00db84 X-CR-MTA-TID: 64aa7808 X-Received: from d25edaa8e592.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9F45083B-04B3-42A4-AAA1-74D4129046A8.1; Wed, 06 Jul 2022 09:57:05 +0000 X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d25edaa8e592.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G65dakwX9ISTxXBzSJ684O3JOJWqQ4qfbIcjVPhtkRyAfEbTgs8UBo3UZbukvF2BI/CYhlJDE4ilWVjT+QHTxtK66XcFZstIwDgaoKrFuqzPnq091xID4KYQ6QpCQnEwQf/XwPqO4y7b1MImazDCjmktRpBa7Rg5yaI1xj4IJouUrRTKWZrFT517FDs0mP4Yv02fPw2EtJn71OUjSb0zxqOa+qoBRDkqfL2dGNVTu9MNNVndlEExwlD9SlD0RMznOxXiC/RVXFBtIsRZ8orgGq0nmvkpSs3edtYkDH3ZPfa6leQPYkl5frYnepGgc+nHaZ9k0ogfL1sR39Tu1lE38Q== 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=Yu3uRj1WkF+VwGitIyvUIWuW1Wcn9GOeN/q8jw0vilA=; b=CWz1kS7GNsA7ptfl12/x5ROufyUpix37q07NG7zL7cq8RflTXEMy1qgfoIndiYaHzk8a/VBB9Tk5gTnHUfoBUv6Kxjb/iFF9yKAMMVnETTi4LmqEp8HJnFaYm3ZeXsh3mcUAHtQQ1CzOLGzKNhULSOe8PagXzZywa09l0IzJpnZNTLkE1Lh4k3q1x7chy/Le8kUL7zQeKguzFMBS4vhk4fCfskhq0b/Ocl3vEGkA42Yg/xcHGuYjIssW7Z/n/bcg+b4AAoB5tRVtIPD3x10LLhotJFHvAASMd/ODfYbIkSt+pHee8LQZs/anX4Z+3IBTN4uOqibPf/aU+MgXui2KJA== 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 DU2PR04CA0196.eurprd04.prod.outlook.com (2603:10a6:10:28d::21) by DB8PR08MB5129.eurprd08.prod.outlook.com (2603:10a6:10:ec::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Wed, 6 Jul 2022 09:57:02 +0000 X-Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28d:cafe::1c) by DU2PR04CA0196.outlook.office365.com (2603:10a6:10:28d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:02 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:02 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:33 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:32 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , , , , , , Subject: [edk2-devel] [PATCH v4 1/8] MdePkg: IORT header update for IORT Rev E.d spec Date: Wed, 6 Jul 2022 10:56:24 +0100 Message-ID: <20220706095631.27196-2-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: dfab1ce8-eb54-4573-cf6c-08da5f35e624 X-MS-TrafficTypeDiagnostic: DB8PR08MB5129:EE_|AM5EUR03FT051:EE_|AM6PR08MB5128:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 457QPzYN2diGcczYUNCEk3myI+r+FjOWbM2FA/Zo0bGq9NI523+QTP1cxf98lQG1KsRhjuN7zAeXn9wCl8v7rHKj3nVB4gbamvn9n5hUSm75MvWT6eXxESMU2q215RyAVXo5F54KXn5+PL/d4USx90M4+BWqsICTk88TfW+v5s8iUK9qNV+csGduC/1OGY632t7p8Fy425BnKFgn2j+hReyqTFncHtB7hcw5AgQG+oc5DueyLbYvgdse3zZ2xTFQB1yqvJB5ONDimZp3PanTjSEV5Lx0rIjbarQ0f8elfHSVFa98v7TtHQEvaTMUFGLNuz9eet4FKf/d4VoUR4oEyaKmrihA1M337b5B9P/uXLOuIwz/VFcxYFcC2nDDB/lwiiGYjAzTPzi76klCDv0zeYv8iFsg3ZWu8lh+4QizHrM2xzJYLt2Bng3GTOJqoviiCS0WhgMOfbpuhtL/hASHzfXX6sPuALHjnlnKASlnIm0strwV4yaE9+gaGnyWIpYb9CeL0+dBEe7sTQB33eac4uY6foncf+sPEffJV6jTaA70W0XRg/JOpNDc1A5uGXZ8olnqmFFBd7UckzdyZuVd5wa5JZS8kqT/nQBKSOgWcjtr9kQT071GWa3p/TvKEL8XOTbu2a4WK3Jp1Ybs/PqkWpnOi2LbEgeqVthVNBkhQ47OUF+6Y/y9zP6fQWRbXhQNIYhFkIFFLHdbMItFggcjgFNHHe1SLJ0rjqNJCpi9OjKVrdLk/84A/3z8kLHUUM69bVgkGRmryOnrATWMuOqiAcbKlikx7x6pL6FQb8BhSKxDGIXMYrDDZZ8cRvk07v9azPK8JbqziQLK9vwcWuBZC/4fG91j+NSp1aN7kX2VPxqtKunMPryy18dWMEv4RKe9TcDOpjp9bLi7iP1qcvqIOKsmRQONhvjJEZq74LsZ5CY= 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:(13230016)(4636009)(396003)(346002)(376002)(39860400002)(136003)(46966006)(36840700001)(40470700004)(36756003)(26005)(40460700003)(7696005)(2616005)(15650500001)(186003)(83380400001)(82740400003)(336012)(1076003)(478600001)(40480700001)(2906002)(44832011)(966005)(4326008)(8676002)(70206006)(70586007)(54906003)(86362001)(82310400005)(41300700001)(8936002)(81166007)(5660300002)(426003)(36860700001)(6666004)(6916009)(47076005)(316002)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5129 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 113304cd-c5eb-4237-7379-08da5f35dfe8 X-Microsoft-Antispam-Message-Info: KRpR+x8tdcxDL8AOjlykIGrEAd2xFdPp9a22CkT4LsTkxofsE/Sx1raQUjx+Ce5aO9gdSHxz1BXBHcX9qmJP3zc7ibCr8+R1N1eIhLH+pAoJL1pBAtOJwepgjNc3+XA/1gOrQ/OFAkPyz05ar0J5/0tLGHmDicScmxTc0wDea+MVPWoee5kezRDH8SIdjQMECe9v1QC22K2tWTY7R/eAJRbtdBn8e7XXuR+gMAx5fU+LcibyDrJ4yFTUdbDMVl78H5hpngJwHpjz7LdyEBLJ4yPqwXXt5/5AMKpuWWB96d8CkAOwFbfOBwmdseXaNzEnS067BQxaT+2WWqIEYWZEsprlvpGuIgRGUst2yDay0bHklX7Qb18BKV8XRkqSk2eMdq5PcWSSyZeC8gB+JRT6qGzDNG5sPg1sKAHCjhK+sD2ZsySptaKd1FR+oRVclUq+vX8ZPrcC4CGUGZPqt6pOLmDwgrrk4IZ2rYXI6FCO5hCjRLqW2pjBjfDrrA9N2Xtp2J3v6ykZZQoB4tmSmdtcAbpOvGtlF634zJUNY6vlxgS7tAYjeQQkz9AzTB3u0nucph0iITyMvetr6878M1jcHTQA3kSNOAm4nL7nwCbX7Lh9878qF7hG4zV9M7NZ11lHev5Lg+J9Ei3N0SNkQCq05slGjoaCaPU4xcGhKQo21bZNRETL4IJTJhVdvVr2VQzj6r6Uz3eYIGZUYIZQc/jrFL9yMVeP2NKYTbq+DToDkjLqyd7aiNlAAbHne2QzB/peTW3kfFmvffw8KqUx5gRL2eY6XJ/jQYC5M6zZMcw2lIcbMecG+SgFBHZsN30wa8mD8+GxM5tDjGEAbMSm0J6wSfbDCg5pNKXFggBMlDrWW7o7CJ0Uun6FwSa08OeV1R4Z X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:12.4799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfab1ce8-eb54-4573-cf6c-08da5f35e624 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: AM5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5128 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: VzJCPZNL3nM1f3hT75Ge1x2Jx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101437; bh=XRWPBT8vQiTKHzqSev0qgw26D6YzdHM4GXNknW3Qxbg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=lRSSQTfyjlzNfQJ7Iv+onB1Zf1DdVZ4m7wHlnr2UTEWErxx+kZ5a2J5TMc4Z2UZYF4F YjQjk8aYLGmU3SLQN6dcGnJEeP1NFLaDonFrSBDuX6r9t+GMehEPhkssxsi+Y6rSENjNQ jxtMH16v2Y5tWULIwOfFq2OyNnsCQ5ALcdk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101440030100007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - 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. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. 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 --- Notes: v4: - Updated patch series to IORT specification revision E.d. [SAMI] - Add flag to indicate if the root complex supports PASID. [SAMI] - Add flags to define access privilege and attributes for [SAMI] the memory ranges. v3: - Submit patch series to update platform code to use the [LIMIN= G] 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 =20 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. MdePkg/Include/IndustryStandard/IoRemappingTable.h | 83 ++++++++++++++++++= -- 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/In= clude/IndustryStandard/IoRemappingTable.h index 79a34678681d45b2982dc8573db6bd447f42e429..07cb7f49dc936fb00cc549113f1= e62f988535e5d 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 - 2022, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Reference(s): + - IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 + (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_REV5 0x5 =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,29 @@ #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_ROOT_COMPLEX_PASID_UNSUPPORTED 0x0 +#define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_SUPPORTED BIT1 + +#define EFI_ACPI_IORT_RMR_REMAP_NOT_PERMITTED 0x0 +#define EFI_ACPI_IORT_RMR_REMAP_PERMITTED BIT0 + +#define EFI_ACPI_IORT_RMR_ACCESS_REQ_NOT_PRIVILEGED 0x0 +#define EFI_ACPI_IORT_RMR_ACCESS_REQ_PRIVILEGED BIT1 + +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGNRNE 0x0 +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGNRE 0x1 +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_NGRE 0x2 +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_DEV_GRE 0x3 +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_NORM_IN_NC_OUT_NC 0x4 +#define EFI_ACPI_IORT_RMR_ACCESS_ATTRIB_NORM_IN_WB_OUT_WB_ISH 0x5 =20 #define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE BIT0 =20 @@ -89,7 +120,7 @@ typedef struct { UINT8 Type; UINT16 Length; UINT8 Revision; - UINT32 Reserved; + UINT32 Identifier; UINT32 NumIdMappings; UINT32 IdReference; } EFI_ACPI_6_0_IO_REMAPPING_NODE; @@ -118,7 +149,9 @@ typedef struct { UINT32 AtsAttribute; UINT32 PciSegmentNumber; UINT8 MemoryAddressSize; - UINT8 Reserved1[3]; + UINT16 PasidCapabilities; + UINT8 Reserved1[1]; + UINT32 Flags; } EFI_ACPI_6_0_IO_REMAPPING_RC_NODE; =20 /// @@ -198,6 +231,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 (#91090): https://edk2.groups.io/g/devel/message/91090 Mute This Topic: https://groups.io/mt/92203096/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 May 17 10:34:26 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+91089+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 1657101436699125.89798952557544; Wed, 6 Jul 2022 02:57:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UligYY1788612x09lJGuRlpq; Wed, 06 Jul 2022 02:57:16 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.76]) by mx.groups.io with SMTP id smtpd.web09.4381.1657101435055153250 for ; Wed, 06 Jul 2022 02:57:15 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=FjWoBIuZS4kuRccZ2u8OiWu1xAaTDdZfKe6UxU+rcTktl2bg9dnTvDbKIp4dRyc8sLfDGdfSUG94hnX6CpEhgtNhlSUQapPjk8ewIVEd6Dy1dzk2wsHuHE0TUrvmlTq5TgdAtQkdo4wP+GRQVwqJb15c4QwcYjWgXSNxQTVO/qfWT+P5r0VyPS4KTo20535wEAW4iIlc58jyogLGwQPdK+0P9NDCWb4P+XM1v+s30ZUpdnnNF4K/poKP5JkwipSAkf4astwEtY/tripsh5wmWvVtsB/Glm4BN9kODFrIzG+UzrXGzHEKxRUpLCvZp4yE75BQ1BZ+mjvPGd/46MG4oA== ARC-Message-Signature: i=2; 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=l9SnFcIe2StKn/e8VEDzjohwryGK4QLlHLGsG1vJ+0Y=; b=LEyWI7jJ50FrEdx76Ue7ec3GoRkRd0H/fRrZt8Ah0At5jx0nfgKxK1+eQ/NmYYsgbpfZ91EQZcUXFQO5oJbNAhkVfzQ5NzWSnA1D9TSpmm3ZMhp2jtJRu47jeAE1jgDvn09G/QO1TungIZGy4n+DJP3cj5QmoR4kBTkf/nTM+WkeGmuM5E7Mcl2I/hcGPoX9W8IHgRkszueyDXTYE4KmuXvdA194q4sBFTgV0wv7fhRbNU9N0BkFIjDwEPyg7sYWR/Rx3aavDM/05xv9IIwXFwZp62tnWfoJO18SwsnwUVRkjsUP7bUN5cR7NNg4uNE5hOYvMI5GuhXRO3G1wL5/wg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS9PR05CA0011.eurprd05.prod.outlook.com (2603:10a6:20b:488::19) by DB9PR08MB6810.eurprd08.prod.outlook.com (2603:10a6:10:2ad::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 09:57:11 +0000 X-Received: from AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:488:cafe::8b) by AS9PR05CA0011.outlook.office365.com (2603:10a6:20b:488::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Wed, 6 Jul 2022 09:57:11 +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+91089+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT050.mail.protection.outlook.com (10.152.17.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:11 +0000 X-Received: ("Tessian outbound 13cb25bfb745:v122"); Wed, 06 Jul 2022 09:57:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: db76c3b77f25da42 X-CR-MTA-TID: 64aa7808 X-Received: from 59b73a68b3c0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F374F859-70F0-46A5-99D6-DAA29DECB7D1.1; Wed, 06 Jul 2022 09:57:04 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 59b73a68b3c0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OI8zGe8s/IiIskxILdOr5ClxQyRtPfpp7ls+ykpBuB/KrXjYAZuWiIPfQ0XQbeItgaj+Lwf2dg6rEW60zPz6EJxWkJZ1ukyNS1Ay3mjfBT2tP+/4wJD3FBxrBLE5gFUAbWymEA/xJy/k73irwEovaKgsfiOwTh764nodRZDRft+V0vGplh32cbuk6fOmcwfVqhz22ayF1eFdmuMrX0c+N3LduHVtM18wPK1a6funzgVE7Wr5Jzii246njLsxlMPwsglhAthYYa5Bq1uo9aS2vN9CZ430Zi4bjzTewSFsf42awNnVmfHL6iSPEt8hzrjhBouBNsI1HGYcFHrCOu/BKA== 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=l9SnFcIe2StKn/e8VEDzjohwryGK4QLlHLGsG1vJ+0Y=; b=h4358JkoDd3SHycLm7R0g+lcohcLZOplDxjdejqQ0RUJMyAJErgItCocUxii3FklSWpIrU+TzarNj5ccboHGwND1xtCRfpdfM/dhP9PZgUj8Gwp8qhRGAnAtk71xGORFhrkuRVsvkzrITkr8RYLqKjAFeC7D08TzJqlReKz/DMw/OMy1HwLYfGFfAUDvWdB1HZ6tBWaZcC4vnQK6B1fjLTzGqTqfDNgqYTzy8wHOyluaC3q3wNdyvf0RoecT0xx8JCElICsj6yC1vpCApdJ9uPzwxtggFWiRdLQ7HfGebvPkF8oqbJNjsO9RpevbFhNAMOe5IjzEz4069GvX8Vn+2g== 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 DU2PR04CA0189.eurprd04.prod.outlook.com (2603:10a6:10:28d::14) by VI1PR0801MB2013.eurprd08.prod.outlook.com (2603:10a6:800:8a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Wed, 6 Jul 2022 09:57:02 +0000 X-Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28d:cafe::59) by DU2PR04CA0189.outlook.office365.com (2603:10a6:10:28d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Wed, 6 Jul 2022 09:57:02 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:02 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:33 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:33 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v4 2/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment Date: Wed, 6 Jul 2022 10:56:25 +0100 Message-ID: <20220706095631.27196-3-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: fce0094d-e131-4493-60d7-08da5f35e574 X-MS-TrafficTypeDiagnostic: VI1PR0801MB2013:EE_|AM5EUR03FT050:EE_|DB9PR08MB6810:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: EKLGWkIdub4ZtOtWPxdnJ/4CkUHhjW/4NWnUrq/r28rkwgjyMxDiARWQ4eQTEcNJ0RedLvMPYK+KVLa7VNfrywOqeRwM1sjaSq6BjOXP1Ja4pf0xObMFXiLni/2eq0X4jxRkyNu7iDiNKJwpBk8GZbrI9H/nIBJ4lT39CZwfMoIdPqRC1tTt9VaH5Gu1TuQD4TKHQbG2h/RlVQN4zzSUzgnSWgPpPCTrjbQZuvAM8r2CIfxU/iEv+HeXfEay1MYbdm/JrTbuvAfsM7DBlaOKr/MQbU9IVyKxS0SKFknb/wJUZNfM6nqCARiRyTLzj8gySna34jA+HNVhTOOvEKrFePIG+XB8ZUekRsIlCy8mr12xBPpWt4ClRIGLqoYQ5CMSxfR5n29t3UxZgsSHzTkU4u2Uixr+w2A6nRfJKd7mN5vWTY6G/YWsdDS67agBRYnsfu8wuugLusfgbQ0wPubDIYAlL6CeJDLceDdBnETBIcnNSfB7ueaYxFgBjTmS/Q9xbkICkx6rv933cow20gxpwZBbl8MV64B/DEfDFnj7QgNw7zpNQxJ5FNB1nlbd5DBsUuPd6F7jdP7tT/D7IIqOu/Ts9ennOfMGKdu6wyDyRaq2JO7rtg7nv0t0ZsjnltuS9AU7Yajdb/YiXcIPD2loDfeDhu8tzvUpduIvk63/RqOtkPcm6JiGnWSWOFY7BN6ppCr2mAAxYlXjf+Op0bqTk7a6eLh7JVp8xBesAwqgaFbgogqTBgSZVDTYRNzeUOJnzpec0V0s/EOKcUahbV5Znrd9B1Pq2Pjsd180rSYIDo1ixoAVmYVoWaZTWwVLB6qIVXR2aii/+JM2pxK0ktzd11r/c6GSW39K7LoTIXAoxX1D/qdysG3dyBrj7F50YMtg 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:(13230016)(4636009)(376002)(396003)(136003)(39860400002)(346002)(46966006)(36840700001)(40470700004)(5660300002)(6666004)(82740400003)(356005)(41300700001)(81166007)(4326008)(8676002)(70206006)(70586007)(36860700001)(82310400005)(186003)(7696005)(478600001)(316002)(2906002)(966005)(8936002)(44832011)(1076003)(2616005)(86362001)(40480700001)(40460700003)(26005)(83380400001)(47076005)(36756003)(6916009)(426003)(336012)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2013 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: eb286ce3-adb2-4a4b-1f5d-08da5f35e037 X-Microsoft-Antispam-Message-Info: 1Bk0v0KiKSuMWElxDWozhQ1P2TzYzwHlxbAPctVfwhXp8jzE6gEQ7XbOZC46UFlXO8Gz6zZJHsUK99wwnRqiOJwcUB9nqqpZiIYhvN1jvc5fsIE0hkDQAcu/YBKf5EiVpBQtNkhDGBAPbva/NPabgOpg3vaiiUAk2fOu/ilw4aVPkTWDYeBOvQtpP7JHREoC9+rCOHvyk9Bc9VshuNXoeREqsudCqZhmguLktFRe3LJXfCImx/GDrddnitV8ZEWqPATCV469/r8mE0g3cuAmTzqBGnUOJBmBS0krkPX/pgPtJjz8biWsxHiyh15dauOkaiLiMnqq2uUTIuAqYc6IVFJXplWCW4sGGo4LQmFWHZShn3cy1GQ7+7dln50dN4bu3ZrOSR6NPKlYwFaiPRHJLcabJ/1cOhChKzugIKtVWjN7w4eqniwBh52wjmAQc6hhsxXoxiWy6iH7NqrZuVSH+tG65Q2dc7dNPkbCymNg4WKbqvD47vZQJPovoyfqy2Obg7z/LfvA42yyZ+fzsypAgRJkv2Z3tsF7r15MtxM9WD8FGH6hEhxmBE76tPGKuNirORcWFCZLDSZc14f56PZ+NxbJ3f7fuOGq9KMaMyDVxsbj4Au7A5qlPNfi9IV0etZS3PojBoX4WsLxHovzK7nxpBJfXcasniVg02cKr6zi9c4AOfzPRyst3uUoFGHTd3vBvte3yaIJAe3/GkuIZwOFFdbmLZ5YAnqAP+KLUksdVh/W++hBGZycb7kHJ7VesYaM0BVBxA5+p/1/vOVV27Yhhg4wCHIWCnpRXCJs/c6aTozHcDxnvEbVYzZrp6VkV4IhTczjGk2mT5LxZaVuVzGEWI1JNMMXPs2N7ZO4jNUHZp0= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:11.3236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fce0094d-e131-4493-60d7-08da5f35e574 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: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6810 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: Wa5U2dUSCPtS9s71mrMc0lBkx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101436; bh=6G4AF1uVzcan3kGwdwm2RB9EK+NrPzzYikYDvyHTVkA=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=r+cG1XBNCBMb+n2D4Z4OLuQf15muXsD5IOkvDtGy7w71eIjtcChP2h9hNmwOG1LBrse PPL3rp9RPus1ssHrg3ms+xQ8TMj48WCZ/Bcr6N6qrc5pVfEBlMI+xPyp8HBufbv0+e/Wy cIkK6H+PExY0BammqgQnQm6ydeInQXePmdg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101437957100003 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: v4: - No code change since v1. Including r-b and resending [SAMI] with v4 series. =20 v3: - No code change since v1. Include r-b received [SAMI] from v2 series. Ref: https://edk2.groups.io/g/devel/topic/83600717#7665 v2: - No code change since v1. Re-sending with v2 series. [SAMI] 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 81bfacd83added87a867cf365a56d4b7a1410ef2..44d633c5282463078a4cc990bb2= 4ca1992f95634 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, NUL= L, NULL }, { L"Model", 4, 32, L"%d", NULL, NULL, NUL= L, NULL }, { L"Flags", 4, 36, L"0x%x", NULL, NULL, NUL= L, NULL }, - { L"Reference to Global Interrupt Array",4, 40, L"0x%x", NULL, NULL= , NULL, + { L"Global Interrupt Array Ref", 4, 40, L"0x%x", NULL, NULL, NUL= L, 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 (#91089): https://edk2.groups.io/g/devel/message/91089 Mute This Topic: https://groups.io/mt/92203094/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 May 17 10:34:26 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+91092+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 1657101449794570.768130797833; Wed, 6 Jul 2022 02:57:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2bHsYY1788612xbA3Z7WNvXJ; Wed, 06 Jul 2022 02:57:28 -0700 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.41]) by mx.groups.io with SMTP id smtpd.web10.4299.1657101447541992074 for ; Wed, 06 Jul 2022 02:57:28 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BzLi+3mBsszJXhdwPDeZmc1rexDWHcaDhIyCEdpJnr5Vj0Ibe33K7izV/EHK2tzCBfmDWdkyOHvRhJQBTyf84iUy6noY4oj4KQJg1ePJ6k0kLTGNK30Cc2LbT4EUo6raiiEKHyTZsDM99LVHYAjurRDPXNxYonxJMQDQAEq5RHUhOs2m04SZ97jIa61KG6Tz+Cv+Y6KfnJOhP6DfJdnpPsNVDdys7jNykH4VM/Tu58F/L/zs3s/iiCjwrr8sMJqdvC7pKq/9fcDt9tpWbtxYH5HiybQ4DC/eVGw0wyytlaVDJI69Vo4dfz3heYxrqp936rvQcQUo+X2Pnz5oiD5eEw== ARC-Message-Signature: i=2; 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=TvE7T99xwGqCQHNi+1DmY7Ahnoxuw/9dFjiaKOF0TF8=; b=chpZO5uQ17UHP6gLIsuWLxV6e5WN9Zw/YRbDLqlHr0LsQKxI53DAczHZvcmlETImq7X6w63uH2y86z/1YQ/bEBzczJG/tWCijIUM8eNJO6g9p1vtNFW8SLvrG0rxT/XoyuJ6iaRq+XRthyKXPMxTMEnymRxJVrwfGTXG/6V+BSdWSKq6l5x7z2e8Ms40gTKnUXu4Ij3sD7KY4b5ffjYUOTaLd9PGLeybmtoNevVLOB+Z5obWu6sVeY1oF+hSO6mKY14+WR0CT9/mDHvxwsG/PZaC7yptJiKmZUfvxuZZ7QBHHulvc613EyPm/o67VoJGHUkjA87SR+BKg9lZ7ZTYqw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS9PR01CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:20b:540::28) by PA4PR08MB6016.eurprd08.prod.outlook.com (2603:10a6:102:e3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 09:57:24 +0000 X-Received: from AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:540:cafe::d) by AS9PR01CA0015.outlook.office365.com (2603:10a6:20b:540::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:24 +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+91092+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT014.mail.protection.outlook.com (10.152.16.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:22 +0000 X-Received: ("Tessian outbound 0ba541f03a2a:v122"); Wed, 06 Jul 2022 09:57:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2e25fe6887fafe1b X-CR-MTA-TID: 64aa7808 X-Received: from 5b1adcae615b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 29DC6856-257D-4B0C-90B4-56934E6063B9.1; Wed, 06 Jul 2022 09:57:15 +0000 X-Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5b1adcae615b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zhg4WFMqPVl9088VpGA6rDyJbloNqKy7xnDVzn+GOV47yWhsE+upCetskAtjjVUlmntKetIpzlm/ZGXSn9rcIuT54bnHUvavOB8I3eF99An5aOdlIU3WNsGw2Uya1KByEu5c+zz6xIMvuWrzx8CgNWX/BFCLkprbpvHJIeUN+NCdX1u2pKPygskxxJzEqUUzzPWgSIbS8b2UQ2R8QgF7L578BEEx5rrTTT4SjSxqhB33Xqbwba/5cTR0t++JNm0/nXNIZTturLsrv+f4/MZBu/+T9HwAOFKzYJp6h8Pezk9scuqoVgxVRy+rOVmVVSUdZkpNvhf3LliGZYfFjyRc6Q== 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=TvE7T99xwGqCQHNi+1DmY7Ahnoxuw/9dFjiaKOF0TF8=; b=Id0K799ndTHxgtDU0i5H+5CEwkn3PYuWCfZSUgI9SKuoPj4p+HJWf4BB300kaDAYBIRXVqg8DtGC3mBQ5dKiqbvRdnlyzFdfpxhfSSZfjJHDM5HqHyaD7I+wVolXhVJBk05hr4zZqCkgtR4semtuJK/zyHRbuW7g3uYEfkA8fbKLkWPX2Z+jeLYW4Npxz3QjEGCzQhgJlv6qu3rKMRDMj/v92JR8HvmhOwx/TzKZzBwtt8q6aaTFtfxUYEkhPRqYeZBK+BXD2/ancSs8fUPS9ADf8eVPZV+5YkYrmzFLEDqvYJR2bpbiKA1b4hP63ANEJdWIxpg6lbBumhObaRJeug== 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 AM7PR04CA0004.eurprd04.prod.outlook.com (2603:10a6:20b:110::14) by AM0PR08MB5265.eurprd08.prod.outlook.com (2603:10a6:208:160::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Wed, 6 Jul 2022 09:57:12 +0000 X-Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::79) by AM7PR04CA0004.outlook.office365.com (2603:10a6:20b:110::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:12 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Wed, 6 Jul 2022 09:57:11 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:34 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:34 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH 3/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.d spec Date: Wed, 6 Jul 2022 10:56:26 +0100 Message-ID: <20220706095631.27196-4-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: d71a9a85-a260-4482-5158-08da5f35ec26 X-MS-TrafficTypeDiagnostic: AM0PR08MB5265:EE_|AM5EUR03FT014:EE_|PA4PR08MB6016:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BekM2kAVnHG90W840t2o8uxBJIziT8HaCbzHQYlcd3x2LhvL8kOkzQioswo5BjHHnbr71HWYVbOAHHuH6Ay8/OPrCV0oCDyGA+/Vw/Sh7Xmbf8rcdz9ylVm79fQDJtwe9PWv7OPz/r4xMgWElUG85KstZzu9xXMP8rn76A3GXEgZmpTTi2nAN8YDOj6jdYD0zFNiwCPeSDGe3UJPHwRvP2FDIzYVZVQv01tN5UMX9ZJUkqOI4fIEPHD0geKuTGYSmmgNpARK02p2V/wgxaW/RKGWP7xF8A6WklTmtabQq5x3oYGus649Ah49GrQr+/LrqoKFFT0F/aBVsDmVSCViFIDnBdYCrUqI5Wyhc1RgOx9bAUcUzxPh2JbrGxfRkub1ryYJKD81qafLx2TLVjBXpA3YM9TMuGa8irnL8cOj56/x5Kfsba4z6gUfADF6Zb30+OsDc/iD91RpWt1D6VCKPSniukw+nzvAAXmKmrrBM05q1tMRtI1xGQeapMHfESvulmdxEr6lpAGTuLiK6lq/a8hk20yoe4nFCzLoYV2EMrtq0LFpw5pK0HgxMhU/byfIhFPLfR3e2dxuNKiBVc7WUofz8s9e3qj/tEstFPUQAlSkx+uy4o5RDk5QuhrsWMoBapzBu3P2tk6wjX3opSHngokhgBh3Ic897JxT4V3rqrHQ6wmkZw/9FGc/nfSuFdUsCypHqU4N3l/YfgWXMf6k/HPabSrKbbjNad2KVQ7p2k64rU2xJ9VWhRZcRpG8g2Uz/lDI4Hty2B+VFdNmIj7Vn2EJ8GwhhrHfflDNkrozKeSeyJNiPXfqakVXt0kIRcGwyX1sq8eqo4pnkfbUILXYibbF/sBzULF1pv2kYLWnCjWn2jZJsFyJZuKF8nIZbfCxHLvl4WO41FiJiktgIcHAQJEMIMfyCfqhfS5Dqvhsz6E= 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:(13230016)(4636009)(346002)(376002)(39860400002)(396003)(136003)(46966006)(36840700001)(40470700004)(2616005)(47076005)(1076003)(426003)(336012)(70206006)(8936002)(4326008)(8676002)(70586007)(5660300002)(36756003)(6916009)(41300700001)(6666004)(7696005)(86362001)(40480700001)(82310400005)(2906002)(966005)(186003)(26005)(478600001)(15650500001)(82740400003)(83380400001)(81166007)(356005)(316002)(40460700003)(30864003)(54906003)(44832011)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5265 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3ee78898-dfb6-4d23-8681-08da5f35e5b1 X-Microsoft-Antispam-Message-Info: SsEitg24Aw75u30NX597UCwlKG6ahLlmpHYpwjEJzanyQlzeOFevXglVUw8DVfUgYq1WuV5vErDwQf7AJz4gmwNUv3Mgq+zoNzZtRKIEuAvgQadq8v7nlrdLVcvp1fMTdP+mRIzSOatOHvD75osN420nxZvK3OoMjyp2Ph2YUHnNV3nAE0IGy3g50T1nTUPyes1ZpaJR8c6+Dz3DZydiIdp6AQeOsx1y86aAnKKKV4qNgtpFuHvkj5Yz8j7rcv3BYUou92SU3RDotx+bLZ+uGi1J6Ygm8Geky/j/vig3t0Th9XJ16k+yyMJFCtKxikVFo9Zl2Y3b2/jbnYqhqh+ZBi80fsQ0LAZJ0lBrsBot0lQC9IrbyeWtaFBv5l13J1U+uXTjan1+u643uAewAtugOwX4/K5ym1cr5B5DxnFLqnJ0V/LMhRfHMIO/VFe4t062zp8hUTJWJdQjLS3COUvSgr5h11RMeg51B9V2fLlLcCDsPeBKoZmRQaKEOgHPbj9vdnh1KYc732q+Cvge3UX2OvRGVwyzl2F75qVc0Oh1VndlrKFlyD/4X2m2ld0yEWcvgSa7WKMXh69lYUS9oh9ptq7pMCTMRPSYm/VwCp7sWXCWsDsTHGtseo9Xwqbh+otjwQ3hjGPEKptDQwtwEeOgpt33Ld2S4iviafUN7tZ3P25tRCideg57GR6BtrTi7mN5BXWrlWyGNo0gWnl+lU7fELbifHz4LR8CMNRa5eOwmw6UeRw5+CIlVBBNT8Re4bcfGxtDsfVhgHAQhdbtZIi7ssOq6Z6mgi1NozDel7Nqpa/4xcdOPxvPglO0wWB2I3rSGbZhXovyZ8QRFyLe6Xq0ZKfFCn+S1X0V0JtNWxxki1UK9fXa3vMd2eB38wxOPnqrfWzrAn/umdB9hkB3ao0ugw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:22.5404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d71a9a85-a260-4482-5158-08da5f35ec26 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6016 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: pPrWquTi0498OUtCf9u1eXIMx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101448; bh=AL0Xp82ez7LdfcTrE3IH0M04MyYiw7F4jq7Zc4i3ods=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=uuxFyuSmSuqbcdkgH9ffcseIxTHg+WyTrpjhNnK7K8FPfxsAYLdUWV/BaEZdRxGWCz7 BV2Qg5oJp7PrmslWCG9g+JUzv4ybx41SDMNvUG7RPvlFMr2sVwVhk+vsFgG7MfdwNIFE6 yyDUHvR9niJjGPlke2TLqAfC/CXX0mNL7kI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101452054100006 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - 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. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. 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 IORT Table Revision is not 4 as IORT Rev E.c is deprecated. - add validation to check that the IORT RMR node revision is not 2 as it breaks backward compatibility and was deprecated as part of IORT Rev E.c. Signed-off-by: Sami Mujawar --- Notes: v4: - Add validation to check that the IORT Table Revision is [SAMI] not 4 as IORT Rev E.c is deprecated. - Add validation to check that the IORT RMR node revision [SAMI] is not 2 as it breaks backward compatibility and was deprecated as part of IORT Rev E.c. =20 v3: - No code change since v1. Included r-b received for [SAMI] v2 series. Ref: https://edk2.groups.io/g/devel/topic/83600720#7665 =20 v2: - No code change since v1. Re-sending with v2 series. [SAMI] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 2= 21 ++++++++++++++++++-- 1 file changed, 203 insertions(+), 18 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 44d633c5282463078a4cc990bb24ca1992f95634..0b42ff3b354a7cf54cdc2e6e15d= 0617fadda17f2 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -1,14 +1,16 @@ /** @file IORT table parser =20 - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. + Copyright (c) 2016 - 2022, 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 E.d, Feb 2022 + (https://developer.arm.com/documentation/den0049/) =20 @par Glossary: - Ref - Reference + - Desc - Descriptor **/ =20 #include @@ -26,6 +28,7 @@ STATIC CONST UINT32 *IortNodeOffset; =20 STATIC CONST UINT8 *IortNodeType; STATIC CONST UINT16 *IortNodeLength; +STATIC CONST UINT8 *IortNodeRevision; STATIC CONST UINT32 *IortIdMappingCount; STATIC CONST UINT32 *IortIdMappingOffset; =20 @@ -36,6 +39,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 +106,52 @@ ValidateItsIdArrayReference ( } } =20 +/** + This function validates that the Physical Range address or length is not= zero + and 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 +ValidatePhysicalRange ( + IN UINT8 *Ptr, + IN VOID *Context + ) +{ + UINT64 Value; + + Value =3D *(UINT64 *)Ptr; + if ((Value =3D=3D 0) || ((Value & (SIZE_64KB - 1)) !=3D 0)) { + IncrementErrorCount (); + Print (L"\nERROR: Physical Range must be 64K aligned and cannot be zer= o."); + } +} + +/** + 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."); + } +} + /** Helper Macro for populating the IORT Node header in the ACPI_PARSER arra= y. =20 @@ -108,15 +160,15 @@ ValidateItsIdArrayReference ( @param [out] ValidateIdArrayReference Optional pointer to a function for validating the ID Array reference. **/ -#define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \ - ValidateIdArrayReference) \ - { 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"Number of ID mappings", 4, 8, L"%d", NULL, \ - (VOID**)&IortIdMappingCount, ValidateIdMappingCount, NULL }, \ - { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ +#define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, = \ + ValidateIdArrayReference) = \ + { 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, (VOID**)&IortNodeRevision, 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, = \ (VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL } =20 /** @@ -235,11 +287,13 @@ STATIC CONST ACPI_PARSER IortNodeNamedComponentParse= r[] =3D { **/ STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), - { L"Memory access properties",8, 16, L"0x%lx", NULL, NULL, = NULL, NULL }, - { L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, = NULL, NULL }, - { L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, = NULL, NULL }, - { L"Memory access size limit",1, 32, L"0x%x", NULL, NULL, = NULL, NULL }, - { L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, = NULL, NULL } + { L"Memory access properties",8, 16, L"0x%lx", NULL, NULL, NULL, NUL= L }, + { L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NUL= L }, + { L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NUL= L }, + { L"Memory access size limit",1, 32, L"0x%x", NULL, NULL, NULL, NUL= L }, + { L"PASID capabilities", 2, 33, L"0x%x", NULL, NULL, NULL, NUL= L }, + { L"Reserved", 1, 35, L"%x", NULL, NULL, NULL, NUL= L }, + { L"Flags", 4, 36, L"%x", NULL, NULL, NULL, NUL= L }, }; =20 /** @@ -253,6 +307,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 (NULL, 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, ValidatePhysica= lRange, + NULL }, + { L"Physical Range length", 8, 8, L"0x%lx", NULL, NULL, ValidatePhysica= lRange, + NULL }, + { L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, = NULL} +}; + /** This function parses the IORT Node Id Mapping array. =20 @@ -607,9 +684,102 @@ 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) + ); + + if (*IortNodeRevision =3D=3D 2) { + IncrementErrorCount (); + Print ( + L"ERROR: RMR node Rev 2 (defined in IORT Rev E.c) must not be used." + L" IORT tabe Revision E.c is deprecated and must not be used.\n" + ); + } + + 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 @@ -618,6 +788,7 @@ DumpIortNodePmcg ( - SMMUv1/2 - SMMUv3 - PMCG + - RMR =20 This function also performs validation of the ACPI table fields. =20 @@ -643,6 +814,13 @@ ParseAcpiIort ( return; } =20 + if (AcpiTableRevision =3D=3D 4) { + IncrementErrorCount (); + Print ( + L"ERROR: IORT tabe Revision E.c is deprecated and must not be used.\= n" + ); + } + ParseAcpi ( TRUE, 0, @@ -765,7 +943,14 @@ ParseAcpiIort ( *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 (#91092): https://edk2.groups.io/g/devel/message/91092 Mute This Topic: https://groups.io/mt/92203100/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 May 17 10:34:26 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+91094+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 1657101455095541.0131315447309; Wed, 6 Jul 2022 02:57:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cskcYY1788612xF1lrqRAFPE; Wed, 06 Jul 2022 02:57:34 -0700 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.79]) by mx.groups.io with SMTP id smtpd.web10.4300.1657101453631346130 for ; Wed, 06 Jul 2022 02:57:34 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RYPMV8Fi8GL0efE60B4ZYoCQZdj2F1Cc8BnpLJxI7qzqHQRKMKNI6DlUl4h+WFT6bCemmZbNCrQVQTrtoTpRJCzUlFApfBghV/um/Dw/QohaMXtWegM/yGHA3m+V4HH13ElOTl3B0Vw5vcDSSundDZF+QSRJBC4lOCoHP2hkmM/cf7pkqSeiMRiuRSSjTxq0QgpgBG3OLNKdlbP1v2cgsiA1D8lS+X8G4huNx/veNSaD8fbSwq613zUM4AtKrKRvgx5M7GgNu5KBfu2vLd7STwPan+SP4RfRaFfNvDZjSMs3t7qef6ElCryu/73qvPGJYQLPQNSjXFCbqBc3ZRBWVw== ARC-Message-Signature: i=2; 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=MuXu7SFwk1UZcjXhwVF/BSMRDugmmumPDavVByBDjdI=; b=OZiM4SfsYekviifPTa8A9QGFsbtJVPYw59yH2akOSw2qMxnOs1H6juZKaxdU5MA+tGNnlIUea/xd9IJ6mGlt88c6Xr1v3H8aXkr5xy0T+/i2+RbLlFljR2dfuFbPYNaRdLhWTitX7ZKCD65O261UiaUr46Ya2QjWGSrD+4jE/Mi4rDAux9CKQkK4rzHDpCXrWKdYhhxaRFXMVe+Xc2PqJJ9rLjl5qCu15xcpTkZMN11rzfKw0dZLN2qwEQo1fqrQXdT654Jff2RQqiApW1z4j1jfKrttjYGJpCydloYekcxlty8JFzM+XdFl9XeGXeLqFWNMqVTMMy2ROcLmpxjYDQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AM6P194CA0070.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::47) by VI1PR08MB3200.eurprd08.prod.outlook.com (2603:10a6:803:47::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Wed, 6 Jul 2022 09:57:24 +0000 X-Received: from AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::52) by AM6P194CA0070.outlook.office365.com (2603:10a6:209:84::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Wed, 6 Jul 2022 09:57:24 +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+91094+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT034.mail.protection.outlook.com (10.152.16.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:24 +0000 X-Received: ("Tessian outbound afad550a20c6:v122"); Wed, 06 Jul 2022 09:57:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3d982907693263f0 X-CR-MTA-TID: 64aa7808 X-Received: from 6668b3d12722.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5F954DAF-CF59-40D4-9F62-CEC1F1249D70.1; Wed, 06 Jul 2022 09:57:17 +0000 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6668b3d12722.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c1Gk3lZf1fqhrr8aYhd0ul771MIk2JfsBv1scBAaRkha+2mhSbGR9eKopEm90kXtCyc2ee4ZOCAymIQ8bpP/AgfP+YT1eYTh6XOnpKTBgDMgp4aC2mSaRVGuvN/1+2Rc+mskUfW8BEImcCDxNRbFZ94jfQY0SpjmY3p+KYaF/QurSx9EIi6HoSBDvVUbIimmuON+VwM959IATF9fr0SZcUtFXE+sWeI/DARB0oJ2FgbAYPl4XTjRU+XgIfUELs+Ag1mj+BFqA0dIjCKWYGlZejvzbF/Zrn5pvm/zRI3xt/ouF8vwCt5g9/RnSRu/cxmQ8acUS1YiMf9cTO5//rYL4g== 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=MuXu7SFwk1UZcjXhwVF/BSMRDugmmumPDavVByBDjdI=; b=amtRj80Z/3tSiESZi52TvCPhXr6soA34Gt+OUSKdOk38VxHQ9xz/Lex0IMDoMT6HDLsefxcemoZLuqVR8WLFf8kcu89crxXSC+xfvPVuNBPqpcwT3jcG6gGgWnKIM8h5CMn+5T0nZmdGk5hQbnwTCpG7HD0fLZOteEz+9Tv5Uq4UAdy3jS1TzNKbmvhWY4u1JbTI8HftRM6iQOWtOl28+rkO0cYqaCHdieySgogV25Dzk8ElCmFhJ9o3IMAA3lOITY2cwg4I4mxqL3ZofP/xM8k+I6g9F1fyydiwxF+0AOCWZkIfusYAX32B2Mw2jduJr6nr3lydLn7g/1+cNCYGaA== 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 AM7PR04CA0001.eurprd04.prod.outlook.com (2603:10a6:20b:110::11) by AS4PR08MB7507.eurprd08.prod.outlook.com (2603:10a6:20b:4f9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Wed, 6 Jul 2022 09:57:15 +0000 X-Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::84) by AM7PR04CA0001.outlook.office365.com (2603:10a6:20b:110::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:15 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Wed, 6 Jul 2022 09:57:14 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:35 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:35 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v4 4/8] DynamicTablesPkg: Handle error when IdMappingToken is NULL Date: Wed, 6 Jul 2022 10:56:27 +0100 Message-ID: <20220706095631.27196-5-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: a578d559-41cd-4313-3760-08da5f35ed49 X-MS-TrafficTypeDiagnostic: AS4PR08MB7507:EE_|AM5EUR03FT034:EE_|VI1PR08MB3200:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zG1ckwGfy1F93nocxGi0EvoUqoRNrtXJTVuW1hBL+DP4IlTNg75iR4pdFVHdbc+jcpEi4mqJBPyzqOwGyg1nUezGKEC6Nk9CUh0HMZ6wRwALcTdBaqUSJ6pGkoWZQhhyKNrdl2t3TK4Bps6iMIkZoYvZWVgwVqdAd/ekz6IrrQSQ2sktnUW7ochi5UaMOX4yGp+mYcOVMkKukVOo2w2t7+F6n2Tmf82bJ3BhG1NQWIiesyRnbop+KYocRYLQ+h6sFrdAv5qfEmbcnksTv1i9am2xgiLZiUvYmspMD8J07xLl6gk7xBFyQDhDBcVLj9xFJyataPyRaGcu/9ngF+6b/CV6zCfl9trDDrwC8TLrMQLCyhiW53TJfSi/bpl108isWwx14EKBR6f6Vnzs0KIBSXc8/ZYiAi8mJQFAw6FcN4pwj68IGNTQ7g4Zckg2czihesPX1RwGtyUiGPDjCzB4jsw737MInzHFQuMLXmw/F7MHERNusbU4DPmh4m/sUwGw8wtpf1wCS6jdA24dn0NBdHeycuppwBNHmEPEVxLl4rdbyW/4h4ij7KXLv25JnDEb6zh2NweUjcbwUmNpqdZquNnbtscwlSyDl5/fU7buPrtY4o53Jl4eCaobI8kQIQovf7d7CC4qaMW2McKi2qB/KvGP1IP2WqDNyMjBeC1bhblz1ys25lb0o9MjeZGuEjt7nTcZqyoyrNRIbi+JI7MBZJHHud2o6FkxOuNPLU7i9qTXN0oRSy0ECDEhkkiNPEhZMWMcIPMVhTbti3fGXLdjw6b0tsseZbDRuV1B2zOwI21EqUM5lbEIIs2qUKnIbkSCMq9Xx9zCCfSTZIFOCacl2Y9IEzuCC6w2luxHNmqKcf8tojr6wDGK4WtyYlz+giW0ahlYRpiaSA5cp6diYn6UBrzDXs9qIYDWHOcWv5O0haw= 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:(13230016)(6029001)(4636009)(346002)(39860400002)(136003)(396003)(376002)(40470700004)(46966006)(36840700001)(186003)(40460700003)(81166007)(26005)(83380400001)(41300700001)(2906002)(336012)(426003)(6666004)(54906003)(316002)(36756003)(7696005)(47076005)(6916009)(966005)(1076003)(8936002)(82740400003)(36860700001)(5660300002)(40480700001)(86362001)(2616005)(82310400005)(44832011)(478600001)(4326008)(8676002)(70586007)(356005)(70206006)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7507 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4afd27f7-4140-4877-4064-08da5f35e79a X-Microsoft-Antispam-Message-Info: 4MhWl/swqyXV3G+9AneVgUbAyOcceeomH5UPvJDueClvbQFS32wCLYqrogY6Mf8bqcbi4m00WoNIwCIbUuWIE0zg4DAWgzGbvOZtkEiIoLfIkUTD+qdJSRSLMrS3ezVaNTubJtBelDizAhDkDHtG8LshHGdT1nB+lCafdf0hUutw+HQ5gX4BozXW58iTCxsRIsRRFiA3ISIWsT8ojdcgsP3ASS7yVpm0bJM2H9rBUoNxeNDk/7LKLzO/XKc5NQ7ZDylFX3005XfGZ/yy3dknwf5H5uUU8QMtnPzRenhdXW6L354v/jbVLRofJNNNMn0lld8RULIo0viUZtOOzCIqUxjY3cyW70gxdNVK5QZtUa6P/AF6K3GPPSuI1YNgENrW7YFdXqymtxkbnCOxJi0tESaHPPCDvi18zi69iQD1TeRKbqVDFy7ObQf6AKBd+tF5HGVkbKqU5YGWR6ZYqK0b5MmPpO1tukVCZ3Qn8nN4LOs6LAlj/8vu3WBL3zH91cRjoKI88dWDxGlyHL8s8k7LMdmUhbo+lhnSknkaZz3+AcmizyxUhQ1hdzIeyNZfmOmmSPdrjB/fJcHEOBIlKqn5QHHgCM+rbvyHNPljrqGSDA6OgSrz2gXJpeg0oMUkcjliLkSX8wE+y5NUj1br3+TYGoiVvUBKMe+5jZcSNw9bfhHysbdrTrkIiezVrKrZ7c4GbsHzUu0OLLeBKfmQoylrucDy+KZo1xTN1A8ShwJbrZ9K+vO7dzWMIBf2qMb6vO3cmQ+69syvOUv4c6fa3k4sgur480zR/I0DTcmwSogkKiFqf95+HVDSSTGDraRNrYOBNGl3oFPmIapm9MTj1Ob5qQwUgcgOg5Y00bNBK7TN5/mfLXaTG9FPui8raaupLbrW/R9IvSHIqDAqtcS8UqYNiw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:24.4781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a578d559-41cd-4313-3760-08da5f35ed49 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: AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3200 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: KixySDy8du02h50HtSs4FnNox1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101454; bh=5LbabfKLmc3LHsM/x7cQEovoRoYB61AXS2UXEaTa+6k=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=D4RlA3Vw9s/4LGOnAdlkpsa+vMVxjCaXSEoVh1rOaAO2Hr8zqnKKYKyy3N6LPKbLYuH HoMIU2wUX3hWmPY/KSHIuLmf+AnwXDn5jli5FHZ6urLFWkDgL/N1OG/wnr+86gWjWoMms B9xsaOkVQSHySKMGGrFcV3FT90SO8W6wkPs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101456078100003 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: v4: - No changes since v3. Resending with v4 series. [SAMI] 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 | 82 ++++= ++++++++++++---- 1 file changed, 66 insertions(+), 16 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 0f13c32b838bf4fe42b53a1e9c3ce817d74681fb..daf9ff00c3deab4005814bbfcf1= 650469d1e7d92 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 - 2022, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Reference(s): @@ -905,9 +905,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 *)NcNod= e + NcNode->Node.IdR= eference); @@ -1011,9 +1021,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 *)RcNod= e + RcNode->Node.IdR= eference); @@ -1242,9 +1262,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 *)SmmuN= ode + SmmuNode->Node.I= dReference); @@ -1361,9 +1391,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 *)SmmuV= 3Node + SmmuV3Node->Node= .IdReference); @@ -1476,9 +1516,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 *)PmcgN= ode + PmcgNode->Node.I= dReference); --=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 (#91094): https://edk2.groups.io/g/devel/message/91094 Mute This Topic: https://groups.io/mt/92203102/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 May 17 10:34:26 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+91093+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 1657101451475485.33688583609; Wed, 6 Jul 2022 02:57:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id P0GJYY1788612xmp8Mil2MrD; Wed, 06 Jul 2022 02:57:31 -0700 X-Received: from EUR03-DBA-obe.outbound.protection.outlook.com (EUR03-DBA-obe.outbound.protection.outlook.com [40.107.104.70]) by mx.groups.io with SMTP id smtpd.web12.4315.1657101450086766245 for ; Wed, 06 Jul 2022 02:57:30 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=kNniQTe07sNzGc8CKew8vJwPug4aGUCfiHiGhPn1QrwqIbEhRjbWV0U+dZCmnj7Lc3yKSmGeRWLHNK/NgHc/+5TXz2Fuu8bCUzK4LmzAOQyGz8UEYTqE3lw/qAarcW+OVfs+PSLL9h6utWFpKPOo/gxHOYKvAX5pxkk6snzNZYkWrRpwW87ZdEwXs+pbXYCeu6V6X13XCrovR0MTfyoj3SMI278ono6w0/6WwYeupkM38Xn2uv8/5CTMWqmuutPRHDgqTHvyzpikFzd75EyyeeeIQsbRdG0AQlwSCto1f1wuRC35CoLkiwJETxHsZDX0epCry0LpicM0ik9SSxbghw== ARC-Message-Signature: i=2; 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=DzgYBrYn2wW3O5qTnNbMndUInELdvzOUK686Ul0igE8=; b=Ii7j2SHsuspzPVWhRHqOv4XxK42LXFl7GccWkixq8K0L+HrgaEEeGyjNbTez0JBjRxUNYNvCYI6CtjAY3OpRiiwY2umAyzAggh2C0E/M4eIGQKKgZWKpFDHPS0yFF2dq+YMn1qkOYNDmnPsIP4I3HtcPGJdZcXKq9kLtrirIbtSeUmmFihLeO597/8rx/8gwzr+7km4HhXRL9luupRIs7ztj7RWB8w6xmUm53PDCmy4BtKU4XzdbaGfWXsWYe3onfu9S7M5T0uy8kLoJlAe9vLnQGGRh7Q9OjVqnvoGOVGwfgFNir1Ro8+XKBSmDcy3EwVaeQzfH+SEP2PJhEs8mpg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS9P194CA0019.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::23) by AM0PR08MB4162.eurprd08.prod.outlook.com (2603:10a6:208:12a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 09:57:27 +0000 X-Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::be) by AS9P194CA0019.outlook.office365.com (2603:10a6:20b:46d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:27 +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+91093+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:26 +0000 X-Received: ("Tessian outbound 0ba541f03a2a:v122"); Wed, 06 Jul 2022 09:57:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: aaa98dcff035a2cc X-CR-MTA-TID: 64aa7808 X-Received: from 24c567f0a516.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AD3FD780-A57C-4234-B888-78F81FB6CB77.1; Wed, 06 Jul 2022 09:57:19 +0000 X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 24c567f0a516.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SNnEDuR02l3J71T/kkBKIzmjrEkIylgxzR0kj+ZdnTUuwJuVVy9nRE45O3X3brc5jgRBzwHpCDvCWynODaXOsLGV2Kz9DCDzT7x+vTWnnqkuaCRr3qp5I8VDEqilcoYRXjteyejCtjIXLIajRDQAFbVwoRoRVHFvpE1J32FX9ACXGt+PO7mKKZX3lJ4J+7ZLov/xoHqwkYPBG4YuKufZUJVzM945CJQKc7Hm0KGshnfhN1NAy7HJ3WJNwlpaD6Sg2M0oEY9g9RY5LrAVD2sra4hS9kP0QtDGoVH5yeBx9Ff9UIWyeNXStpWkgWBc4HKDBzKBi0DO/jhHsYwyZ0EXQw== 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=DzgYBrYn2wW3O5qTnNbMndUInELdvzOUK686Ul0igE8=; b=eRGeNDIydtMUiHdOU2dL+0gPRqgy4C36QdFKvm9SSSEVOjj80EIcydxu4dyk1Ta8L+mkovHbp7SrGn3Qi9e3X4RcKmVMRJ5PyIWfEJ+VapRo/Gb4GB+zA/zyOkMfzH38YAqc2SNZhRcC8DtgKNyX782mPEgJh6XUqTlBghpblk3YWRA/2px1ykZpvaL9+L1FCC4NodWHvLPXhISQK0TlgpnqV27yCM//uQ1JY/5yDhj/oqDb0Xe/kzyWHKU16BRGBGcNFqPuuVGerpWHaTQ0wCsU2oINCRXqtP8A/AU/QRz+L58IOBnPa5PYbTWHshbh6YhPnynRjFg1F4r1XgM+Og== 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 AM7PR04CA0004.eurprd04.prod.outlook.com (2603:10a6:20b:110::14) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Wed, 6 Jul 2022 09:57:17 +0000 X-Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::24) by AM7PR04CA0004.outlook.office365.com (2603:10a6:20b:110::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:17 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Wed, 6 Jul 2022 09:57:17 +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.2507.9; Wed, 6 Jul 2022 09:56:36 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.2507.9; Wed, 6 Jul 2022 09:56:35 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:35 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v4 5/8] DynamicTablesPkg: IORT set reference to Id array only if present Date: Wed, 6 Jul 2022 10:56:28 +0100 Message-ID: <20220706095631.27196-6-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 05d54495-e5d3-40ff-8ed7-08da5f35eea2 X-MS-TrafficTypeDiagnostic: AM0PR08MB3586:EE_|VE1EUR03FT058:EE_|AM0PR08MB4162:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: wck8I7Vcx+WIdAKN0hj6/mhbX9pzsVBDDZIMPaiizPFkEerTIdxVjN5CtqSd6n5zTe+YqBTawXpY2eY7PRz9pOXUlwQRILDQKP/Amf/rWnhLOlDwxIOI5mMUGoBPmFBHry9clx6jYpyasBoFdqrGF3tqT/SjtIwZ1X8SawtkFQWiTyNuMUjWitzReK+35tayXONaeXAY0yFpNPifIFwpA/AjriI5bpCf6MyFHRj+kBNyJAhJuRwEUm/691fewCqA7jMalE5tXhzwMnczfklSFxZMtXUum2kq/NJ3SZCDwd5gERMbomSTH8FL0QSlvYnJtlKUdxmWlX2WzeqSBpuT0t8VLF2cYDFaWzFzHky9c+aU6QQBOIxLIm4y1zcot9d/kwkOqHsAKzWwjRZWEyIKRLQno2zHlmjYH1eXf7c4k2tod5xH+c5th7yf+4KPiwm3KicZLoofKXCwIoiTuAI6EiGTGbinmCsUS8tM3fHDtWL2UPuAW3ZCDV8XqbRmGW65Hf4/KstcZUi7Ed4z1pMJ/fsie0s7S1RiLvgMlLeH8jlfOTQLsT+pXZlr6uR3eEwCcsvRQlTOhMJlf4CKptbVNmS0m3segvE1wRwshdG7jzQJ2jRKPkcoNZvoJIeLvozfS3H5k0PXET4IaPNdazK4QT/oSzKR6pmiTeQYhxWXS64L8AgVe/bsxif7kZeVC1a1EQ4NPMpA3jHtGMrKB5aHmz4x5cJ1EGdoh8GkZdgSVQ3Xu/HLrVAvl1SwD3P4oULwL78Ba1ITdEnCmSq+yiF4kU6D+57GpgQSqcy+hLOGrA17v3dGlfqFdfQXX38nILQ62Wrkp7VMvgvdA238RHFHv3pg2gZ6XlGMMfO3wRpAyuk= 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:(13230016)(4636009)(396003)(39860400002)(136003)(376002)(346002)(40470700004)(46966006)(36840700001)(70586007)(70206006)(81166007)(82740400003)(6666004)(8676002)(82310400005)(7696005)(41300700001)(356005)(4326008)(36860700001)(1076003)(86362001)(186003)(36756003)(40460700003)(426003)(336012)(47076005)(8936002)(44832011)(5660300002)(2616005)(316002)(40480700001)(2906002)(478600001)(26005)(83380400001)(6916009)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c3a58525-66df-474c-c898-08da5f35e8ec X-Microsoft-Antispam-Message-Info: 7a58d3mbS6a8iueQ95xyqZz63WW3of3DRxvWLfUl5JhCss9yDmq+FZCXqL+TXBx2uhYsFgSdquZNY2GwgK7rxIVjW7mbDRzCiSaZIVtqZZADrM70kMZpakKm/SKt6CbbMtLzGgk87nOdP8WAGpec2NaHmzv7OJExyEr+J7nQcEsNT1AmyUDs8g3t9X28nGCSdf+cvGeKZEjw5G3ZDvbcSN6EUytzozYbQGF2icju2YYxGZPeIAlBNR32yM8iyuZzxX+y/F/AnMf9qFSq8etyLRtsDYxyttqXd+t6dZV25kg4NpY5YshSSFCzBYomuieaoNJQO4fx6UUSt6e4PF6qpAm8vyQZMv3x6qRVG/0tfh7qybccuervx2yzcnhxxrUGHEZOYhKmIhdi0O5mHRyfYWAGNmkYIpoRWeeGn2SwOE4XZ/gTTi+gyEIgDoPzfuVSigqzNCTrm3kfRAYm1KraQ37CvCwH7llYdNSkk9qaByWU2HfzeRtGYEt4dky3zsAIysk5q1j3jdqib3amEgZfc7VBUSlj50H2u2a6N8SvN9YUeDcW17GH+M24g3OQqiADBb/Pk+lp5eNslxrkkjDrhH/RfoFAJ/jT3iHdV+5M09WXVq6r1R+TL2sv7JKwtoTZh/3S/XuCQiPb09w6msQZxjjLr0ODiqvHSnh4geTR0eJP7bXjSBZ0Gh+9bGJzErFPlAc4UyuiN/MbfvLt73fsI5dhuXVLZt6s8uczlZpU+769rBFA9RRwOX+m0x0K44D9QTFbNfwYmCFCb80J6bOPLTRhxtfhPySXqkYtlE/881F7tXTr+eed7rrvkGHYlWdy X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:26.6789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05d54495-e5d3-40ff-8ed7-08da5f35eea2 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4162 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: iuCeO1X1uYXHQiWgS2ATWyCLx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101451; bh=8sMoK8SIjtSIxYFD/h3RdZL0Ud1aRw/7je0PgFegsE0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=qk/kHNLGs9GZ7n6kd8CmufdTuj+/42U93ZdbnLe2Ca0o1QqM5ldMUxC+OKMSSex5Zj6 yYqggTQV5fEls7mAbc5NuGT9CKU2q8sQ06Gig3MxQsg6IpOdFfoltOXCVYdnIf/5tPmFE yCcNT8g7KysiPOV/j8PHxdFZj220kIh5NIA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101451999100005 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: v4: - No code change since v1. Re-sending with v4 series. [SAMI] =20 v3: - No code change since v1. Re-sending with v3 series. [SAMI] =20 v2: - No code change since v1. Re-sending with v2 series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 27 ++++= +++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index daf9ff00c3deab4005814bbfcf1650469d1e7d92..a4dd3d4a895e0a1ae305c937d9a= 413665fb8e171 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -876,9 +876,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_REMAP= PING_NAMED_COMP_NODE) + + (ALIGN_VALUE (ObjectNameLengt= h, 4)))); =20 // Named Component specific data NcNode->Flags =3D NodeList->Flags; @@ -1007,7 +1007,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_NO= DE); + 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; @@ -1188,11 +1189,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_SMM= U_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; @@ -1360,8 +1362,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; @@ -1491,7 +1493,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_PMC= G_NODE); + PmcgNode->Node.IdReference =3D (NodeList->IdMappingCount =3D=3D 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_P= MCG_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 (#91093): https://edk2.groups.io/g/devel/message/91093 Mute This Topic: https://groups.io/mt/92203101/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 May 17 10:34:26 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+91095+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 1657101455453252.68142860925298; Wed, 6 Jul 2022 02:57:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id i2gBYY1788612xNvXv59eSEB; Wed, 06 Jul 2022 02:57:35 -0700 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.57]) by mx.groups.io with SMTP id smtpd.web09.4384.1657101454028902126 for ; Wed, 06 Jul 2022 02:57:34 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XNTb5Dz/3hXEGERbLf1wfYzDsJdCl5ral6REW8+svMZjBWFVWKOsGuzw/8rZzQqSlXIKfjq5aEVhoCQO9CwoazfRHg0pPB1NTV3LjJ97qYbjn57cXTcGlJhPsXj/S4usV8TEDc/XJEiXzevUku1de9HqhaBrmKYSA5au4QAlTX+e6Awyf3wxroDBGSW8VcGYo3qG1o/PKCVVhSyjldhxdwbZw8u9V+7B3M9ffUtY6kl0zEeedhYasGwTjSS2FfTjW1sF+hkK4FbnkZQaGy4xQaCf5BGoKZ5I69BlWrVG4/lGM1+QMiWbZMaaG9Mvc2wj7K584ycAfzRjrN/cPh1MCg== ARC-Message-Signature: i=2; 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=KInfIitDLk5HvjPKAIRCWn1xFUhxXTbIO9LAd9YCDfk=; b=f6itGbVcsx9GDMwf6ix0Kz4hAfXp1VyQvZfnwACtYBDrg2uPxOFw3dF60zRnY/PZJlCl8uqhGlgjjv3s17TQMxglnUtu+e5FStp8Yb5rK96Stg6zUuzrEHbKpkx/hfqsDcj3XubRU2HcjCYAixrWaBG8ulf3L5szGFLMprcaLAuxQegIJsRyoLOf5vLqlPY+2Ps/5MJZhN8UYoxi6dsn+2lTGxkNeGJXeU6HkDwFddtki4nJqA3gOK6rsACqdD0J+BzaJYohZXuBOoAsb7r/ZbB56gRqc3Xran6L6JzQfVdZVm61OOTkP7dUvuXcbA5LHxV8wKvVM/wRxVVjNmFYjA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS9PR04CA0080.eurprd04.prod.outlook.com (2603:10a6:20b:48b::28) by AM9PR08MB6163.eurprd08.prod.outlook.com (2603:10a6:20b:2de::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 09:57:31 +0000 X-Received: from AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::92) by AS9PR04CA0080.outlook.office365.com (2603:10a6:20b:48b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:30 +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+91095+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT044.mail.protection.outlook.com (10.152.17.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:29 +0000 X-Received: ("Tessian outbound 190453a6d737:v122"); Wed, 06 Jul 2022 09:57:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2bcc8e553a428981 X-CR-MTA-TID: 64aa7808 X-Received: from 5afa4fc9816a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7D063D7A-AC28-4C74-801B-4F1532634D29.1; Wed, 06 Jul 2022 09:57:22 +0000 X-Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5afa4fc9816a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oceFv1icgi7VGj9I+GJGkWsdJwHLzUa/cL+Ubkz4odCJ07AFl2m1IKfRLEbZh0X7eChhvMrqtK4kePHJ6YzbGS46uedfdejK75AQDYNdQFDy+/+Hf3z5xcZq3HcMiyQ89rXUDNzbFgCfdpO6PIoB1j5OtMtuq0JHOCXhwtF7fzsX/qFgah74EmEfUk/eUr2Xpt0/hEG+KuFyXiB1ysY8IdjnHqN/+tgrsjMDipCmbD5Z8SM+1JLOIXq6wzs5sb/cc00CY8XAietVSsK1J2h1MqU7dnMvGNONo5usw0+hWcM1pnCcot0cIYH51DuXv/TAftVlssvCzC1rmXtNIgLGXw== 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=KInfIitDLk5HvjPKAIRCWn1xFUhxXTbIO9LAd9YCDfk=; b=lOcSjV6Ykoes994vvC22NKRSn+eR5sIcz+dq1VpJ2QuE6buUm8cci8lSfwFGWoo8uLgMHxeA8Gt2N4BJ5mB3zIhGDgv6vpY6G6xbiBM8PrGnhw13qjTwpXwJ5AxQD/kXCzj/venDrD50CMlGBdrUCX3psTJRYZ8mHAOS/SbbzFYK22ZVtJhtnkUXiBxqfJcCpJDryQJmm3Wy6SmQSg/PS47nI3jrW6ty72TCnydJ1s9riqO8Lj/AW1xdWJHLOTHYz/e1Sch+nFmgl+JRv5JUnsdaoJZIyDykPyXAo3t2w1SUaIKLuw7FgeKX1Us9CI6yNzLG/3fj7Waoxe+Zpt24PA== 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 AM7PR04CA0030.eurprd04.prod.outlook.com (2603:10a6:20b:110::40) by VI1PR08MB3262.eurprd08.prod.outlook.com (2603:10a6:803:47::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Wed, 6 Jul 2022 09:57:20 +0000 X-Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::9) by AM7PR04CA0030.outlook.office365.com (2603:10a6:20b:110::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:57:20 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Wed, 6 Jul 2022 09:57:19 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:36 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:36 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v4 6/8] DynamicTablesPkg: IORT set reference to interrupt array if present Date: Wed, 6 Jul 2022 10:56:29 +0100 Message-ID: <20220706095631.27196-7-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 178cf98a-2317-4962-eaa7-08da5f35f059 X-MS-TrafficTypeDiagnostic: VI1PR08MB3262:EE_|AM5EUR03FT044:EE_|AM9PR08MB6163:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3Cr148815PaOTjQ/XbUSZ0w51OChwzF+NvZEnkaRSL9Xve2m/9CD0HAYRHzzH5LsYjZ1H1yPXxH8l95q2MHhN5bxlSWTKPXh9CsJEsdVsCrQ75QBeN3UX7YBJd6qoOsixkgohZJfsZV42fhePEnQJoENmq9u7xX0SXj+SBB3V0W4oXqezEi1b1fFT6JpiVtDvmj0uH+/+auveNvw9OOgS6ppy0RsxD1z9a75u7DOWHqyq88IO59RLKS5gglaZQ1aBrLlWE7CBMIn0bPyfHoe53zjTKXjtIf+7wQ+lueOgaD/tsu9gvcQprJP2QW+yBa+HM1FwaG7eEVGyqZxmGteCNIBC9fJ6JZrbL5xFh46pVNNf36zX8fcCNTUFgW4MlRyy930y2PC2VFRj7Jr57xoQa0Jx7EHYw+WywiZV4+5bIcdwE6KIBrpH5IOGk/8pMI+3+7J3JHltXnjusIE2ZFEmlY7Enc/0oTJp6uIKi2gEpwGRi8CMHIhzAX4DGNbSMyUQVOjQbRr9Anz6zV5QHdbefxGSAe/kHNmuv96ngYDmW9qmP56aWdL4+RN3Ek73fK3Me933euEJLSttUTr76VgMqLeMV3ZhZ0Bcll4T8vCd3OqGY6vWRrzJcA079+x8iyKQjqT6lJMAafhTVICJAI5yo/fbx+UvtwFoP0DfI24A3YF5ArYxoKKYer/5P9BtPE7gU83Zk0iwrXUvidept2HklmRYPgMmcce6PHieF4UCtZMVdnNm2Ajsy1J5HEldurc63U7SpET8wRkA2JUUXnfQvP2W4prHDc6EqwiRrrutTGv8Tz0fyGYok8Y3AwHvMQIVut6EXwM69fuguDhu/lljjxjXmba3mC7WsGiucXk20CHwGfj3aI9G/VM4/+OuZOB 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:(13230016)(4636009)(136003)(39860400002)(396003)(376002)(346002)(40470700004)(36840700001)(46966006)(47076005)(426003)(83380400001)(336012)(41300700001)(36756003)(186003)(70586007)(8936002)(81166007)(6666004)(36860700001)(7696005)(86362001)(5660300002)(44832011)(1076003)(2906002)(966005)(478600001)(40480700001)(40460700003)(8676002)(2616005)(70206006)(4326008)(356005)(82310400005)(26005)(82740400003)(316002)(54906003)(6916009)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3262 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fa811b53-e562-4055-9ac8-08da5f35ea8b X-Microsoft-Antispam-Message-Info: kODdCwoOhvt0xAdilBinTqUpnLxJBXDsTAdzZrkHovY0pjOjIEsJIyRLmhYZSyuNyj5p0v2O0F2MErOa1VZNx4z55cskEk2QxpJyiJ5LI67+8D5odwt1uoVWfNfq1S6yuTKxgARixe1GkOMCr/MS3QTYg96fwHrk7FiBuNM8WUlrNWrj/0WUQPBMleCxp1dcgN/OTOsOzZ1swZCkvK9WWzSrMz2BeoUGbrXxFYZ25zRoAKvxtmcww4r1REWz6H83ZmhFnJ/MwkhK1pmVL7xqUYl3MLeIhcGqit5hadIWYQ2IKV1X1YQahC5Ie/oaf5Ha6oEfGoz10wsTG8twqhilLKZ4hcKJeQ5Mq6cl1SrH8Ud+7z4VH4KQYWqJ9AhgqQOOiiWQxZ44yDg+3FTyMygJRXmNtp8MKWCrw1wWxKg2q+YqAAxg17w4mUAL85ptO0gM/MhT56ToJJWNvJwKcxqG4FsXmMG2EpDjrKuv0chOoq+eYQG5MVdy4x6NbWGx9e9FPF8dXS4H1ATITrng7yFcE49kgT7iyFSShCnPAKyjWOom4iRXNdEs+ttKiJMLDyiygBYrvipdHyjH/bvKqz5CzXF9Z5hreVg5qmif1t6I5W80NfAzSVFLEosrwv4Sw9oa/x/MJXvIUdWrOaRh4Hn+3/B4MMuuyFtoTj0HmQhgIK8AF8h0bCxDUeD/spGSptka7zMJgyKPBq5nLFV15JjnUfgucpGJ4mG5BFVFAJZksMyyMh8MD9u5jT+hWfTcFkJ2jgh/WYnSkGm0neMAObtnU4wLIgBbiLyfELKodqscMRDeoERQ7b+VIoyyeE4Eo86piKGARGGBlRgK4et+PU+AWf/7Vkg/UOSzL9MAtHzarNk= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:29.6042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 178cf98a-2317-4962-eaa7-08da5f35f059 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: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6163 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: VXiemkjloTqTJUdYzliANLS4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101455; bh=HhpqqdJcsabxnR+NxHK419SyvdwExIck3o9Cjtnlss4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=SNzhuNOl5/jDJQje6InnnBbce95o46mniXC8w37cZZ7u/a2Qo9dRVh8nq8iH/v8yRHU JaoJ9of4dc0HYid1rIIRui7TZPkdCz+TG73kMheJgQkZZjhiSwDtsVD2/k/A9qzYY7AWx ye2Vzseocm5VFSdjRodMAWDKim2FLUDAulE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101456084100004 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: v4: - Minor reordering of code to group initialisation and [SAMI] checks for the number of Context and PMU interrupts. =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 =20 v2: - No code change since v1. Re-sending with v2 series. [SAMI] DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 87 ++++= +++++++++------- 1 file changed, 57 insertions(+), 30 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index a4dd3d4a895e0a1ae305c937d9a413665fb8e171..abef9e5a7f90a38e1d697227d3c= d2c110db364a4 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1164,6 +1164,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 @@ -1206,48 +1207,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_REMAP= PING_SMMU_NODE)); + SmmuNode->NumContextInterrupts =3D NodeList->ContextInterruptCount; + 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_SM= MU_INT)); - PmuInterruptArray =3D - (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode + - SmmuNode->PmuInterruptArrayRe= f); + SmmuNode->NumPmuInterrupts =3D NodeList->PmuInterruptCount; + 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 (#91095): https://edk2.groups.io/g/devel/message/91095 Mute This Topic: https://groups.io/mt/92203103/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 May 17 10:34:26 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+91088+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 1657101415373269.90907083734203; Wed, 6 Jul 2022 02:56:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vuMxYY1788612xdwsoQSFaoi; Wed, 06 Jul 2022 02:56:54 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.88]) by mx.groups.io with SMTP id smtpd.web09.4376.1657101413447865910 for ; Wed, 06 Jul 2022 02:56:54 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=aFqFSFPN6MsiLqcLvi69gnlytuOVxj+M1Dqiq2ZgGftrYHo06QyaverDyaEd5FqeuuRcEGQkO7j1TmCAidUcctes2xWlDkdIPUxB5+8hCmMM+dqZAMDjiL+UEDvdvuGpGgodWx0fapzURpgT8iof9+1DtO7v1R2RxVjpglAlNtE1OWh3WuADgekGY1+s/PEHxIWSkmNf2xfbQNslCFaqnBR0iX4hpX+NeIEK7nSvfhchqfEArRJF1fPOtdqs7l9YmHNLkjgCVlTPJ9EoS1aUhdQ0xnPM5qD94k1VDEYaqgYPewOFty0aEl6UB6RX3Ap59FG0Kof+an/XtpKLjhFKGg== ARC-Message-Signature: i=2; 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=w6V/uEz50+VHHoVJlaXc2D+2JUGNv4PBNOnOz5bZphU=; b=dwUb1QpOtZY3oBW5IzrsOQsdSVS+c8b3X6YMbMM5Sqb6hlg1nLlcneHIUfGQDX8NDeoZM/vv6gInN9J9Lwk8ua/8gNYXc52rI0paSDAlHMSdmFWN3I5913hR5arKu+JqVvytPmprkHHDVhsHkbpaA9chN4NN+uEOlxe5OdEzeDcd5Xmn/o8iDPLVx6GN5d0XZUfcYdapECASXUTpbZBlkloDBdCZyfXwSq7nb5rVB6rghoFRUdQ76W0Wksw2ufFUro0tYTqde92hy35VVLkpPMNu7zla+8LnBIyDzn4O5rJJt3exdQ4K/70ahtrSlNxeH+d7PYoawGODA2cmf+NzDQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS9PR06CA0253.eurprd06.prod.outlook.com (2603:10a6:20b:45f::21) by DBBPR08MB6121.eurprd08.prod.outlook.com (2603:10a6:10:204::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Wed, 6 Jul 2022 09:56:50 +0000 X-Received: from AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45f:cafe::37) by AS9PR06CA0253.outlook.office365.com (2603:10a6:20b:45f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Wed, 6 Jul 2022 09:56:50 +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+91088+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT037.mail.protection.outlook.com (10.152.17.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:56:50 +0000 X-Received: ("Tessian outbound afad550a20c6:v122"); Wed, 06 Jul 2022 09:56:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 300d17b8cbae93a4 X-CR-MTA-TID: 64aa7808 X-Received: from 28fa10eb1bd6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 748FC650-2065-4D1A-91EF-156F0E6831B7.1; Wed, 06 Jul 2022 09:56:43 +0000 X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 28fa10eb1bd6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:56:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhNmqGXnc4NtePRoyN+koQKS9uUQdWG0EHYy/AYQwuCTiKszcEwqOFUjf+GWs02r3AVJcC0yWRU3ilOmMwWJQGrG02qBjsrbOrcERhQaY1J+A8ZHJti/PMXRNp1qUU++sgEqXdxmj5hELE6U67ava6mARWL+51Vq/MtBn1/RCIQ23z6Phhgt9tXTm4fNEDBuoBPeUtT33DITKtZ+8ftacxe90PfhLYOhYwbPX2Ls4cnHxqenahSpy8Gxfu4s3yfWXStjVcE+WJqdlgOUQlrzeHNpds6tgGW/TS7Wooko4lceU2QXpg+FpoqhJBnT9YFeI9FB/nYQ4kkgH56t7LvfSw== 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=w6V/uEz50+VHHoVJlaXc2D+2JUGNv4PBNOnOz5bZphU=; b=VVAss3FLPwQsPX5Ukxami6Hb/McFBjux7XUAKg/Wm6HoQFjZgSGCFNLeIGrZvx008hOQhYlYpbbuOtIGFZDi/QIZ7SrYXsIaAQ1ZWr+eBpGGBBIZqMj/QZ9IOhA10x7Ti2DldP38weqVGQSsp1SSRzvUWPisYUwQ/yi3uPRi/uOHu6T6PdnwP+U/sGY6uiKYyFqFXbUtb52Rd5JMPWajeFOV6SknJrIYouE8EIxC7g9GG9EnwFEEvxqOLuTXqA8JHaDtU/sNTnQQi9IsfIJaG12p43WSL/FFdANyVk/wxdNvsWQey260qLLruA/5gIz9tGquRevVBHI29fn3pIYL7Q== 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 AS8P250CA0004.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::9) by AM9PR08MB6276.eurprd08.prod.outlook.com (2603:10a6:20b:2d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Wed, 6 Jul 2022 09:56:40 +0000 X-Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::95) by AS8P250CA0004.outlook.office365.com (2603:10a6:20b:330::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Wed, 6 Jul 2022 09:56:40 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:56:39 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:37 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.2507.9; Wed, 6 Jul 2022 09:56:36 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:36 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v4 7/8] DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.d Date: Wed, 6 Jul 2022 10:56:30 +0100 Message-ID: <20220706095631.27196-8-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 15096946-bf8f-46cc-b10f-08da5f35d8cb X-MS-TrafficTypeDiagnostic: AM9PR08MB6276:EE_|AM5EUR03FT037:EE_|DBBPR08MB6121:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: A1m0xXdHJZkmD4U6MRtCxzg2xy/PE8LIEJT/qVwrYN0xPWMyFQt0FIbOSa2+SDdWfIz0MULfwbHz+BWqr1HPSbCrBWZjKdzv3Uenl1H/sPHp8Bd3n8T2A2y9Fw0lz/X4Fx0E8XOpgxY5zDLAzwWTSj4W8pKWGdQpXULWR0ZhAAxeCXBF2fJRbO358eK6+sSFWqwh3d4h1MZjHgh3i/lWB0g97ygZmlyDhfwUKNvsmxyZAOoc+yr46mMRwSXiWWSwa1NRXQC1rAlAsy4fkD4/Jl6fG4Ly6xEqAVc0E1M2XbjUY7AuHcy/rFnwfj3ZMCQ+rg9CV8bvqPHBRrIPiVa1DhwUf5ih/ut38PrHaDLkxLgpeLmglTP80t80NokIEefdMvNxi9xWIQgQP/o/LtY0XjRX7tZ+gwFLp8KiKNvOhnLwC9mzM8oUxaXPB8d3KooKRTp1+v4qUzIvL72btBZOIfOPzYPHhrDi6FoOEFGdTHY27k1z6IYbNLIAadwrCxSxEN7J1CkyLRrJtNSnhHIV4jIXL0z8e4jw74jADbvv/Yib72Qa8yl3se0Cyn5KsyzFk63LNkXccX0VVNJQ1MLZBl+NofHYenIyNaXDDnkyDgCcgBpR7JY7a8ZskDzv6wKfI77nNG550RqzkWAdPWDxBInZc0Z8i+YCxjvhIKYAXO1DYKGR+Dg3XmPA6p6GFKCEEYrtwEfzyAE1TqOkDO88Y0q/4RQwH2efCaQ0xEUOxEizT47bYZfbGzFzrOzZFqdNGAbdJ1072QdSL/QUU38dK88LvHSCQ2MdZsJaIu+KrtNfaY59+JKjoVLfIuIjsm9L0dqauajEV5u3kSRgPKv0RnZi7q6HJWv7hB200NOSeqhEBa24vJz2dg76DTQmR8Th8VyHFw46/jlXaNMyFMsJR6ksau+D3a6z95HAnoUI3zE= 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:(13230016)(4636009)(376002)(396003)(136003)(346002)(39860400002)(40470700004)(46966006)(36840700001)(36860700001)(86362001)(5660300002)(83380400001)(2616005)(426003)(186003)(1076003)(336012)(8936002)(36756003)(356005)(81166007)(47076005)(82740400003)(6666004)(7696005)(966005)(478600001)(316002)(54906003)(6916009)(19627235002)(41300700001)(26005)(70586007)(2906002)(70206006)(15650500001)(8676002)(44832011)(4326008)(82310400005)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6276 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8dc4d990-3734-488d-5681-08da5f35d290 X-Microsoft-Antispam-Message-Info: H8n4qxS2QmOTOhQWP9AwRZpkQ8LRmY4eCyUZjNJ7NLSPwVaF2dzFGPoDUOUkhF3mxxBJQsrhrpbD0Nt3aCb4z7BRXqq2CNeLKx1qj1jyDdeGAnxtdzDo4EgC5NKtCtTExafSVkep+Zb7E/KblD+/anqFOJ9L5HbRW6xWisEWX2eE7Wsqx08z1PV5sTKsnFd5zA4gRVOiaCnLXwDsIGNaelSDj8lMNXXXDU/cnGiw1qyniKHdvNK2DkdP8ptcCXRcwdwQrB/jckeIDQmRPIQ0OCHmkPgF3m1JwJBA3CxMRVZJLfjAL98IXxJB9dHRwfmxQlE5KVJjUNdQySX/YQ/OY+SWQrSNjYz5mvK0sb0NdYB69V7rJN0juno5WX01zqMF8K+q66sKeXZB9fM3libYtvZpNTj6yw9O0h5slsXS3235tAshbqYZ1Z2/MmfjhVOBGy8us1MkUR4eh//dofhftih/wzQcBDSgGWmm2bULq+iq5r9lAvVQ54lJ5ZxblIQq21fm3vTZ58RlOcw5STHwVjZjwSdhx8KrBO4+GAdb4+Ng5lNYBwL9GDqQ6jI+lDf5JBsxWdzGBW1rXe0f8cOFjNsSOXOThicfnPAZ1JksE4cYpY4gPDd4YJWnsWwcYWQkYhuMY614oaZlpCb0KKi6A8YsBTQKBsiEPdINH85Cb4dm+SJPQCXDVTw61VsgXINUUFIlo7dCfopdI4jFMebprDLP4PCfBk/3oDIMYdULr9YJT0mtLG5/9Jl2gMHVKZ7XgViQZXJ5Vcp92T6C/9C/eXrpTObkT7ULkJo91mSR9FtQMDgR9BIQHwc1h4ubcgpt8kebH9s1gX4vNwHTrlXvuD4yXJ4SIM6OvWqCusJe/rMJ0EPqXgBXp53e+0oA0cEhmsTXtentzFP/geYe4z/8iQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:56:50.0542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15096946-bf8f-46cc-b10f-08da5f35d8cb 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: AM5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6121 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: Y5BbrlCbTtblWxxN1iZ5mggWx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101414; bh=ygtzPnMrqPS7q42LVCaeZOS0ZNVuwLfST5+TvU7dXbw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=SV6BiZqkd5v0ksCScjurfW68Eqry76nHCbfNoiMCmnmvTn6RGvFuyO5I8syvgaxnVcW EFq8Dwgz3jE65jU9Rbb6vVbbcwqEKAttLk8/8/E9sRK9xiDSSMUSiTNZpZ3dOgQdSY/5A 0A9fTfE+ljsf2iNAxIkhcmlOO8ppG+utIQU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101417889100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - 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. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. 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. - add PASID capabilities and flags field to Root Complex node. Signed-off-by: Sami Mujawar --- Notes: v4: - Update ArmNameSpaceObjects to support IORT specification [SAMI] revision E.d. - Add PASID capabilities and flags field to Root Complex node. [SAMI] - Add flags to define access privilege and attributes for the [SAMI] memory ranges. - Update DynamicTablesPkg.ci.yaml to add PASID to the ignore [SAMI] list for the spell checker. =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 =20 v2: - No code change since v1. Re-sending with v2 series. [SAMI] DynamicTablesPkg/DynamicTablesPkg.ci.yaml | 1 + DynamicTablesPkg/Include/ArmNameSpaceObjects.h | 66 +++++++++++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml b/DynamicTablesPkg/D= ynamicTablesPkg.ci.yaml index bfa282926e48c79ea748b12dee19a322197eaed1..5addf8626841fe35dd0d499a277= cb7308787fee0 100644 --- a/DynamicTablesPkg/DynamicTablesPkg.ci.yaml +++ b/DynamicTablesPkg/DynamicTablesPkg.ci.yaml @@ -108,6 +108,7 @@ "lgreater", "lless", "MPIDR", + "PASID", "PERIPHBASE", "phandle", "pytool", diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 91bef9bccd1978b0e396f423cff81e621b05e0ea..102e0f96beb22cc2b93c1525bef= 62cd4173774eb 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2017 - 2022, Arm Limited. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -61,6 +61,8 @@ typedef enum ArmObjectID { EArmObjLpiInfo, ///< 37 - Lpi Info EArmObjPciAddressMapInfo, ///< 38 - Pci Address Map Info EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Info + EArmObjRmr, ///< 40 - Reserved Memory Range Node + EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor EArmObjMax } EARM_OBJECT_ID; =20 @@ -477,6 +479,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 @@ -509,6 +514,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 @@ -537,6 +545,13 @@ typedef struct CmArmRootComplexNode { UINT32 PciSegmentNumber; /// Memory address size limit UINT8 MemoryAddressSize; + /// PASID capabilities + UINT16 PasidCapabilities; + /// Flags + UINT32 Flags; + + /// Unique identifier for this node. + UINT32 Identifier; } CM_ARM_ROOT_COMPLEX_NODE; =20 /** A structure that describes the @@ -579,6 +594,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 @@ -615,6 +633,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 @@ -639,6 +660,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 @@ -1006,6 +1030,46 @@ typedef struct CmArmPciInterruptMapInfo { CM_ARM_GENERIC_INTERRUPT IntcInterrupt; } CM_ARM_PCI_INTERRUPT_MAP_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 (#91088): https://edk2.groups.io/g/devel/message/91088 Mute This Topic: https://groups.io/mt/92203091/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 May 17 10:34:26 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+91096+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 1657101464088627.0034742483904; Wed, 6 Jul 2022 02:57:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9BYuYY1788612xEDtORlxwD0; Wed, 06 Jul 2022 02:57:43 -0700 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.71]) by mx.groups.io with SMTP id smtpd.web09.4385.1657101462435545902 for ; Wed, 06 Jul 2022 02:57:43 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=d7JMzvL3YTzEVilb1VQOZfltuZV3Lz79e/ZzjsDNq2+n1+HShT8q4e5SsjxAj4ifW0nEhdvwc1Ot2fztjfFxNs6E9NMjGFYwszdUMs3D1zGmuxTEnm6zSBBsxri1RhhvKK+yFzC2v4xCyM/LdYpBIpjk6dKbiUQFq1WnRfkVO1OGtbU+KqbCXoHzg0nEeGahLsuIbeA2KeUtXSydhxdy/zuThgj/n/p8mpu4sVCZMocM8Q0wKD2DaSuxBjrzQmJ46jty8fDPSRlXgxg2dqO5/lvh7cSq04AAKYszSqLuqoEtvDPHemdnDxNXPu6FEyKOdncPK5bjR+vIv28wg4Auxg== ARC-Message-Signature: i=2; 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=f/qUUehoc1HyfkmJVuRX47/ZXtMd9lR8hqlBfIXJYFs=; b=awbzGd/GrtPWF8Fqlhh9mkEZgaru3VI04zih5jYYFiVabkneL/Oj603TLkwyh3Ukfb25pjqFFVYwrqZFVsZdjRt+IXKbY6lGu8hH5DStgDlW74A9HwcpqKDF9Vcg/krFtNYQOgwDqtIIGvbwlBfrmRcGTvG8Oz36nDjLJUiPokb7D22+iUqee1MWzlR2ampDVPz5aRbV16DQDW4IPDWYsTkP64Nn+gtLcjaFQD+4gyktJk0BGzwAXWUcp9kiIMOmrICdBwsjNFKihp+Ci052afbeG2VaOK7IX8YcZDXpwaS23POAPJBdJ3zdOa5N5D6uys8sqw4UgmpmIWn1Dmc5QA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) X-Received: from AS8P250CA0021.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::26) by AS8PR08MB6904.eurprd08.prod.outlook.com (2603:10a6:20b:394::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Wed, 6 Jul 2022 09:57:38 +0000 X-Received: from AM5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::4b) by AS8P250CA0021.outlook.office365.com (2603:10a6:20b:330::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:38 +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+91096+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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT049.mail.protection.outlook.com (10.152.17.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:38 +0000 X-Received: ("Tessian outbound afad550a20c6:v122"); Wed, 06 Jul 2022 09:57:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0d7b427f01ad9dd3 X-CR-MTA-TID: 64aa7808 X-Received: from abc80f3510a3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E85A66EA-F6F0-4CF5-AA27-1115F1F50B27.1; Wed, 06 Jul 2022 09:57:31 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id abc80f3510a3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 06 Jul 2022 09:57:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JLFgft75MPFvTk8uL7+pmSlTnirBkM/C1rf/hC4bZdwpUsV1d7FTQGiDcZK1+FwA3Qky+wi2WDnxQ5PWOqX8Zo1o8C2tz9cGFVQoJt3O9Bzwj/QCA33BIhCIwNnJhkmMWJIeLM+sA8yCafDRMCXQ8fxoP463aj12EXirZ/v4mV4zL8/fRxOCtm1Pw81+Pobf2nSpXpVT7DFHynkPC4wQjAAH92Kai6IwzhZO1ZobOgcAw87x6MC5jKzIGZN0ApWO/1NDgTBzJXQqawO4TZtRLmlQRnRZjopqUEmPd0XTmhsi0rO1th9TZLHjVAkFXM1cIK7Jfv3Wv4RFOLJp3UtahQ== 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=f/qUUehoc1HyfkmJVuRX47/ZXtMd9lR8hqlBfIXJYFs=; b=W0IPuldkB9fWpyHTS92R2EPPJ9pesoT78mIGIdVFeaBBVxDW1D0Z0SM51sV2wQlQ58EoEL9D8BTQQduGa50idyKjd7bZ3yx653iJLu61FeXDLcoC2guyjcamITSImF/0e5mZi/iPUsOqDZgVJcho4N3j89A2vlLnDwdDYH5CNzwnI9mgh6iVA8mPMqVq0mhKhHdgOa/RV7lzIRp06ImZJnJN+F73DAU83HaD3a+N8e6L8uKbl8Lfdw4qfPBVN7gxxVXE8xYwTUBkvfMqGl9g6tLHL8XXRfNdnzo4YF6UocoYRgqZffNRoPT70BoEuxda50kDsBmGJfGq8MMwKBvgKw== 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 AM7PR04CA0021.eurprd04.prod.outlook.com (2603:10a6:20b:110::31) by DB9PR08MB6747.eurprd08.prod.outlook.com (2603:10a6:10:26e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Wed, 6 Jul 2022 09:57:25 +0000 X-Received: from VE1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::e9) by AM7PR04CA0021.outlook.office365.com (2603:10a6:20b:110::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Wed, 6 Jul 2022 09:57:25 +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; pr=C X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT039.mail.protection.outlook.com (10.152.19.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Wed, 6 Jul 2022 09:57:24 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Wed, 6 Jul 2022 09:56:37 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 6 Jul 2022 09:56:37 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH 8/8] DynamicTablesPkg: IORT generator updates for Rev E.d spec Date: Wed, 6 Jul 2022 10:56:31 +0100 Message-ID: <20220706095631.27196-9-sami.mujawar@arm.com> In-Reply-To: <20220706095631.27196-1-sami.mujawar@arm.com> References: <20220706095631.27196-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: fc80a544-0e9d-4615-4985-08da5f35f5c9 X-MS-TrafficTypeDiagnostic: DB9PR08MB6747:EE_|AM5EUR03FT049:EE_|AS8PR08MB6904:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 5GsahuXQLOB07BMQU8qY60vWK8Af/jfWtZqqVpNnK8bD2T6dYt0/Ae5ixErHNyPxpErXw6ASRZkVwzaFqmuw+TESBToC5VVStGIKC4ZRrmiZnD4+RytZ/L7Mqwrne60/H2D8Zv/hlQRg6Y0t9xxIE78vcYZ1cZkr/aru+uR5Ci3PtBvqqGv72c5aY55fqMGViwMdlZ8WE9Wn8s4Y8/GhlZqwXz0yFisiTp9/srypuc7tlVor3UMvpf8AlgCgAXCaubbLaj9es+Bo0Gi/JPPTixfpYo1sw6xxtdjBd4kQVR8dI5+Cw3O/FRYVW1++F25tA03zbEv+w3CWwCkRoDCx/ANCuat+3eob/EqkvBpCYUZLfKK4NDwkBQzuv4By6AEKSx53SiJ/aqzuky81RbkwOD8NqV85z6Y1misrg3ll6Jyi077pIzLMhN4WwijY5ilWfFAXBDIsOXe5QDQ6zabe6Wvz8HhBURQamO4VnQNTfLWVOz0zzaEGb2z4dNHFfLEXfeZwzfCxHwSNKSatCJDkF6R517cxPzy8njaDQSN3VyL0cxMfoKyB1TYX+QTDPcfW/RKZcZWKLf8yv5o2peT+/orYasnNCSGA1XVxfmQaRl5aJLd0eT18iHdJSJw9X/Kr9RVFWHKCw6vBYzmKu8H6Y8ztmcr3kzDC0AqRbXbBiDyeNKU+FET2aBDyzX7ezMpKf6BbuphuwfzZGJW2PHMz6uJjhNvyt9qMjAO2fpmNX2wCppz8fq+gqh3dsXZZo3C19/7aWv1pTDolZ2Bv20rXbXVm6rSOfowiaKQ+qsCG6aSr49tvq+Y3RPUmtlsUYwRRHD+lnfXH0dPj73ITCtWfowwyT2UKzE9W6ioY8Xwhw9HYXdN5L7zprzwyS0aNRTdi3JDLOAdgjY6L0lO1yp4va25mz6HIzf+B15Wl7c0N37c= 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:(13230016)(4636009)(376002)(39860400002)(346002)(396003)(136003)(46966006)(40470700004)(36840700001)(2906002)(36860700001)(41300700001)(15650500001)(2616005)(6666004)(40480700001)(1076003)(82310400005)(316002)(19627235002)(36756003)(426003)(54906003)(6916009)(7696005)(70586007)(70206006)(8676002)(4326008)(86362001)(47076005)(478600001)(186003)(83380400001)(336012)(82740400003)(81166007)(356005)(26005)(40460700003)(966005)(8936002)(5660300002)(44832011)(30864003)(36900700001)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6747 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 91d4d989-e2d3-4b68-94dd-08da5f35ed5b X-Microsoft-Antispam-Message-Info: hfT/bajNj4E57gAHtxR56OEsCdFyrUwJRNtf3hkqWlc4TkMvLQpyxWvZK28NLiNR8R7JdtqzSTYSnWMYP+nu1ReO/CZluukyE2WqdnuSZZXwfgBTA85y+LeeFOt9W3ZI4NzOZ1a6FFmEbHNnjWquZOFUCHpWnTLV/6lE1lzkL5fY4IDJDH7aV8PeQbu7+5GsoihSdSyh1lnb+2tYxM3MJSHfbvCuqWRSfXkA5DAXHFPZcrPuIPo3obFbSsnNUwK+tTNV1aDQZuG6KmmPwgLgFtCXMWPeVaOVXKeBeC2Cly/Bt/rFA1WiDEFg6KQDMleI9yw5jIOhbYhMK62ojc4Lm+wUOkAvwZ/0vUct5YeIbjOQ+UDrdtUAlZ8AxVO8EY0F414j3mwqDJaMcaRUi9fmuYlDDPeVY8WE+RHAY+pce5XXLjuVQFEbmVZ/kNfXXNSMMReHtlB5nQkz2OhXzAI/fDGVIb/RhrwCkNyYfey6Achgr9+n6ZmUu6OcDXFwdFR0iRSDFM8UCAvlsAb1cAQnENPgG4lPUq5Y0+U2dR0EKCre1AbTXXJgpYt5bzjjw5tlLmkjN4Ak7bIlfzL9awT8F0hyinjSsnZrXgzJaxgReyI2J6/eqGZlTNd8GG+/YQPHQx6e3DJ2g5yhwHxVHg/ARuWOrpSpC/UXPNEWxbTbDm2T4UFOdMCQ+Vrba+zBDlbM3lWEP66QDJq9DDYNjIIKn1iLxXGMnoAcySiXxaubKQ7MPjjjg+TXTAsAtLrnc+uK2PRUAk4i3pncoJBGrOZhAXo7JIDdH+H5BjHclRKoiBo4Npefa7YKKTv3zwuVTEXUdvhM8N2KzfdXcfx09sVapEP30Vf2VODlL0Cj8NeDeEve5p6cXDfQj3xwGMPBm7gujSYYfJhZneVj7Hk5jqfEeA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2022 09:57:38.6923 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc80a544-0e9d-4615-4985-08da5f35f5c9 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: AM5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6904 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: 2GMGFj0voC5BdOtrjA2jEkR4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657101463; bh=C1L7MY5Zuefv/jPE5AxnMm8gZymDFYdAk8m3g+PTH9E=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=rxKuiibE9kFZk01WUNH3ddLdb8E34bjskwaiTk98xGc1pZpAUjM/VC3J5/mcPLmoCVu pKb1GVTEvscUIaN/xQbce2rOmgtW2wofsrgef1OFGvwyTgojxhLQ+3ZIUh2Klf4CWlQy4 6mTzlI/gDo0s14GT5zhLI0qESQ8QdyC5Msw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657101466197100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Bugzilla: 3458 - Add support IORT Rev E.d specification updates (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3458) The IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 (https://developer.arm.com/documentation/den0049/) introduces the following updates, collectively including the updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: - increments the IORT table revision to 5. - 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. - adds flag to indicate if the root complex supports PASID. - adds flags to define access privilege and attributes for the memory ranges. Therefore, update the IORT generator to: - increment IORT table revision count to 5. - populate Identifier filed if revision is greater than 4. - add support to populate Reserved Memory Range nodes and the Memory range descriptors. - add validation to check that the Identifier field is unique. - Populate the PASID capabilities and Flags field of the Root complex node. Signed-off-by: Sami Mujawar --- Notes: v4: - Update IORT generator to support spec revision E.d [SAMI] - Populate the PASID capabilities and Flags field of the [SAMI] Root complex node. =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 =20 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. DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 630 +++= +++++++++++++++-- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h | 5 +- 2 files changed, 583 insertions(+), 52 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index abef9e5a7f90a38e1d697227d3cd2c110db364a4..a3700cd31b72151ed2875682779= 71e7ed8c57295 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.d, Feb 2022 + (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. */ @@ -174,16 +194,19 @@ GetSizeofItsGroupNodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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); @@ -248,16 +271,19 @@ GetSizeofNamedComponentNodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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); @@ -320,16 +346,19 @@ GetSizeofRootComplexNodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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); @@ -398,16 +427,19 @@ GetSizeofSmmuV1V2Nodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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); @@ -470,16 +502,19 @@ GetSizeofSmmuV3Nodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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,16 +577,19 @@ GetSizeofPmcgNodes ( =20 Size =3D 0; while (NodeCount-- !=3D 0) { - (*NodeIndexer)->Token =3D NodeList->Token; - (*NodeIndexer)->Object =3D (VOID *)NodeList; - (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); + (*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); @@ -562,6 +600,84 @@ 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. @@ -713,6 +829,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. @@ -729,6 +846,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, @@ -765,11 +883,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= 5) { + 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 + @@ -820,6 +944,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. @@ -836,6 +961,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, @@ -871,10 +997,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= 5) { + 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_REMAP= PING_NAMED_COMP_NODE) + @@ -955,6 +1087,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. @@ -971,6 +1104,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, @@ -1004,12 +1138,20 @@ 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= 5) { + RcNode->Node.Revision =3D 1; + RcNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + } else { + RcNode->Node.Revision =3D 4; + RcNode->Node.Identifier =3D NodeList->Identifier; + RcNode->PasidCapabilities =3D NodeList->PasidCapabilities; + RcNode->Flags =3D NodeList->Flags; + } + // Root Complex specific data RcNode->CacheCoherent =3D NodeList->CacheCoherent; RcNode->AllocationHints =3D NodeList->AllocationHints; @@ -1019,8 +1161,6 @@ AddRootComplexNodes ( RcNode->PciSegmentNumber =3D NodeList->PciSegmentNumber; RcNode->MemoryAddressSize =3D NodeList->MemoryAddressSize; RcNode->Reserved1[0] =3D EFI_ACPI_RESERVED_BYTE; - RcNode->Reserved1[1] =3D EFI_ACPI_RESERVED_BYTE; - RcNode->Reserved1[2] =3D EFI_ACPI_RESERVED_BYTE; =20 if (NodeList->IdMappingCount > 0) { if (NodeList->IdMappingToken =3D=3D CM_NULL_TOKEN) { @@ -1135,6 +1275,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. @@ -1151,6 +1292,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, @@ -1187,8 +1329,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) + @@ -1197,6 +1337,14 @@ AddSmmuV1V2Nodes ( (NodeList->PmuInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING= _SMMU_INT))); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 5) { + 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; @@ -1340,6 +1488,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. @@ -1354,6 +1503,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, @@ -1386,12 +1536,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= 5) { + 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; @@ -1469,6 +1625,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. @@ -1483,6 +1640,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, @@ -1517,12 +1675,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_P= MCG_NODE); =20 + if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV= 5) { + 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; @@ -1589,6 +1753,274 @@ 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 3; + 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_RM= R_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 *)RmrNo= de + + RmrNode->Node.Id= Reference); + + 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 *)( + (UINT= 8 *)RmrNode + + RmrNo= de->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 @@ -1633,6 +2065,7 @@ BuildIortTable ( UINT32 SmmuV1V2NodeCount; UINT32 SmmuV3NodeCount; UINT32 PmcgNodeCount; + UINT32 RmrNodeCount; =20 UINT32 ItsGroupOffset; UINT32 NamedComponentOffset; @@ -1640,6 +2073,7 @@ BuildIortTable ( UINT32 SmmuV1V2Offset; UINT32 SmmuV3Offset; UINT32 PmcgOffset; + UINT32 RmrOffset; =20 CM_ARM_ITS_GROUP_NODE *ItsGroupNodeList; CM_ARM_NAMED_COMPONENT_NODE *NamedComponentNodeList; @@ -1647,6 +2081,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; @@ -1790,6 +2225,27 @@ BuildIortTable ( // Add the PMCG node count IortNodeCount +=3D PmcgNodeCount; =20 + if (AcpiTableInfo->AcpiTableRevision >=3D EFI_ACPI_IO_REMAPPING_TABLE_RE= V5) { + // 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) * @@ -1999,6 +2455,39 @@ BuildIortTable ( )); } =20 + // RMR Nodes + if ((AcpiTableInfo->AcpiTableRevision >=3D EFI_ACPI_IO_REMAPPING_TABLE_R= EV5) && + (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" \ @@ -2020,6 +2509,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= V5) { + 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) { @@ -2068,6 +2570,7 @@ BuildIortTable ( Status =3D AddItsGroupNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, ItsGroupOffset, ItsGroupNodeList, @@ -2087,6 +2590,7 @@ BuildIortTable ( Status =3D AddNamedComponentNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, NamedComponentOffset, NamedComponentNodeList, @@ -2106,6 +2610,7 @@ BuildIortTable ( Status =3D AddRootComplexNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, RootComplexOffset, RootComplexNodeList, @@ -2125,6 +2630,7 @@ BuildIortTable ( Status =3D AddSmmuV1V2Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV1V2Offset, SmmuV1V2NodeList, @@ -2144,6 +2650,7 @@ BuildIortTable ( Status =3D AddSmmuV3Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV3Offset, SmmuV3NodeList, @@ -2163,6 +2670,7 @@ BuildIortTable ( Status =3D AddPmcgNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, PmcgOffset, PmcgNodeList, @@ -2171,7 +2679,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; @@ -2256,11 +2784,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_REV5, // 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 61f6b6153f207b356ed26aabf8366c1cf632fd90..99d86b3d167b56ae4e0c22d292e= 6e33318e3c78f 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 - 2022, 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 (#91096): https://edk2.groups.io/g/devel/message/91096 Mute This Topic: https://groups.io/mt/92203104/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-