From nobody Fri May 17 08:24:50 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+91355+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 1657817455856843.6768056049715; Thu, 14 Jul 2022 09:50:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id hbLGYY1788612xjuLxmF0ImS; Thu, 14 Jul 2022 09:50:55 -0700 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.88]) by mx.groups.io with SMTP id smtpd.web10.9994.1657817453765146107 for ; Thu, 14 Jul 2022 09:50:54 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SuI6TtSqcyc3GnlPVYtRndd5bOhNVljkAcevCPI/y3s8zVa4sKNDQjRdRGSgrAcDCsFrY4yMSvx03zTOGcZtn34R2L8whcGYRZgSxd7480GvjM9tyhLutljxoub4GPa+1+U0XxKvZRldDKgNiixexBoBsgTnyXhTemAJJj70xWq+RBAtTp9+t3/o77jbntesv4U6z30dMbwG9jYDDkkr3A19Lv4weA8WtzlrHqBG6DbxD9cMH3bodf+ZFCXfbiNvy3QicGO7CqjszRe5XxN6bH6ttNL8ogGY8Zqfv10PBaSAeFO0yUWLkYRYdRSPclt16ktKRelwMhpNEzbdH4V9Bg== 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=Wr5Hqebondqbk7iJxtEwam6MA9zcuSUQMuiz8SYCVBo=; b=JCDxUUC1zLWkDql8kWCqrg8YrklUGK9YYT7b469KcOgqKgP7YZPk9PgBuo6e14f6au5ffjmJPZ0giPYG3OxPoekM+SRTiUjLH22O85UBB1q4fRKKmO1ODdRJSmmXOga4w1yDzA9EPFJeE1jzuSDoukPMU9lVf/fMOe7ZHA6GFUnqYV+QAZKshBBZDZV58Z4ts3cn9uNSkoSE96h8AGwRf/zB2aYO/o6qtH37lmKVUSW87nuMMEwvwetv7NhSCnOD+GbxR+2MIn8AabZ6GPLnx28W3B9Pc4iIRc92OITg/vUIha56SIlzcq6ij6vwaI/YF8ZoY04OO88vsKrVWhXzsQ== 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 AS8P251CA0030.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::19) by AS8PR08MB8014.eurprd08.prod.outlook.com (2603:10a6:20b:573::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Thu, 14 Jul 2022 16:50:49 +0000 X-Received: from AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::3d) by AS8P251CA0030.outlook.office365.com (2603:10a6:20b:2f2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Thu, 14 Jul 2022 16:50:49 +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+91355+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 AM5EUR03FT005.mail.protection.outlook.com (10.152.16.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:50:49 +0000 X-Received: ("Tessian outbound 8e3d5168572a:v122"); Thu, 14 Jul 2022 16:50:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1ddc79cff058b45e X-CR-MTA-TID: 64aa7808 X-Received: from e28f40d20fdf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F0B8E34B-C159-40EB-B18F-E723AB19DE9E.1; Thu, 14 Jul 2022 16:50:42 +0000 X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e28f40d20fdf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:50:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FSDK5VaH8GWC1xVI2jTPjzeCWproj9WUgHPgrm7wajl/QQVq5W5msRncfX0E3RZtu0DKNiGocEO1hASAqwY/b/yfiUJagNVHCVC0KwCsziBnTqIte2hO0HOsLB7SXx2JUYr/JaWQ1Gh3JmgwZl8TZ4itbvLsO0uUNZV+r+ejeIz1+oFrm5o0c9WnYt815ZKU1ilJ8gZ28TOF3TkbvvyQOJPdCWMKrBbTYVqqG3hc+7IniYrhnsvSUIxoaNIVApxThGxdNZi4qS4DkAY9ErRc2svK3x5A5pt4hFndecCSkbbGinTDtqVeOiacBa0KhmRcV8CF8LjYlyQa0g+Mnu/NMw== 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=Wr5Hqebondqbk7iJxtEwam6MA9zcuSUQMuiz8SYCVBo=; b=naP+d6aqJCChBTTzeVSaIpRYFH8CRGeY83nDg3H++m4LjwEq6BLD2TZ+TYaf7meVwkFibhTi55m5D6f8m+qIwOGWH1FAOjwHzJIdbgkrDgnIF75Hs9JCr30XOrczYaZZOupfBrGbz3yjDhLgaf0AKeTG2UHynqUSd0HQXjbrDJfvkTijBsGUoytUx7MYUDtlITsNXqI+FIQ85adfJK1SUZCuS7JUGV5jpPKD83WF8B3BcLHhurWo6fn0M2fonyxD97YEKvEsLt898JkCd728cPxWTqZ4kBfwAiWzMd+rk2sQHauTpNP3xMY5NgsBn25NhyoArwAh0bqQ+qz+u2nFAg== 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 AS9PR04CA0108.eurprd04.prod.outlook.com (2603:10a6:20b:50e::25) by AM0PR08MB4323.eurprd08.prod.outlook.com (2603:10a6:208:13d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Thu, 14 Jul 2022 16:50:39 +0000 X-Received: from AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50e:cafe::b4) by AS9PR04CA0108.outlook.office365.com (2603:10a6:20b:50e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Thu, 14 Jul 2022 16:50:39 +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 AM5EUR03FT024.mail.protection.outlook.com (10.152.16.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.16 via Frontend Transport; Thu, 14 Jul 2022 16:50:39 +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; Thu, 14 Jul 2022 16:50:38 +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; Thu, 14 Jul 2022 16:50:38 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v6 1/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment Date: Thu, 14 Jul 2022 17:50:24 +0100 Message-ID: <20220714165031.42640-2-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: f9bcf43b-8428-474e-f705-08da65b9016c X-MS-TrafficTypeDiagnostic: AM0PR08MB4323:EE_|AM5EUR03FT005:EE_|AS8PR08MB8014: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: 1hg568pAWGPqIhsLM2CRKh0wo0jKVp7l7TdvXZdB77kWSdb4Pn6Pm1dviYX/RMm8AF5C2oMYvd0mqUnkeTTBGSUHuSgPi+R6lGbU2lCx+HbPySbf0iQdM5QaitAjOBrvRv82yhic1V7rfUsXbFgRAE8q3d6H3gC3x+6GP4h7ul4vhf+vmpys9EfT374Iuwq9pKQhp2cK+0Tyt2S9euIdXZ2eAACGxV2/HKQGgAkQSggjX+v620zVaF3QVSllMaYGu2AtpPPLW8L8JJRATbXPM+hF9zFvSi6d0OacN0pGF40eraHhv07tYtHmlUd/70QGmcfESgMlqdOegDfZJylt9c98ul0WWhA0FdYkQoxnAejGTtCiwKHYbXdP8GZ4vBWfjkmz++gyry+rGzJZSAfxoq9+B2vmlkpwGUJT1MUYOcMpQCI7GxFitKixSkPf+SRwUBHOsc2DePSQb3LBCfBmgmG/RoBugGvM4y2ock/vJmVYgkAIx4sEEio9FMCM2n5ms0OVllvhlxZ9j0TrMZZqyp+6M7o4Q6RkndB2nAvw8FJmZDeSvJpUwa+sehCGmRYrs4Bl/Vj0t9ssEiZ1BueLZSUqVgipveDWPAi+KXA/HWZznHd5vA4B7nfGeBog4IjRJlMrk883ORqWJsqXQskOhz1GaHbm9c7lPCEWSanqu6p0hduwTq8pO6lACTjEmtB73H48Tf/JlcgiNSn2xeRVgZBXe1qxnq3qZ6obthTeS5vwfga8h0gDmZiUvtNpnLYdzNTE0rIodqj29a8w5RcXS5juRfsrDt+UesgCjiax9cGS5s7AJ3sXHSkJauyMYx6T3AksaoOaVPxBt7fv+I08iaDVH6hZqesBAXIIfkMqwCY4e9Y45rgpr/l/REXj+5MC 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)(136003)(39860400002)(376002)(396003)(46966006)(40470700004)(36840700001)(356005)(36756003)(81166007)(478600001)(966005)(82740400003)(6666004)(7696005)(2616005)(41300700001)(47076005)(316002)(186003)(6916009)(70586007)(54906003)(70206006)(1076003)(336012)(26005)(8676002)(82310400005)(4326008)(426003)(40460700003)(40480700001)(5660300002)(2906002)(8936002)(44832011)(86362001)(36860700001)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4323 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8e98c439-2683-42d8-d755-08da65b8fba8 X-Microsoft-Antispam-Message-Info: CL7uoXDkpOuBVA5oRRvHeBuzAS38+KecfvI7MoyKBsxwOUvuOHnihV9pB3qY6pqwRKHlmnYpOIJJWsnvqk7inh8wwfBNqeuxHBGVqNdzoI+lkBwZSSp3quHTXiNCdUxJP1FEd9ld2PhSyTxygv6xixugRTlBHdJp81EiwIN6bnHqsRLiTtFPh2gts4CJJ/b8wyOG7xHD8xMOFNODX3hnhYdYiHcLoV4jTulQQmpwp0J8YO7vFISgjZm/1SI+L36m53nU7fgNg0ZQG+POdQVe2VU7X79pOdV0GXfjVkT0iFjQ+OC1SOJLvXXP4U4l5nKOHB/2sVDwvCGqwMkkHg3vT0zOY9aD5ww+eUaQsktSKSZ+8rBF1B+Bo6Hm/o0viebIgbRvqm8H4Zg387bZTGYYSL2esI15EJtb6nxlBxwVjsNVhBdjPvsKQBATaYbHYeJBrfVTQO/EA+BLZf9yL+wGHdOqzJ5PAJKwrAOSFN5UqAb4JGrLirNPjvVpb1YUmrh4UN5LT8p+eag3sMPUTahaIgMdx2uupdr2/eFRogstQRiqIbQ/AtrVSj51W5b0Nhooh3RpEL/RgtqO3TcB/rXsEq1IWTCpjIgS6r9Lzac35AQ+HI90MSgFLp0IO+gGe9XflFgolVVkONl2jnnN4cA6maMBAFGzOWY+i//5k0TM8bgzYfeu/kHqTgxDMCT6nfgL/5aaXI7LcVSS1YEy7FuVc/DeKqOJmgZiQzVbDFTeNpVtYVSezYT/++/vbrQP62gMzw8AzQZxgNBuR9ptm1W4vpZLWYCtvK7PPp/kC5IMZJg5J3IVyQMWrBQtqcL7RTmhuL/lMslbETnxFvkRDDlcCwe+zSZ08rkfYnATng6qCd8= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:50:49.3151 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9bcf43b-8428-474e-f705-08da65b9016c 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: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8014 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: qBs1n3tazpbSxQsvwOYsHuiax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817455; bh=Mhoi8rR0KQ3DqEKJhy9KJ+X9jDlAs+RzNy9l94rruoE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=i2Y7IhSKHTNDwLNMUf1yhjo2LFlumZEEvezXMWnwu6vmxiPuaH+/xS0rsvAd37zOTw4 A497bi1T6ASnLXgOLq4lJEksiRglztDOJsJaaCcazF6ZnApMzEYL2J25g7WljGUtG7BZ8 AiOryuJpltSPZax8tx3coXb79Yq3gb3B/BA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817457624100001 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: v6: - No code change since v1. Including r-b and resending [SAMI] with v6 series. =20 v5: - No code change since v1. Including r-b and resending [SAMI] with v5 series. =20 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 (#91355): https://edk2.groups.io/g/devel/message/91355 Mute This Topic: https://groups.io/mt/92383458/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 08:24:50 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+91357+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 1657817472524657.6214838874517; Thu, 14 Jul 2022 09:51:12 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id aHh8YY1788612xDOS3Af7YFh; Thu, 14 Jul 2022 09:51:12 -0700 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.72]) by mx.groups.io with SMTP id smtpd.web09.10075.1657817470875482881 for ; Thu, 14 Jul 2022 09:51:11 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=X/bWXstvRkgMZ0qmYErjv0f6ikf6MHH7TQXJ8tZr9/ByCQXhsKHUAyIoqpL/KTMm/yqzwDmH54nEtqyuq5yXV6wralvFEASBcRZ84xbFX0133RAk6TvaakcdVzpRx2OByziKtZFxoMuXtyroqeHifQonVVPz3gqw9ahEeb+yttGUAwwo6Gz0QvtWii7YGNXzmzoxM8fam1vODR9Z2A0Cf83IJILMYjy6nyDeCzMP8Dpjn1pHj0UGzFrWjZiEZ8X/fBkwS4vxIZhjIIVzeUgpkLG9s7oaWLpEJcRSN7hShfnwzceRIbOBlUXAOVKBMYxsgUR22lGzxPCm9elgPlv6bw== 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=WX2Y1ZqSUmM6aD2T4+clUSFiX9pKqdghz2S8+tuGMRY=; b=Ga9I1V1Jgjc+59yi1p+I0v06IdpyTfld7JvvaVHza8nc+BBlYv4A2duwPX6KE7KqH/wa3UJLMsm5Qu/4zHZUhm4DeGrHv3z/0I8G1F6EZNUEeBpzCKOZ9b+TU23k/nxffR/p4cwC6RVyusYUJPHCNd1Uww4Jih6bOIKkhdiGlx7D1TRn4dwCyyaEmapQzx1hpFRzKNNJ/8/HGUMPOMB+7Nkpw4W6hmGo1GSnxqDvHcs6t9jKK+F4kfapiqznK83y+Ugs1vhDw94+VB/4t4MItSfcQ8DqtCsdVP7KPAgi5FE8jlN7KV9z4LJ2eWepFRVzvEbNWGRiyo2dBXzPNppdbw== 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 FR3P281CA0145.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::8) by DBBPR08MB4505.eurprd08.prod.outlook.com (2603:10a6:10:cf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:07 +0000 X-Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:95:cafe::37) by FR3P281CA0145.outlook.office365.com (2603:10a6:d10:95::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.7 via Frontend Transport; Thu, 14 Jul 2022 16:51:06 +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+91357+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 VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:06 +0000 X-Received: ("Tessian outbound f9f15f9daab2:v122"); Thu, 14 Jul 2022 16:51:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ea99905d90def7d5 X-CR-MTA-TID: 64aa7808 X-Received: from b949913eae76.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0886CAE3-848B-40CA-846C-6110AC3D43B5.1; Thu, 14 Jul 2022 16:50:59 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b949913eae76.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:50:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edSxz4b1go2kvK9l8mnc1dpOq3GyB0SexUXkAUsl9tOwWWGPABp2UCN4eaniXg8f/ImsXjnQCQrlqR1/QuVqifeQVTPp5md/ryzwmvlDBZ+AnebpwXIoa239+x0Ua0ccZiycVSalRBgHXXRlwmEitSEKjHzzLWdaWv8GO2C9x3wI9UZUrTuPL1GQcFXQ5ejVJOpTlQkf77sgZ3n5Li2xhXjHajxALKhUla+nczGuM0Io9aO8tX47lYAmN1jwpkwjXKB/zYkFKrfexqgc2n8FWesFiiNuZbXeHzmPBIhTz/VPBlQnu6U3FG1GKv2HIJS+wtTwQAH7jdW8nQFoSnGofw== 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=WX2Y1ZqSUmM6aD2T4+clUSFiX9pKqdghz2S8+tuGMRY=; b=OFhjKtT8OR6AWp4CD105bJmDGI69AmPwTeVAjtZRTJPQTc2omODeuACukB3kb7RapqbSDb/tAnhUTl4Dg55LUmuRZbVK6VmODqia503/E8G72xjStbg5sgJZkTK4f4XqOOmFB6p+H5kOWgl1VW+FKsGusE8vqh69Z0pM/JOujSg4yPQXtiyqU+vlpaCggeySUlXUy60fwzLvU72YfDKzdWAWirEn5HiIvJ1r8MVyWQH2BiVjDYS8Rc0CMoxyKGhXv37J0sVhAMKmsggViAXWNnJDvf6QWaUkOeMTiL5Im9C/6aMIvhaRQs6ILhBS3iU66Ruil7CWuH33O/XpXUui1g== 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 AS9PR04CA0078.eurprd04.prod.outlook.com (2603:10a6:20b:48b::25) by AS8PR08MB6901.eurprd08.prod.outlook.com (2603:10a6:20b:39c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17; Thu, 14 Jul 2022 16:50:58 +0000 X-Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::a8) by AS9PR04CA0078.outlook.office365.com (2603:10a6:20b:48b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.13 via Frontend Transport; Thu, 14 Jul 2022 16:50:58 +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 AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:50:58 +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; Thu, 14 Jul 2022 16:50:39 +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; Thu, 14 Jul 2022 16:50:38 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v6 2/8] DynamicTablesPkg: Handle error when IdMappingToken is NULL Date: Thu, 14 Jul 2022 17:50:25 +0100 Message-ID: <20220714165031.42640-3-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 2b20d0c8-4712-4408-a3a8-08da65b90bc1 X-MS-TrafficTypeDiagnostic: AS8PR08MB6901:EE_|VE1EUR03FT044:EE_|DBBPR08MB4505: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: f4/KAA0EH0ao3ljcJ6eIOYJv/pjXv709lyRyqkTiHLpTyy1H0Guy1ocwlXu5Vb4JHNU5DPsWrSwLrqi8s2S3MTx+cEfJE/39RW/tea35HpY0tNr92X+TEZphIWFri1fB26javMtPu9I8TpfhkO7vDWYJaPiIEFLp/5QWvrkGhf4p3XhH5FJWAh85j4Z4uOt0t+eiIwdAzMHRMG0riNv3z2w08awpBv+QV833SJ73gykMmw4VuOke1kP6lQebR8hMzH+6mfmhgu7e0ljXv25A7facfRl4D505MOCzSxmTlO2vItSuk+EJ13aP0TOFUMRG5daihUy3HzB4wt3aIUEnSfvwau/k+BnPe9oJS/t4R652uiH6ZUFzHpTJni3qf7dzVrO1Gs1EWxkwn6fbmqe1O9DVtTG95OEW6JA1TZ44sFsbKn1xrmziwIFxyl3HsQ0XEB+6Y3rjUi14u5krGcZg27RlUSfVSAXrrBKlKwnhGa6Wd0+IdsZf8JtPltD7yv+6K9rqP8DEPLbrC19nyy7g70eF6y1ks8shu0bcdV8vZ5rcesLFb0bp+gDDr7ElD2htR/CnpuNZ7ouGj698/FHkZn4JWm6t7Z9cAAvWUtDd8c6HWEgPYrfuvYSMwAsLNiKetd8hrX3NxxgBPIveQnTZ8R8FWYF9f7pamdZ+mz8JYdjpT8fQCftUt4/rk8116uAehg3Xb7HS+KIlr2+rqMseUkuLx2AfoMq+8czAFw67NkN+YK2VbfPVo9w+TlVYuQZjfBHrE3dSYsD+jDJDN4GgtROd+a3096ELm3bSHxJ1AuwVaYI+AFJFPd93krd5v5yuTYq2PskA/f7tP0bbD+2A6xtWqNjePO6k67VI7VsPUdzXMUm25ApNFW0ky9mf3ONeiToJ5evWWqMl4WiuLYv7rXec4pWF2qZvSSdQWwfcaEY= 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)(136003)(396003)(376002)(39860400002)(40470700004)(36840700001)(46966006)(86362001)(40460700003)(2906002)(26005)(478600001)(40480700001)(6666004)(966005)(5660300002)(82310400005)(8936002)(7696005)(1076003)(41300700001)(2616005)(44832011)(8676002)(47076005)(36756003)(82740400003)(186003)(54906003)(81166007)(316002)(36860700001)(426003)(336012)(6916009)(70206006)(83380400001)(70586007)(356005)(4326008)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6901 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6de88e3a-270a-49c6-1d61-08da65b906b4 X-Microsoft-Antispam-Message-Info: EkqYFe8qFL5naYczCXp6Ff0E5lhgFsmvk9FYeC8BqHVETpWGwTdPuma5QT5laZezqRQVLr7VKS6Mwhm51R/3ViquVyf8miM1bLbiBFQcTcRrhFaJ98QmlGzKMLhIjupeSreYrgMAbhjKjFsZTCt1Il386I5mkI7+36Po3sQwJtIkK5ICXrVBDIMhL7xdSdkmaydRqwdktD+et8BsDHIKHNp67pfJ/EvZjSkmRqflyWVb0t88wr3e5Fw5K+nFhd5edJaN7Uy/oEYYzTRF0yktPA3uW+ErMGeKlP70mrr7Dvt1xESctyq9YsG6ypsR0I5J1GgAWTJEi8sxmCTelqFSVbFt6NbmSIJegXe/MWXK24RonjE7SryRsM3RFUc7dKP+3b+kS+PzyX43fRIdeVlyMzSSsXGhcJbOUVw6HZNVv3KmBnxAPAL9ky61q4tkgqM9Jg6NGx5f+MdwfVibu/4O4sc6dtlOJzbByNtZ3K83WAGyGSzEhF6Qpp7Yqu8ibqWQNBXFs9AHiZjSjojDT+tk+VStGSgD1csKAAYJCqciYEpTzrjAnU/GiMEZzo2cZz6dejvQOr3Aa6o9WU/zOU1tyYZoKwK4VbdhoFngTQiNfQpmohFTmvmGKb5EZdroZi6bgKvmNC1qBG4iOxlQdGaTXOhkCmuBpl76tgHjATyEHiBYQfTdwYlTH0YLqKrxTHsJUNaj5SrQQEjH0DNYp1mPVfp5ubv3KQ6R//zh0Ps7Uf4sbYlUixXO91+AhPzd+K7AcriI/SIwfIkI/jP6W9WN+aW8EVKB37ITOYvzIUHhhEIafHhD9HikdiGi3udB/0Kq6lnD7BCmvWQBEB4jb/sJLmMRfwTNUJqq6PTTBttbGRUOVrS4gCoXXnbEhSUYiXzx5YuicjOMl7M2/3AXYdTBQA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:06.5847 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b20d0c8-4712-4408-a3a8-08da65b90bc1 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: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4505 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: 29FRZKUhGvaDoIHvCidkwHDjx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817472; bh=wus+PAPZCM8bnv8h2I0shHLvIQDXEoElay/PtGCCnfI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=tRfftvFppyfsEflsRA1vHP6LGWfWyZFpy19f2AhUckhzPmzqUdxsioo3XwruZn2nY6G fDItYpCOMvGuXg+y1kAUcOPggCD8GH576td8i+JobmfFOs8I3lq8WCc328Ql+26gd49c9 octy1u5zkFA3zqYBy+gsmFSkD3rbf5MuquE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817473626100001 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 Reviewed-by: Pierre Gondois --- Notes: v6: - No changes since v3. Resending with v6 series. [SAMI] =20 v5: - No changes since v3. Resending with v5 series. [SAMI] =20 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 (#91357): https://edk2.groups.io/g/devel/message/91357 Mute This Topic: https://groups.io/mt/92383462/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 08:24:50 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+91359+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 1657817476452581.7976847518166; Thu, 14 Jul 2022 09:51:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rtOPYY1788612xkHZALx67hW; Thu, 14 Jul 2022 09:51:16 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.74]) by mx.groups.io with SMTP id smtpd.web10.9999.1657817474727756330 for ; Thu, 14 Jul 2022 09:51:15 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jg6bmrtXLzzLofn+v2EwxfPlewdAYK5zGbRuFwZDTUQHXS4XLHiIotA8vZzlUS4town8/6Ao0SZpMo54GkQZFalipvwx/aYEA2Qg57QKdt+FCYdXhHGxFiMJ1IVlmIhh7VYDMuZ2Mvut/shtn4cjjedTG0efdPyn1GXrG1jZjxC8tqFlO+mbTMHyB7odcOCnR+92uvwUzjWPPJgPqfHjN9mJYwDI8LVED2HyzLd8cewRJIW/WZYSK9bhj5WDTstOklwIWd263YTPMc/EYsFNWxtuR0iHrf5KOea/jnhQIo5ih/mFO77UOJHKDxPSU1ouMrbIamk10tdxSlFVgKAc3w== 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=hYBSszMBHXrSHp9sCk17+IBGgWviSYGM6cgKYkTa4Ts=; b=J57jXLze2SdDKVDNkMxi1Btau1VNNdPaEKRjWAi52wsEguwQNcJ0O9Y+SIJulqUJR3/AjhrTVwfHppVu+xLplG9mOxREkUcC4HgR9hD2DkYTWKvWujo+JV1XlnkpEHN1H0YlAT1bWTe2jGPjm3aXedky+GGnHCoQd4N/pg8IuPfVibnjLLos852CfWEdXap7qWyOVbvDdZGvG4mU8b+WGM5mMn5DBA9BAXQ15g9NJ3Uif/TNnKp55830s6wFefWsyS0LbmUA0uV5uXe5dM290Yk1DEbgEvb/QgwTnzLhjawpVTFUcQPlPx2rHkRCmC2XhJQ9+Hhdwb1ORmhJPgWVOg== 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 DB6PR0301CA0054.eurprd03.prod.outlook.com (2603:10a6:4:54::22) by DBBPR08MB4267.eurprd08.prod.outlook.com (2603:10a6:10:cb::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Thu, 14 Jul 2022 16:51:11 +0000 X-Received: from DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:54:cafe::2e) by DB6PR0301CA0054.outlook.office365.com (2603:10a6:4:54::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14 via Frontend Transport; Thu, 14 Jul 2022 16:51: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+91359+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 DBAEUR03FT025.mail.protection.outlook.com (100.127.142.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:11 +0000 X-Received: ("Tessian outbound f9f15f9daab2:v122"); Thu, 14 Jul 2022 16:51:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: cd350669e0271ba1 X-CR-MTA-TID: 64aa7808 X-Received: from ee1a3bb51f94.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A0ACDF9B-4949-417C-ACE1-221CAA279A7A.1; Thu, 14 Jul 2022 16:51:04 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ee1a3bb51f94.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:51:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVtS6kX9dD8hYFJEHLrV0YORLlxJobVXzi8/BDORpK+kgh8mUcwUZSbd760GMc7IzGdPRPo/z9s7os13o2jCHNd/DJECHZNwi57JT1bAsNRA7pQjY/oCUvniD1F3GO83k/Xzey6IyOVmChaREqGF2BhcjFLqTNp8w+tXUtVorSoYFSygfrXBuKMPEawa7KzVZ04tB5qigqr1atk1UAs8vTFO5RYbVfb42HQ0NeQ/bGgLkjsGXgiWFu+rssayjXXycorGB/4pzkV0GtT0gYhDcTSaI2yaYP+tn0OmGCHFEuh4xA4htYn48DrcEN2QCfhZuXdC56u5EijlfnM3DrOa9A== 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=hYBSszMBHXrSHp9sCk17+IBGgWviSYGM6cgKYkTa4Ts=; b=EzRxuIFfHGFTQvgz6R1D+cYJJIfQV1PGO42AhztJdlq8+wO9PX+O+5b3A6X4sNHB0iy0BbPj6+7B2HOBAKZ82iVgT3BeNpluIC5Pc13G2ciAzq0VtNhzItVabRPHtfHCj9zl/EeiB2VtTCeVePtY1hwOLSlZ1YLHAOitJ503+gAU0mOg83EFTDMvlY4wer+mdz0qeVxQul7ywLJpIyajKa5qJkQN6EpCSvcUEdiPLVIKrVaxbiJm6p2r2INXWoZUOuH3K7utjNzHdAYrZjBPAFwh1iWbCgHOdxPO6YhAUwMdAVHOWZRGgWv/2rSHF3sfT6q3xC1uaVWOGr7jQ1sX6Q== 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 AS9PR04CA0075.eurprd04.prod.outlook.com (2603:10a6:20b:48b::24) by DB7PR08MB3147.eurprd08.prod.outlook.com (2603:10a6:5:1d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:50:59 +0000 X-Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::46) by AS9PR04CA0075.outlook.office365.com (2603:10a6:20b:48b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15 via Frontend Transport; Thu, 14 Jul 2022 16:50:59 +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 AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:50:59 +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; Thu, 14 Jul 2022 16:50:39 +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; Thu, 14 Jul 2022 16:50:39 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v6 3/8] DynamicTablesPkg: IORT set reference to Id array only if present Date: Thu, 14 Jul 2022 17:50:26 +0100 Message-ID: <20220714165031.42640-4-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 2dcdbc67-3ea7-4b2d-043d-08da65b90e90 X-MS-TrafficTypeDiagnostic: DB7PR08MB3147:EE_|DBAEUR03FT025:EE_|DBBPR08MB4267: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: s2iCuEhUKAZew0OQctZ6iSNammHrlrJF0lzHjocL+FbeSGtM8kVg9k1hBQwjOzF1zs5vpJ2svsdJD/VA8nbPPi6W1u780rjOP/8hIgrh77Ex2qvOcVPDCF5JhS2ZPDSu8KVPhySrLQ0HrAnNuTvIrg3O2UXRCywGLiHsOTHMHyDtb4gVq/N9i2ijnnbwHmnHO5IfeKFHbPvSKs7D/YogIIrs7rDIDOt8OiXp4YzE8p7TuTGyS242DRxgsKIPq7NjUgJa0hzkDqKGP4naBPpR3GbWjZvFziuUyEXVA1tHQnbTnOcyTwk8uZjMfnCUqBbWGS8V55wsYVRrAD+wNTjLg3bvMQo4LvIgpLRtCtkpa9MsJoNDrKqKGOU8eDq9Q8TjU+/zo3FccxHUyAdPH89zm+ZY6Np4jrvSV/SuoN/7doa+nyKHtSF9zH7rmdnFzh+0Dze167NEcqau7c/QhABiTJ9Qr9JS4jEmNR/3GptbdCx6t+ZQ/L+THn/70b5qagmnn9upeaBAd6kB5d7jq+IxieWHIdfedApJKsfhffRVs8c5kmcmSYWv6CyWHJ8HAaytwDTMRjqxLHe5eRrpW6IRt81fGS/XdRzr6m8A7soUou7ulVqkw0TlI+S0d1w31XTHaxx20wfaAtMDU75H/4aYEa4cpusRlnSolt6WcK53pjlZzu2+A0AfzaRx376w2sqHYWcE9MpV8PaALUzX/zVvJGLvXLFSFzaXWgKKZiiU4LI4dCy1KHkxOu9PU4ZiJJCdQGy8CkFn1tbdLQ6uJwEMI0vlhazSfsOw4Thc72jEhXrm4TpaCk5SXa2+G9GdynaP0Yiw5JvxSY6xeqW9srblu0EzC+GgPKLyRNqpeJRdiC8= 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)(39860400002)(346002)(396003)(136003)(376002)(36840700001)(40470700004)(46966006)(40460700003)(26005)(82740400003)(86362001)(1076003)(356005)(2616005)(40480700001)(82310400005)(426003)(2906002)(47076005)(6666004)(336012)(41300700001)(478600001)(7696005)(83380400001)(44832011)(8936002)(186003)(81166007)(54906003)(6916009)(316002)(36860700001)(70586007)(70206006)(5660300002)(8676002)(4326008)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3147 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: df06de4f-c53e-48d1-f241-08da65b90784 X-Microsoft-Antispam-Message-Info: DZ7dG+tHqwLis01sm+LmGPCvw4Z4xOXonFc7Ofc5q2E8sFADMGfiDbR/gCTeg0/a+UrW2tnu+1Z0FXUbqdUGX2nlhURv7DzmoYp5LdZRynD3cyTWz4/tEbvMeAdep6HSCfP7Jp4JPO7BHDLW2AZRY2HvmhfTmjryeJ3hBoKidZ/8Xsc1Vd/da7HhbB6kjGLgleddhdqkmlwdGyRG9/aHKhEhJJAYpwPQxUF1sF2krJKMZgasoAlzJmYHO3aSTsDdjpqDmiISd3CuC65FvvpXQJw667uypSGLvTOHrfVsQq1IWpNlhJEpsXhnpvcbP/AA+t/fuzPINOwbusygzeBCLdg0FJar0xfJBc5j2a+fkZSdgTsJDNoyhTp5ijrfwqnaZgt9uaKk3b1E6tj7jb9KMYOp/cHuAsWFic1NMXiivpJxUaX/WuSmMG4fZOK7IBuuKzRSzR18NBTJNza9EmzxG67fzoWUAgaVeEOOPNuBx3O2ZJbC3dvPblOxdqilkq2TDViUMhQwQXEKe2ADQaYfPisEf0k9PBVcL8EEeSeXxXR6jQ8W+hKCHs/k6+MZKZGTpIEZ8qFVC5UEa39P517HncUSNnK1gVRafFjncuLo+bKboDlUU1AIlzqiG4EMJyQYkwp94rtaPmCTU63tRwBCa52O72Zkbvpc6cQW4T1wjCth0XJfoXvzDXfFKRKXmhnnR26PBeBs7Ho06Pu7xaWnmgZqZ3uWb7Fv0T1vxHU4FqMetAl87t/U0hW4iBMqmcQ356KulnoUaVjZjOXL86xLRGedC7+OHsiXdQQOYlPlmGS0bksHM5jZbrbEjvIFH7tQ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:11.3864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2dcdbc67-3ea7-4b2d-043d-08da65b90e90 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: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4267 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: 6b5omHJIJi7HcUQB0viryirEx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817476; bh=g6Tae94eGysdidVWelS4WqdUZQSGUcxqcVa7b8mpMbY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=upVLXVriYIlzt8zsvDztIDdBuNvO2JS72uZE/EkcMQzF1bVdrpYs5FhCqEfepa4dzkx tCfv+L50O3SQSmcC5bNp/rmB2jJ/H337dqcW1WvlGQaeUCAWOWRhAv0yX/XrjmLZbZ1AS M50oobUiriMzE44d9rPztwxl17uj1vSpewI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817477616100008 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: v6: - No code change since v1. Re-sending with v6 series. [SAMI] =20 v5: - No code change since v1. Re-sending with v5 series. [SAMI] =20 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 (#91359): https://edk2.groups.io/g/devel/message/91359 Mute This Topic: https://groups.io/mt/92383464/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 08:24:50 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+91358+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 1657817476058184.0992164078283; Thu, 14 Jul 2022 09:51:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SzBOYY1788612xKCdJF9JdzK; Thu, 14 Jul 2022 09:51:15 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.55]) by mx.groups.io with SMTP id smtpd.web09.10076.1657817474618633439 for ; Thu, 14 Jul 2022 09:51:15 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Kt4IRQA3V2mJQ5dOt8z8JNUFxJUso+apsOD/Eo68vc4GEeAcYtJQwKNhTNFU1LnFc9T8I9w9Rn0U0Ou3XIENja4YpiYgwhv8oco6gCBtwZMaMrpXk2VYa22Uhr20F93gbSDr/BmXKCAVtCu6t/zqDrKEUIA+mEsD17KMEE/3hqfIOcsw3SgNxO19pGlR5A1cXv+3BDi9nNZisvEBqB3pKVllwdG3Ed2vGc8KtokiFMyH3hz4KCT+IdiU3Yx5HY1v0tFR5ZGEVtnZOJYhzLPSGQ6kqNChkTSf/iIkhtcxhWtcMVPhIDcRjy230meCM2Smx8FpkXgKCrnZmhg9EeeO6g== 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=gU5JL2XOPtur4rERWAhMKPiKU3AOwmlQK2H9ftHbPYY=; b=U0RX1dkTYib+JtI+SUM5tf8o7sMQSEi0UbV9OSRuiry54WuO8MZoUSgBDsslFWq6BE74BRVVF9hlekiz48912wOUtDLRdxyFDZrd8tyb5xX8ePQsGjK6+RS6oQYbI1uhU8vXDXHf50Bedd72/qSwsXu+LPFNFVAy2U10SEqGG4HfU3O/SA5aP7vmfEe4cEV21Y08tzWzmbzf72uLuShRjtgmTkGz8AVgRXr7kd09iCTqe/ItGMcyfvB7XRsZpRvUiH1kfUMRxnDyhh8yXWWaB4Jlwg7BVbo/ldbXdNxOJ36Vis8KQIuXhVJHY6hlfSaTSK1gSle/p6Ro+YxNc9OJeQ== 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 AM6P194CA0046.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::23) by VI1PR08MB3775.eurprd08.prod.outlook.com (2603:10a6:803:bc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:10 +0000 X-Received: from VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::e8) by AM6P194CA0046.outlook.office365.com (2603:10a6:209:84::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:09 +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+91358+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 VE1EUR03FT010.mail.protection.outlook.com (10.152.18.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:51:09 +0000 X-Received: ("Tessian outbound 8e3d5168572a:v122"); Thu, 14 Jul 2022 16:51:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: edb10a8a96e3e762 X-CR-MTA-TID: 64aa7808 X-Received: from c512828814bc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0B833390-DF7B-4307-B733-4FAD7F1D5EAD.1; Thu, 14 Jul 2022 16:51:03 +0000 X-Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c512828814bc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:51:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FAaClkPiOuzBbBcbpVkez3GhUl1i8oD8w090m2YBeIaiL1gxgpKxVNAs2ewWUT2JrSYTHCDzn6tDapOPmWwbE+SP2EeFln8LJFNTCWpyBJJQR+z8Cf1GW7MHVaEkQJ7OgkQkjZBjAsS0nVVaJb8r2nG4P2fVgs8KLqPHYMwZ/SrcT/9cR02mJss4efSFzY1zyf0p7E5NLYl1xY+P02l3gQx0+v2DJ2wMiP10gVp0szRAiirh+J7PCKsQC9NmkAV8hEPXC1uJevEsHJPVoHs2dbtuPpv3lijQZ49pOWz+/BOLkzefN1kWzLLEMiooucFVSce3gY/L+zQDL+1RrYud9Q== 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=gU5JL2XOPtur4rERWAhMKPiKU3AOwmlQK2H9ftHbPYY=; b=dgJMX2f4QWROvvEzBK1iCD/VPN7CEtJIzAnzo8wfon0iFCfmsC/Dyl296BGoQ9ZzmCPEWQTqlDHyhnKjDIMjdN8WBo1stsZ1o+kyk8K1FQ2yIOZ8cr8Zvz7DVld+NvOGd9/dwfdFer6LrGOv89cnSkLlPWfRGmM5daP6FsOa30i9DiaJg4uxKTokQGXvdnEKdNT5fCu68HPB/PUwAuK4uMHt0ImBmqNjHjZ0F7zjYtKxCDJsbC5QPCGBxLpL8KafdYweVCxFoSL0fv8Epg6VyLnFu74omYf0xJ1CSruW7kYer0XSM6smHqHvo3UH/p5Ns4Ndh81q4oHrF8FhxkwMvg== 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 AS9PR04CA0082.eurprd04.prod.outlook.com (2603:10a6:20b:48b::6) by DB9PR08MB7163.eurprd08.prod.outlook.com (2603:10a6:10:2cc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:01 +0000 X-Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::91) by AS9PR04CA0082.outlook.office365.com (2603:10a6:20b:48b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:01 +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 AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:51:01 +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; Thu, 14 Jul 2022 16:50:40 +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; Thu, 14 Jul 2022 16:50:40 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , Subject: [edk2-devel] [PATCH v6 4/8] DynamicTablesPkg: IORT set reference to interrupt array if present Date: Thu, 14 Jul 2022 17:50:27 +0100 Message-ID: <20220714165031.42640-5-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: fd42b15c-b816-4932-6e18-08da65b90d91 X-MS-TrafficTypeDiagnostic: DB9PR08MB7163:EE_|VE1EUR03FT010:EE_|VI1PR08MB3775: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: qPTnR9aI2wmv7rwOL6SLUeAJIF9JGlmBj85ShIFokUwXT3T/7epWkj+iOKUH7m7reqXI7243qRSS/9KUCoIzDjEsG2Hk6etWtuD94+cnUsURM8HfVnPwUSJSUL+4ViuJX/9wop+x3G9uFGVutceaoQjCv6sIc5XXxvuheaeGXykKjKUkLE3LurZCRBnAEKkqNt70/qx34AuPpc1nSM0hyqUJCLBpesBP5JUvcHXXUnf4mM0Puam4nv8LRnlb/UN+4doVNwVYtlxHudjfKpIJwMCrfnFVsTDQcfioBoSVu/WYVp9OyUUYK5pnNs6R4++itXwrzFyHAdT6SKGanxstUdoNp+0y8OFLHQ8FSTRwBpmVdiMuxZcOT7GA+vgWo9EDyVCzIVb/rHX0g3mHB0lpwy5/IAfZSrnjyLXpxyGNw6cboCP+6yfld2ZE8ySVDLSRrzRsQdBlrkBQ0Pn5HuoID6Qh1d9TOI88Xy4wlOjgTTLOjL2cPxOptwGpHZq+XAUcaIH8wCOJHG9Ga3Zsh/eOACjZtH16dXqhcq8jd6Qz9FmZ6SHRMi6ARS2aJvKsKn8VNuz3YZB8I/UrV5ZcNvmbITqt0kyHIQkV3aUHY9+fmTG+jiQCumfyUrrU8LIKLVbKsWovuTxABYWglJ1YMUm+VhjkxJ/p/dOs92iQJ2NwSc2pLR3MXfmTlD3DWlBfw2XWhKATG8CbsEXfVEWU6XUgt0uTvxJ7f17ji3QbJnCHp2vrDPhZsdI4sImEgGr5rPra0Owcew5LflB6WFQJzms8G1dxX4216t0l57zKgZDwxNrFMJXObVEpIk/xay8kKCcCzwtngYdUfMu9UN88p3H2/HWx//QcCoth4VLinXVkPBBOKJDtv1BsDkYOvPAP/fvU 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)(39860400002)(346002)(376002)(396003)(136003)(46966006)(40470700004)(36840700001)(81166007)(70206006)(70586007)(1076003)(186003)(8936002)(5660300002)(86362001)(6666004)(8676002)(41300700001)(2616005)(4326008)(316002)(26005)(356005)(7696005)(6916009)(54906003)(966005)(44832011)(478600001)(47076005)(2906002)(36860700001)(336012)(426003)(40460700003)(36756003)(83380400001)(82310400005)(40480700001)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7163 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: dde0a852-dcce-4f1b-848c-08da65b908a5 X-Microsoft-Antispam-Message-Info: lazRqw3vQYFYWRzl+A+bu5ZswxZgg9Rx6YI11p78uFOw/HR9Qvl0OZ7TfPNb6KJPxkd6pu2OpS0a2LgpE8xHk0bLSx04grPOJ4ih9IkYNT8ei8WYt60akkwp/Yzn875879iufOoHkj7yG07z00dSqcQS0yoxfs9zRmzkFE4arFlblp/B2vBvV3hS24wvJVyXCrU/BoE7qVmgSZpzCxqZ9aBODCMy2vfdP4FYVWFjd0mOXZmptv8GzCwrDUYIWizUAuNzj+OmkbOv4qlzU//AToFCA8xNv/lzCXKAtWULybespEaJxji02pejuj4mL82HnavSXtyiH6FoPMgQ/uhhTK3MO7tZeULo3KTyn0JEu7r+LdyiJVBJ180jKFTEnPga11+BCOW6l2uPqz8wY/LT5nG75xcuaWu3iVqKmWAUbsI2b0cp29P+oLpA+KgGsvlp5VZzEeMGabMNdZjhzNXhDxjOOAOFws1wjdAPM8iuAkQTNUZv+UElZeowQMZJDFhAqhhkf1AlsHnPW2TSlGVNEKQ1nPefKbqnoBhUZlv6gHx0JXWhovNcF2ATBxf0wNCVmqeDcOw1GCfgDkiLZ5SO2FinRxQJ5/vu+m7PY75Q78E9XfPfqcx52SvX/q77Ds/4J5sjy9oEjFGY2Ac8DWFQcb4/2TP+AY5XOieD4AxIDPbkdtDv96kb2y+sLtHY8EDz3vDydV/4itGXfyhQoqa+DRnE953eQmoo2XoXz7EEIw47GttIC+wjNsyarSe0PzghvPupdRta78tuNBTFSQLNtOCmzhkQZ46ORtclVBFfhLudbvp4Jp8/E/bbyw9/9AqyB7WOQgzNPKMP4rL8sohStp79VQgU9NG3bdl4N2j7fGE= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:09.6242 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fd42b15c-b816-4932-6e18-08da65b90d91 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: VE1EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3775 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: 5SD9o6wgyLJEag50dJTxyoRgx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817475; bh=Gbt2HH8Xwl2PjXRhK1sTR0GoATkTwQogng8yd/73Jnw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=bt7Hf5EuKNM1Eol+B+Jr851nBfsHJzE4BKBKqnJ7SXCREgk+oqhiXPltO+PYdxHgm3Y oBTmkD9TVwqloYz/2HdoG8uV4Mre6ZEYASduWGvSafTI9k7WrnN6tIidMzH3i/25Pmgjh N0UEB1Sf60iU6eaD3i2OHZLj/oLBjpQFHp0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817477596100007 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: v6: - No code change since v4. Re-sending with v6 series. [SAMI] =20 v5: - No code change since v4. Re-sending with v5 series. [SAMI] =20 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 (#91358): https://edk2.groups.io/g/devel/message/91358 Mute This Topic: https://groups.io/mt/92383463/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 08:24:50 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+91356+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 1657817469088668.2805726600744; Thu, 14 Jul 2022 09:51:09 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id U4raYY1788612x3WchioIa8P; Thu, 14 Jul 2022 09:51:08 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.49]) by mx.groups.io with SMTP id smtpd.web12.10211.1657817467311074588 for ; Thu, 14 Jul 2022 09:51:08 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=i32jLGHhFW5kgVN1RNP5djXDBptr7gJsZBJuPMc1nvWmKJQP+Lm6uZZbPue4pnVstPYpeQy0jS9V/ckN8PjYOVHNLF8yTEPkzUw6CULdQFMUhfFogAwdnnFB4EMfOf+dfmmc1YjNXHyX3wOrfkIPw9tw+aik1aVXijp8Up5zAzVaFFUAIx8Gi4ZfDNXKsMPQDz/Qx2Fx4zm19dDTl9LlDPNWmt6Tea88KYjYxB/mimhvILtVIxm2JLYYwgMymKzch17rTtDZ+fcBPvurJ66w0uYempYqyi/TFh7Puh9BRl171dbpEz6s11q9W0xefZdvbApRfNxDmP9u6c+4MF4bUg== 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=n8vBl9txkyUIHA2mpg9lyKACfgYX5N7XwLZ7SZYlvT4=; b=eu4N7piFpzX+NERArPY6PTZB0teiOb7mrKspGxKuRS6mpzG2yXDmxLvOGu+76Zxvam3T47MtHuHqNvn3Y4bTFw72x2Na21AAUbtEO9Xz9E8fVSB+sa0R4QcbeVWpZQU8x7NAc8sI5d34W8FJYicTCw8gwjeGPmjyY2iLW4K6rkpGCvm+wf3PkvOQ6NGebzVFAHa8aVeESVEyTId9SlQBFmC/vH9k1QqZ2dHOVRUUi5Hud/OQMwB+yx8gro0WntaTc0iMpgV7C7vQX3LgDsNRJfWf9rCKT0J4/d6Y3xriJ7OEJku4jpvd3x4ayD7YSSK8D/HyBoOGWohqlDKgEI/Avg== 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 AS8PR04CA0043.eurprd04.prod.outlook.com (2603:10a6:20b:312::18) by AM6PR08MB4309.eurprd08.prod.outlook.com (2603:10a6:20b:bb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25; Thu, 14 Jul 2022 16:51:03 +0000 X-Received: from VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:312:cafe::58) by AS8PR04CA0043.outlook.office365.com (2603:10a6:20b:312::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14 via Frontend Transport; Thu, 14 Jul 2022 16:51:03 +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+91356+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 VE1EUR03FT022.mail.protection.outlook.com (10.152.18.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:02 +0000 X-Received: ("Tessian outbound e5f49c5d38f9:v122"); Thu, 14 Jul 2022 16:51:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7ac79a9e7dc744a6 X-CR-MTA-TID: 64aa7808 X-Received: from 58c20011c0fa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 856F3DC2-90BD-4696-9100-CF523A5939AB.1; Thu, 14 Jul 2022 16:50:56 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 58c20011c0fa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:50:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AI6K2BgMlVaI2lPEJGXWnIEj/CpBDmPC85+BDH2txSylkR+0oB+9IY7b6d6BTCZQst7dSJczwuD735Xq1XVRWCTU9uQscp7Tm2HY0S23xkq2d9h0vOuCGtiV4nowCpzlZrxT4XTeDQNdCPlLjciwTZ8T45lzt8t5YElNZou1ypiOo/cT+7KiMXqKxiVxtwxHp7Tt4NMSuJwZ0RSCUz+lXAIw+EDTeLorcE7DiZP/AsWA5Er2mW/armS9hxvN9ZRzcbviRFDXwboM8R5bOJKAMog+clOiRnSEzctd1VC/Nj2wNtGc3EOBaj76/LIJ3GxtO3DFshSAPCa+wrdtEfZe7g== 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=n8vBl9txkyUIHA2mpg9lyKACfgYX5N7XwLZ7SZYlvT4=; b=Zt2JSMgxW3X5KOHAZ0BffyAVLVtMSzTw4aVkCVW2eWxkjq8zVi9ZB+qYKQz1SFxUOOsjGotjvL2Z81mdeopc6Fdmu9fZHpelolszMtYlwKaFJRcxF96z1QGTpgRFewfnMI436Rg1CvM0WIx74haMnIniFWS1wy5UrUqapmR+ds0v9Im3frRtes2pna5xWrstXn1l5rx+SNhBZoSPcIWRWdLNktuNWPvSPNh2irmaPCk3WszLdTbnslnvLZM1P+mEZhcw9J1uP2yJ3ZAVVgzIK3HPBEVkC2tRche3CQoU8YnUKSE7rFF2bNWEj3ryOrYXkLtPdGLQ6AqcPsPBQe044A== 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 AS9PR06CA0588.eurprd06.prod.outlook.com (2603:10a6:20b:486::28) by DB8PR08MB5322.eurprd08.prod.outlook.com (2603:10a6:10:114::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Thu, 14 Jul 2022 16:50:54 +0000 X-Received: from AM5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:486:cafe::d9) by AS9PR06CA0588.outlook.office365.com (2603:10a6:20b:486::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Thu, 14 Jul 2022 16:50:53 +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 AM5EUR03FT012.mail.protection.outlook.com (10.152.16.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:50:53 +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; Thu, 14 Jul 2022 16:50:41 +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; Thu, 14 Jul 2022 16:50:41 +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; Thu, 14 Jul 2022 16:50:40 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , , , , , , Subject: [edk2-devel] [PATCH v6 5/8] MdePkg: IORT header update for IORT Rev E.d spec Date: Thu, 14 Jul 2022 17:50:28 +0100 Message-ID: <20220714165031.42640-6-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 8e1cc33e-9707-4c0f-02ea-08da65b9093c X-MS-TrafficTypeDiagnostic: DB8PR08MB5322:EE_|VE1EUR03FT022:EE_|AM6PR08MB4309: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: K3lzQRqFa5TuE1u77D34oKaBod436qYW6t6YAMREoAPBvWDSD66RvPuWGlIH3jg6QVWMPMsadTs2kBz+3hrgJInef5PtO//+abORhEFzAsh3B97LT4UM9aYFjg9+g2Spw4qB6tFIvpWsb7CbJeuedyhLZzXIWhre3BpvPdxM+6cPTzwVGmBHoGpqOSf4JbhWm0lbyi6XYtXWDztOcbYmA0FGIoF5QenL+uGHN7yk7tn4hJBzVhwyxJpSIZLtC0WBbdIgS3AmkYSD739VaH2y8LB0nICZSRbiVSd3mbCFNDLGmya4HcJRjZx8H3elHQEa/w9Qgsn5A+CX8fTP53R7+Cr/+ApFsi4x1SrS895+y/0pRZYJI5IcJpEQNkej7eE0guk1kSoQHdVhdtV3oH1GUCXOjUOtGisi6IqIZn98jA5tcNhwz/pvDn8x8T5RdbyxrC8DlKrTgZW9sYfjyzTXpw0cbk9qjm3SMJoft8j1duhfiI7HLRYUVVZSWiVxoslPEUTsqEe/RcCAZufCXZVeIjDgkxZn2gGPFMZWvoOS1Y5Rc50P/1t2HUr03oj/e00yZnuICeH9+JvxNX+uYIDnJxLQvLKAG5BUlbu/dvQSQEUjQBESAfYonGOXEWASM+qOxpFtOWdtUFAoMaJKArMeI3x6URNg9hmr3tVafatQV7oHtEczF30Zun2SRGmrRuaG37Z273IrU1c4kLxlFoTRH48fq15gyKZL1FxHf7yvFO7dBbqpStOU1maDmhzjeETTikcir41SN+a4eaG7eD9FBKRKFNf38IL5FzOR4sJ2ruqzE6TZbgyj243NMiaGqFEwpeB1I2ioVecueivAgz39bvCSXAuDzeuTueoJ2oQbD7PriqRLWgE8FVl2Ry74zERIHy2qdxwitOzHW3Jyl9b2MR0UJScQwIOkNFtcHGRsBgs= 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)(376002)(396003)(346002)(46966006)(40470700004)(36840700001)(30864003)(47076005)(336012)(44832011)(15650500001)(8936002)(82310400005)(2906002)(356005)(26005)(40480700001)(40460700003)(86362001)(5660300002)(83380400001)(82740400003)(36860700001)(36756003)(6916009)(426003)(41300700001)(54906003)(316002)(70586007)(478600001)(81166007)(966005)(7696005)(8676002)(1076003)(4326008)(186003)(6666004)(2616005)(70206006)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5322 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0906e140-92e2-454b-be77-08da65b903fb X-Microsoft-Antispam-Message-Info: sqZwK4sWCw9cEEe7cBYUpvaFN5g8mQIBkWFO4JYxz3BaT+shRBckrD2WlULFoQG6zIYdcUA9AasskGDwvx1AtMR8tdWknVacXaIcXsOrzeJXasRkDaRVfOgTfZUoVZPnH7mEdN0Rzip7MvQpY7YZBW2hnliN1KpTQgPmaa9C/PmyTvgtSMZnl47xOzVF79U4oe4i6isfdnHWq2oqg3I5Oc4zTrGyz9fkJhFgQDsCVG5bE8yRMuBmRrbsnlok6sXxln8fAO3AxF+41ZEg6nGBSzK6Eb09if7pR6A68NwIa0J3QDW8A9KdUn3OviKol5CUL68LnuohcNLgwhxIaoBBBRpLeAuhNl39k/csyGuONARXNA6PSGODYaq69vRhWz3jtlo1RML+i+XdFceHv4vjcBZHP+2fHhUPmTNU3Yq1RQByy9epXUNrJBoe8QbUh+k2tCh8IRdz1jpgmGyQlquPalYbHjuBwTaLrkahZjgger7mZgnLLsToGrHMWR//z8lXiibf1TMZfw8rqSu1dR9E8dIW0ToPQAatCHd8E1JwqLCZIN4+L+/w2iCRsrnrJJRAB8B4qoeZ0F59WpIH+UxLJ9Q4ayh0ztjECWjh5zFwLIUOmhXzcARvsyHlptloiKBOy8Y66OW/OTOLcP6TWPIk/kbCUJ9i0uNgE0tzlyHBIJzfJ5ZvU3S9yIstLy+MU9K3gmItZFdpJOEwsM92QnwhlXrtvoAzOaVmVvu2dtXq2mqauzNKB6deROCRA6VV1dO/3yIxPHZt4iMBB1s4bl7Gm+vBLJgJ3cFx6ovelkNC9IGdewQGEigGl9vtx8/hCFd3f6UBmXzDmF9kbra+MK/lGcBMNhmaYbxunQYrRbL9ePKWELH/1pOd8qV94QXFn+kj X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:02.3223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e1cc33e-9707-4c0f-02ea-08da65b9093c 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: VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4309 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: 1EmdLIVODnzhSgWNJ6fp2GbHx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817468; bh=iPbRduwS8i730vxDfUtWZ4ablnvdTc14Z8dFq4gFlNs=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=VivKyVgw+/TrQw4uF06Q45WepAMIZ4w0AyGpKjT8lfkDrO1mFamSkKhpK4y4Gwv/7cn 9uivNBNBdO9AfZSh3ROxAItPPngy78rRZYRzGPUV9Shd/fUAVhLPgnxEKDhFn8WoAIwg4 FqFKRL2wiwqK/2AEb2xQz8TMF1cSzAswPHo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817469713100003 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_REVISION_00. Also update the IORT generator in DynamicTablesPkg to fix the compilation errors so that Git Bisect can work. Signed-off-by: Sami Mujawar Reviewed-by: Liming Gao Reviewed-by: Pierre Gondois Reviewed-by: Zhichao Gao --- Notes: v6: - Add definition for IORT Rev 4 and RMR Node Rev 2. [PIERR= E] - Added definition for IORT Rev 4 and RMR Node 2 so that [SAMI] appropriate checks can be performed for deprecated table/node revisions. =20 v5: - Change IORT revision macro name to make it similar to [THOMA= S] macro names for other ACPI tables. - Updated IORT revision macros from [SAMI] EFI_ACPI_IO_REMAPPING_TABLE_REVx to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_0x Ref: https://edk2.groups.io/g/devel/message/91119 - Keep EFI_ACPI_IO_REMAPPING_TABLE_REVISION and set to [LIMIN= G] EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05. Ref: https://edk2.groups.io/g/devel/message/91137 - Added EFI_ACPI_IO_REMAPPING_TABLE_REVISION and set it [SAMI] to the latest IORT revision. - Updated IORT generator in DynamicTablesPkg and included [SAMI] in this patch so that Git bisect does not break. =20 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. DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 19 ++--- MdePkg/Include/IndustryStandard/IoRemappingTable.h | 86 ++++= ++++++++++++++-- 2 files changed, 87 insertions(+), 18 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index abef9e5a7f90a38e1d697227d3cd2c110db364a4..63381441e2d6515a7cc9731c89b= 9739a12c65599 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -766,7 +766,7 @@ AddItsGroupNodes ( 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.Identifier =3D EFI_ACPI_RESERVED_DWORD; ItsGroupNode->Node.NumIdMappings =3D 0; ItsGroupNode->Node.IdReference =3D 0; =20 @@ -872,7 +872,7 @@ AddNamedComponentNodes ( 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.Identifier =3D EFI_ACPI_RESERVED_DWORD; NcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; =20 ObjectNameLength =3D AsciiStrLen (NodeList->ObjectName) + 1; @@ -1005,7 +1005,7 @@ AddRootComplexNodes ( 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.Identifier =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); @@ -1018,9 +1018,8 @@ AddRootComplexNodes ( RcNode->AtsAttribute =3D NodeList->AtsAttribute; RcNode->PciSegmentNumber =3D NodeList->PciSegmentNumber; RcNode->MemoryAddressSize =3D NodeList->MemoryAddressSize; + RcNode->PasidCapabilities =3D EFI_ACPI_RESERVED_WORD; 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) { @@ -1188,7 +1187,7 @@ AddSmmuV1V2Nodes ( 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.Identifier =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) + @@ -1387,7 +1386,7 @@ AddSmmuV3Nodes ( 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.Identifier =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); @@ -1518,7 +1517,7 @@ AddPmcgNodes ( 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.Identifier =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); @@ -2258,9 +2257,9 @@ ACPI_IORT_GENERATOR IortGenerator =3D { // ACPI Table Signature EFI_ACPI_6_2_IO_REMAPPING_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_IO_REMAPPING_TABLE_REVISION, + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00, // Minimum supported ACPI Table Revision - EFI_ACPI_IO_REMAPPING_TABLE_REVISION, + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00, // Creator ID TABLE_GENERATOR_CREATOR_ID_ARM, // Creator Revision diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/In= clude/IndustryStandard/IoRemappingTable.h index 79a34678681d45b2982dc8573db6bd447f42e429..f48a4a95cd71a147098dff33eff= 3096b52021990 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,9 @@ =20 #include =20 -#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION 0x0 +#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 0x0 +#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_04 0x4 // Deprecated +#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05 0x5 =20 #define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0 #define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1 @@ -22,6 +31,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,10 +65,34 @@ #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 +#define EFI_ACPI_IORT_RMR_NODE_REVISION_02 0x2 // Deprecated + #pragma pack(1) =20 /// @@ -89,7 +123,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 +152,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 +234,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 (#91356): https://edk2.groups.io/g/devel/message/91356 Mute This Topic: https://groups.io/mt/92383461/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 08:24:50 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+91360+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 1657817480008707.6854954053787; Thu, 14 Jul 2022 09:51:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tRMuYY1788612xXtYJOiRvHK; Thu, 14 Jul 2022 09:51:18 -0700 X-Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.42]) by mx.groups.io with SMTP id smtpd.web10.10000.1657817477858624003 for ; Thu, 14 Jul 2022 09:51:18 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=J8VRSxMxC2n3WybABZ8ATtnGWaGpPTb4lamCGr2qtyRoCC2wh2wYkMG2nPm0WRO8nuj/3Wx0ouSw4v8sYFccP5onquVwu5gMv4galMfZ5T9lbkoyFTKe58rU5ZtKy+L79ClYoH2LObUenwOSW6nVvYFDL469UefvFdGZPmX6RnZprx+j+2Tasn9Kyov0Y6lut20eCOTj9WYxvypy4FCDfnmZaozee8PrT+fvwOZ7G+/1FyyLc2fjiMiPD8uYDabe+z1CWrS5NXRAQnn0WIAs0RwmmOOXy44/vZdQyG/87vW7a0PMA0WXRmE6N1tTbArdTD4S5Eb+IoagF867HFNwnQ== 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=fwmQ0IctpyW8CerXZBupdfFcV3YwLL/0s8ia0nf9iTE=; b=Pc4zfH5RZUH6sGxGUf+HZLkMYBGuFqM/q4D0BtB0+9QmEy7cKjDCnLIVs0sRXl1ZOT3mGGCdISftvJ5mp9CtomRChlhFzm6J3FRnp/VXeu6tXZv8Ui/tLBMCPS/v5rjwyHHMwNhNwc5yDbKXgcEXn5hBVthWm9NNFrXRsyWs5sksAKsaOQmjwlknLWO8oXWzpBsp0vwiybrq5jGN/db2YQnw7PFFMJTm3F461OWanxC3ig9KDBFDG598Kq8xjPuEAMZc35C3Lr5WYH0/7deTd8pvzu1ua46XvFBhYg7NTVqlTOzgnliBChdIsRxVR9AGA8zMaJPG47sZP5sDhDlN4Q== 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 AS9PR04CA0110.eurprd04.prod.outlook.com (2603:10a6:20b:531::12) by GV1PR08MB7778.eurprd08.prod.outlook.com (2603:10a6:150:56::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Thu, 14 Jul 2022 16:51:14 +0000 X-Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:531:cafe::40) by AS9PR04CA0110.outlook.office365.com (2603:10a6:20b:531::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26 via Frontend Transport; Thu, 14 Jul 2022 16:51:13 +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+91360+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 AM5EUR03FT054.mail.protection.outlook.com (10.152.16.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:13 +0000 X-Received: ("Tessian outbound 0ba541f03a2a:v122"); Thu, 14 Jul 2022 16:51:13 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a6cee1fce1828498 X-CR-MTA-TID: 64aa7808 X-Received: from ba949088b368.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3FB7A034-ED54-44FD-8522-42DE593B86D0.1; Thu, 14 Jul 2022 16:51:06 +0000 X-Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ba949088b368.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:51:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f2WlYweA+rtKLyblM54mNt+N5vHDlTTgN5DPs6LU4jmxY/9ceuhmXwr4SNpyDY8n74iIh7nlzo4aenUTLeeuYtq2hn9m9K4mQYKVqK4WUEp02hZ3NnARvzh7SvJUJYZR32ZKBtBdvlTlK2LK/Z66RuCdjQvOeMOV0HRdvqvoiHe+jx7B8IHQOasvx1DC2DF11Kqy9qzjyVD42peubtQgmahlx9bO89H5Wp6seVYQKKHu4AAuSZHPI5t5kogK83a8mplAh8DTbNjIKoXHbbYRs0TJAdQR6PV2XE4Bbo9Lnn4DbO0eqQP+TjgRcTsDyXSOh0Axg/qeJ1UkMSd430VBLg== 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=fwmQ0IctpyW8CerXZBupdfFcV3YwLL/0s8ia0nf9iTE=; b=F4zgk66pFatAnNJs4AFeBTG1WJvAjjav3IXy+tkD9afplie5Mh13e7hQ6YEB6ggXmnegU+ZGmIFkIwpK3TE4v8ye7SQN1/jW/Pnb0+UL/SfusD8cbIu7RPBGCN+DMS9jPXInhSm1aWi5755Yin+XXuFo/hewRqJaxm6TK9iFaJYfd6+w0wBFDqfSi3k/MLNbjnPSsosLh+m9++bV7qklV7CbGWVRafGFe8I9y/cgyZeQKak064Jo6TCWhC3QELpLucwaFfv4HVCmE4c3c14MEkmbzc6Ojpsp3hs2DCxob8dpHqOaGv0jFlg8hnwm+eLqReyymxypbwrchGLhX+61QA== 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 AS9PR04CA0072.eurprd04.prod.outlook.com (2603:10a6:20b:48b::7) by DB6PR0802MB2293.eurprd08.prod.outlook.com (2603:10a6:4:86::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Thu, 14 Jul 2022 16:51:04 +0000 X-Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::e) by AS9PR04CA0072.outlook.office365.com (2603:10a6:20b:48b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:04 +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 AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:51:03 +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; Thu, 14 Jul 2022 16:50:42 +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; Thu, 14 Jul 2022 16:50:41 +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; Thu, 14 Jul 2022 16:50:41 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v6 6/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.d spec Date: Thu, 14 Jul 2022 17:50:29 +0100 Message-ID: <20220714165031.42640-7-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 1d32c4ed-9de7-47b5-9a5f-08da65b90ff6 X-MS-TrafficTypeDiagnostic: DB6PR0802MB2293:EE_|AM5EUR03FT054:EE_|GV1PR08MB7778: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: 9yLJ1ICv9rzFtu4wTtt6fNDzaFm7zFOu1Znc2qqhFgZfnPD3dID7LGZlIeoH0cQTCeD3kDpRTbTXUfvWLWPtUN0Daxk5F6rULEqS92rGplsUTuZSfShCP2x2UqdiPCe4uhJdIVa/zisXH4q/RFauhQUi36hJnHF7lnR8Bm8cEsRGXzvw1u6Nt9klNOI2VKBiIXF1T/bj7OaS+SvL/RmfEGR/J/NpcZb0O5vF1VvkMwSG5EmyLxwnYQc9uS6mZQu5k76czFyW+hQHO8sz+K7dJrKUE3bNu2Gnxs4pgZ7VJnppUrmYMn4NN/4aNDHsm+Nk2TNdMpvnSrGRJTkBpo7cNeA9u4qf6rQn+eblBUTs1vCjQwRZv1QQ5ORvuebH6V863IWKALav23UQ8Zl7upF4fQgplx7h3B7bvhF5AiB8INFQdJ33/5WYHQMzqWjSAuY40Vd/vB1s+AfkNYU8cCKruMukRafT6VTQxqDV2wRihm6sMB6mn11b7rA5ycrrSADl5o0UCs8b/azyGckh+zw53ljxrOrdrEjnpN49IbnnFSawiCqZ/rk8bZBicGJFlgSClYEDZI3F30T0OdVVpsayWP7TKhsWlMjO/XDeQF4Bt1zhJUyK65mCVUadYjFDKOGiZTVeBKzfomjA/KxW6ghYXyZZ/Hl7XLPzyBSSuLTDzkQsOfI3iFEIONBG/Eo9SopEWApwQJ7CUrObslt2Eod0CoojADVqzZBnjwcPxKTukQjxF0qYDQYwBLT3N5y4krGo2gsi3CN2ellm7HeeOl80BsEb5KELD7ZHWnRILe4wx4TuZ7mGjgSO/e6FH7m/hdJOPlb3ZEjuTnJtljeZALmeBjJ+igg58zNfQw8RysIUAuy6Cl7rsyWkdhrZO26B30Sf7QNyQQLb48NBdf6ggy8hSGTCcA9ZY5ThMQDhcGt3c0M= 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)(136003)(39860400002)(396003)(346002)(46966006)(40470700004)(36840700001)(54906003)(36756003)(70206006)(44832011)(8676002)(316002)(336012)(83380400001)(6666004)(6916009)(26005)(4326008)(70586007)(356005)(2906002)(41300700001)(81166007)(15650500001)(30864003)(82740400003)(426003)(82310400005)(7696005)(186003)(8936002)(1076003)(40480700001)(40460700003)(2616005)(478600001)(47076005)(966005)(86362001)(36860700001)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2293 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a9adcfe0-51af-4dd2-eb25-08da65b90a23 X-Microsoft-Antispam-Message-Info: vCDaa4zkRIv4KIwmuXyC3EXPYpccpMqnyZty50HWSZDogHu8zdu3DYaWuPfUca9DbvtiaXV/LAHoydEnZLHni3cKfrocTbT41Fd7BTuJYKNj45wxvrfTif2cMFJ4b83iWxnqRYUInQwFxZlSjQTxciVzyp+7gu4qB2rmBQe4jflP0VZ+sDEeFplhLmAVwDcZ79n6y2cgruhjlKQUma3nO24fjpa+jov0C3Sp285ob5YIhon/jCznqKDHPuywKe6tNDYMu94tOeh9Qnf97OGyW+xVsEklf12pBhxrk5fLnTQpmh4D1coHsOHgsE5MgBY/MFDZrNmjpOuZaFhC1g1lZZw/3q+bDMKYhENNlkrnJymdHvTSNzn+J/LMLkKWweeAwH8vLST7KLsVjKZQYeMna+3AaKaStPt/IgpsAiN6WG7CjX4opmMCJnQeCn1KyZbv5SSQqiAue07JriyCJVEklVFNORsdSuzDFOrlnjio+i9bjJPXw/DivfhzB3tZefa/GXNe+/UPeugekjOyauozYNs99jc7fm3EOGVdbjrm74zeSJkEu3lSDugErdpKtX2AKMlgrvlqyjW1Wuv1RXqfhhf5OBKwStQ1bIkLcMAeQ4N1kekVHPVzyoUwdW5Pn9uJ4pmnLSYk10lTeRbXz3AzMZbO1N0GKqybR0/xLtZVlaLSLgGVE/TBA6s1MPPsF432F7KFl6pgyGsUTlUpbqb/LXoLvDBBrWEif7EbavxKoV54iPTHnoLcYzUhqOXcgtuU5txx60QFqEktI8x6bn8H/gk5Q2fPNkdx+WrcvEFw2s2eaIE/tqnNlcc0pgK8VWLj1wccBqDuzlLAkeoC4nG3x4F02JqFU4yzTyS930qGp0HuhiKmL8D+JF64NM9DYJY2JpSwqPGwZzd+67GSZSGDgw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:13.6782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d32c4ed-9de7-47b5-9a5f-08da65b90ff6 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: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7778 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: Py6XTguGgzePfnyewxqBhbCZx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817478; bh=xKbrsR1qHbLJvUNMzGFBy2MVZv6uV8Sg7MoB/9J5Zs4=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=i0cLIxOBNVy9X/aKYhLTmMG2+LCbsi64PCER8CeqqPdeHdMa60sfEnyHh8ySBsdxCbJ I5lQOVii/OQq2wDnJ7o2dbWSuIVve4Ayh0Yh92p9BjXYufes+gxpP23sj/t/SZezrBuXH P3Qtw0VTRuaKKlR6r0Bxnceqq2BRPv1rQFc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817481731100004 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. - skip parsing of IORT Rev E, Rev E.a, Rev E.b, Rev E.c as some fields were deprecated in these revisions. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois Reviewed-by: Zhichao Gao --- Notes: v6: - Make output format for Flags filed consistent. [PIERRE] - Define macro for IORT Rev E.c and RMR Node revision 2 [PIERRE] and use these to check for deprecated table/node revisions. - Identifier field size changed between IORT revision E [PIERRE] and E.a. so extra checks should be needed. - Added check to skip parsing if IORT Rev E, E. [SAMI] as various fields were deprecated between revisions. =20 v5: - No code change since v4. Included r-b received for [SAMI] v5 series. =20 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= 30 ++++++++++++++++++-- 1 file changed, 212 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..599cf0ee8f7e4c7ed398fa60460= 2604d1955d2e6 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"0x%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 EFI_ACPI_IORT_RMR_NODE_REVISION_02) { + 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,22 @@ ParseAcpiIort ( return; } =20 + if ((AcpiTableRevision > EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00) && + (AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05)) + { + Print ( + L"ERROR: Parsing not supported for IORT tabe Revision E, E..\= n" + ); + if (AcpiTableRevision =3D=3D EFI_ACPI_IO_REMAPPING_TABLE_REVISION_04) { + IncrementErrorCount (); + Print ( + L"ERROR: IORT tabe Revision E.c is deprecated and must not be used= .\n" + ); + } + + return; + } + ParseAcpi ( TRUE, 0, @@ -765,7 +952,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 (#91360): https://edk2.groups.io/g/devel/message/91360 Mute This Topic: https://groups.io/mt/92383465/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 08:24:50 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+91363+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 1657817488674957.8693917102911; Thu, 14 Jul 2022 09:51:28 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Ii0EYY1788612xUN0iS5rEGA; Thu, 14 Jul 2022 09:51:28 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.87]) by mx.groups.io with SMTP id smtpd.web11.10192.1657817487074031137 for ; Thu, 14 Jul 2022 09:51:27 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=CR4DBhPSCt2TNHMXeYa/NsGa7clZBKGtWjhtR/OSvpvuFBO4StZv/0WdROKyXjQ82oSWzpx+VQwHXQHgQC4e9PohAUQjRXj3TUzBU37GTKlMYjx1rh/PIAdmgoBV8ddHcDBMAAOgCwmu8wBTqiupqh3ZlkNFkqWHTw4qik3HZ4IPIF6KwR+BYkhD22WWSLdaTENOOQwc1bDliJP6GFGPo+suQG9BMiqZe7QZeGzNk63uI+biWZ7d1Oogxe4liCEvXUR+4PSVMgqk6gHYTNl/TcJc87RgMOD4I6bWx58FW+7NNrceLDVX3ONVLAnA5m8YPHCAtbCtkYyhB+4lbgwb+w== 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=RWuq9r3yGLS9BCZ58y2Ob48FGdtsxlXLY289Mcpbh/A=; b=TfMVWxi9XeS+kBlXK/dumZDmhXJguBjrEakcd6QcNwTF+u/7+jcJJVij9LBO2agrL8qKU4/EPQ3Wmh/4D8dqqe+IxXfxt3g1qMo6IGJ7y9a0uHaSpiUgGB2Q01h2z3tyG1Xoe2T53yHWe8GZG6GIGuwmnwBfBDXkiBEqOYH+MfeH865tvm4ukCQz7gImWNAxnZjZhEBMUoVtSOFt7DNwHrymeaNjo2EMb+P0Cc3iYfojVof7MpFsWYNH5zdVJwIGC9nK/WN1mHZ5u+aFgFckMWd0nWnQEqCfCSEQA3w490EJoqlNOSm1K0ncL5oGE8slBFMQfJGMubH+4T+GD5JGvQ== 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 AM5PR0701CA0051.eurprd07.prod.outlook.com (2603:10a6:203:2::13) by PAXPR08MB6509.eurprd08.prod.outlook.com (2603:10a6:102:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:15 +0000 X-Received: from AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:2:cafe::10) by AM5PR0701CA0051.outlook.office365.com (2603:10a6:203:2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.7 via Frontend Transport; Thu, 14 Jul 2022 16:51:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+91363+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 AM5EUR03FT006.mail.protection.outlook.com (10.152.16.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:15 +0000 X-Received: ("Tessian outbound 8e3d5168572a:v122"); Thu, 14 Jul 2022 16:51:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 95e825b517ee7f1f X-CR-MTA-TID: 64aa7808 X-Received: from ab5eb2fd68b7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AF60521D-05E1-43E8-B987-A8E7690DFC36.1; Thu, 14 Jul 2022 16:51:08 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ab5eb2fd68b7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:51:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hh1m9dhcupWyvcn7HuXl4xa2Zr82mmISaSl0mIt0x9nXM0CxwaqC5SsF38f8fDcNndi5Q3c2p9ApTaMlnM87qSZwj+l4F9cqOkXklL4xEVO4f4VVCFkDOxa0JeSKed+a49exRH0VsPr/XlmcrdxDoYFdXFnRaz4lBOTVdZozu3LAQ/D8NJsjX2kvqfigC5ZLouTr586TlHMmrihoC77iJFGTgdklegh7a3JFxffxJNiYK1ifbmi7r6EmjZKXHtzqUh4Ih8aegxRBtPZMvtvGrJE60v2AX/06YITKkNxuvax+PDyHETd3fg+8xPUkUKJIln/R2YpPo1lzS070BJ4g7A== 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=RWuq9r3yGLS9BCZ58y2Ob48FGdtsxlXLY289Mcpbh/A=; b=TyYB0/1luEGs4eEDBWCp5fMwM0YRwgpXMMcc1Oa5XiukiE9BSgrykVw/28G1oPwdHKs3RpyIC9QDAq6MRdHBPue1X9KnfzlqDISVBdRpEzBRnCNXbfKWSoXZl3IUa8vR01HDSKW1OdVQR9uRPOYN4iEzy2c49sPhDrQVxzNPZRJqv7wWzoB1wt4BXUeoFgdAQ4CNAEObRiQHXQiuLZ3iahT6tszYpodkxJZgZBDN1xwwTdusWPP952jCXvVSjNGokKM6kMltao07w725Lz2wM5yiBZtTDN8QSqGOTfVE34jaZ4qoXsRsJfYqZznq/9164KG3mw2MlBNYzHfcRMg17A== 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 AS9PR04CA0079.eurprd04.prod.outlook.com (2603:10a6:20b:48b::23) by AM0PR08MB3362.eurprd08.prod.outlook.com (2603:10a6:208:dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Thu, 14 Jul 2022 16:51:05 +0000 X-Received: from AM5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::72) by AS9PR04CA0079.outlook.office365.com (2603:10a6:20b:48b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14 via Frontend Transport; Thu, 14 Jul 2022 16:51:05 +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 AM5EUR03FT059.mail.protection.outlook.com (10.152.17.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Thu, 14 Jul 2022 16:51:05 +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; Thu, 14 Jul 2022 16:50:42 +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; Thu, 14 Jul 2022 16:50:42 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v6 7/8] DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.d Date: Thu, 14 Jul 2022 17:50:30 +0100 Message-ID: <20220714165031.42640-8-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 17bf0d79-b632-457c-af13-08da65b91116 X-MS-TrafficTypeDiagnostic: AM0PR08MB3362:EE_|AM5EUR03FT006:EE_|PAXPR08MB6509: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: G1tNv+wnK3scV2unpQSsckMGR5Kua7N1ReLNBun6C6Ztur1MwDEEfavy5PlA3LpYgBvknuhHzv6UunhgG72GPYLu6g1Y2XTqNPSi17stDSoGC2j6yUEw0VuvEwrkCoga84LebmmhWYwAbLpcyTdbYRMfTXUDQ6KCjvMuo5b4i8Bwzh/SiMqOnOjv0wf9zNEzn5OCgMBEaUU59zsm27jPX+0wB62ZS411jHsGwiHLk9rnKRkEPJV7BAJN+iFW9qmaAgTNFuNBv7j7ylGjznjABpabLImRBYACCj8yRdhczjZ/+GQWXypMqzbO0FgBd6MQtsISYz0aqyFMpCtHuQQcdCLOQM//csr1On8lu3bo3N4Qi5CdKr4TybThLvv4NcjQ76lxkbC/Pjxg27M0yN3Fz/nyCVcE7S5XpUN/RLaYRdIG4MI5ZSyX0/mfaruUD6cY1zQfEIvy1A4Zev4bF6tz/+zwSq19uAdoyTtpuxk9WMK7zcIEbQnsipmlml3KGxVHejXUT/+/8fE/pP4UH8fiXM+eH7z6Mu9Jc4AfHST1tgz8fwiHduAVuG6AOsPUL0c4kvHreZbI4z8880XS1Y27UWkuP3lC4aW9sZl4mWwUfn7c0r8KiXDNFBObjna2yXXxAe61kDyDboDPL02j20+RmKrxyCiCkA8isysKKEBX0z4Cbu6pD+VFdC5kQ0Y7utq+KZNOYPLPn4SGthVgXJcaz9PfrnXY89UdroCeyXhz+RYKjXLVxSrLPw/kApyYxRU02nv97wCzakz5wG+r1z0VwsQtLsktYu0HJ5nR3MbkT8XHvzjd4aeLsPodrlu/Z+CHlrykxMF8Ba885y0FjYl60fcR3xgw9OVXPtUEmZ1pfcOsBUfGn5wnvSfPj1ID4pHO1Ps8SGcbY0SkHG7GTav+0xGD7wtJzIMz5sYrN5kQxxY= 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)(136003)(376002)(39860400002)(346002)(46966006)(36840700001)(40470700004)(2906002)(336012)(41300700001)(83380400001)(356005)(44832011)(6666004)(70206006)(426003)(82740400003)(4326008)(47076005)(40480700001)(2616005)(186003)(7696005)(8936002)(966005)(15650500001)(86362001)(8676002)(70586007)(478600001)(82310400005)(19627235002)(5660300002)(1076003)(54906003)(81166007)(26005)(36860700001)(40460700003)(36756003)(316002)(6916009)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3362 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0b88c255-2afc-4afa-3712-08da65b90b41 X-Microsoft-Antispam-Message-Info: E7Z3hjH+cDBZ4HuNzMrxG66/c64AmU3KZvjUrKKBdEj/X5Idy6PA1IRGCs1y2bfImt6AWEIIll2K+yEvH+1AtCMEerp6t3oJKgcErD2YuQ4cOmUVSFWp7/HRSi1XatgbiS1UvajoxWOf/duWsexsBMlZA1SFbQ2B8CZ2XfCv9sWBz6m20OI3F4cF4c0xQte7L3O8irXn/YYu3IOzqncmC/kygnlulFpAWC/dWCsLsE5lQYnQkdfsF4dSYkciVcgnu1PGKHO0sRualCKpsPSuOpGiRBucY+1s6uFkIIOlxUgyTlGJLhyEhESztLWBIufPafGuio1G5lhs5Q+87FBbj1xs9TYTqnxytRNmiTkaHlIBW0u19BKr0Evt25u/sJpYDBaY7tmdjaELn93r0FRcZx3OT9InPpNaSh7xWr03ykF7rHBB74A7fnbSy9qky+Ysn9aChhGEyyBJP4qYqXTSk+Fm1IAyRy2XqXvmWebY6zy/fCO1w4xoS5HDKXZY6Vv0ymThSSI8PmBSEEFfH4HNIKQZRYb7x83ZMCMPoDMljeJchq+YCCddItDkBlWfPvoZhfOICKn5sO9t9Q2tUR669dhk/7/BoDkh7XcLjY6n7xegguftRwiNx97H3X25VnAI4TQyvsrfnlASVRVPoSg4ii8H+Sz4UUBqgRAOeCwNA7IGpW3cBGI2dp92w0mVwAU1+oX1pcJgte3fi860NTRXxPbpAb45rytzwdcZclEP4b/EmevlENCRH1hsXuVhBc6o+tjCWKdmE6ayRpNGg6GFkM75tXTdgcZa6GS0bs4xhWrgxE4Yzbfo8VlTqOQPAVQw+MAVHpcqMcy/lyDMEaozeMs+umyGVZaOySsOLb8KshwIkojHMuVLX3ysX/sgEuG+XDeckHO9CnwWe6Y0ZIxtmw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:15.5627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17bf0d79-b632-457c-af13-08da65b91116 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: AM5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6509 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: 3vwSUihPOnlozIeuThpRGmbvx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817488; bh=DATCpPvsC29uOImEdY7F8MTSbugTtE9Dj2L6NV5m5Gw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=eHV35FiO+yGCRLEfULwvmIPQ+1PT7fTmWVFaDGk5Zst71D8yUYqa+6RR6id9ln7mYAY 2jMveh3Y5SYOc61udrROGcj+4oRKK3Qvp9OvMYBRzB2bBpiOze4tmp8PV2Ro+Hwm8QN1O b3XVt2QkGl+a8Q2+4eA+3FpoNJVnQfuLMFo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817489678100001 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 Reviewed-by: Pierre Gondois --- Notes: v6: - No code change since v4. Re-sending with v6 series. [SAMI] =20 v5: - No code change since v4. Re-sending with v5 series. [SAMI] =20 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 (#91363): https://edk2.groups.io/g/devel/message/91363 Mute This Topic: https://groups.io/mt/92383471/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 08:24:50 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+91362+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 165781748235675.71231324138193; Thu, 14 Jul 2022 09:51:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YAuFYY1788612xusodVO5Glt; Thu, 14 Jul 2022 09:51:21 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.84]) by mx.groups.io with SMTP id smtpd.web12.10213.1657817480555065000 for ; Thu, 14 Jul 2022 09:51:21 -0700 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=F/QKJoA4easi80fIarnijJ6+hrKqSq0AY2oqNcxkxlVKq1Znu8cLp3bbIbVSzwaB6sNzaFkfsGNWVtveZAQln95LqjlxzMRZ+tQrz9PyemQXXknJ6/WopozA2RUd3HxZB6vyjDiHvYgCTFwXzjjOQzyq0/GPf/LS+YHH7w5EtdE6JlfxRqYVtMuHa4V1r0jC2FqFrjMo7yz6XOKUO7IVSt/zeWuLnQVTFlracl3juG+K3GpkNahHvZHLtCt5JJMcB6MIWG+yY/xlhpSJ6ESbS8seEifIkHVWkQR/4nN8lwyhDtkVv8L++olh2n9YxSrDW4u+Uk6PpG0dd+KB/Yyadg== 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=te08SncPJs9pzuzAWgfCVG1cQWmF5frYw2juvL6YllE=; b=BOu5mDAnAE1YjhVzo5Ne+mOSHPonC2oh5vrV45kQkOMcfpFDB3PIoD89ofhd0O2rzdDr4uH6bD/OPKutsI0u2Rn3FWHsF8HLFcfj5PcHoNsj6S5psqFDd8gchFxYO5yxXE8RwEvPZxRbzhAd13oYejURY4fPTkrvDHnJwAQTujjZWAZxZWelw+v6f26gA5Idl5Ya9720vJvlLXcPvCvFwDwyH5cbHKInwvajirjdCeA8r+/mCFWp5MF9zunXyFIEJKFM/Sa6Kk5kYwNkIlDOzVt2d4hXKjk30JN0s+jRTEnwTyQPW+KtOmW/4Gz1d8X4Y7jt5HGdONYnslB+WmKQrg== 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 AS9P194CA0007.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::21) by DB6PR08MB2823.eurprd08.prod.outlook.com (2603:10a6:6:21::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:16 +0000 X-Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::ce) by AS9P194CA0007.outlook.office365.com (2603:10a6:20b:46d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.13 via Frontend Transport; Thu, 14 Jul 2022 16:51:16 +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+91362+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 AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Thu, 14 Jul 2022 16:51:14 +0000 X-Received: ("Tessian outbound 6f9e7ef31fa8:v122"); Thu, 14 Jul 2022 16:51:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: df775e3f194e9d97 X-CR-MTA-TID: 64aa7808 X-Received: from 36d04631e583.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1773FD95-546C-4E60-A933-86AF52864B53.1; Thu, 14 Jul 2022 16:51:08 +0000 X-Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 36d04631e583.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jul 2022 16:51:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gD06Gux7bfN3IdKP6WnYuTpyy9HRCwzEIBLAyAZdBBWRJhPhU21L/OP/I2nx+nAchYHoEQhFioyiUc4urr6tZVRO+5zHcalKKn40ayfGaUiHzSqhlSa2WfkfZNHzI+5ll7W7BdWhFGjEv9c7f9uIXG45zaRw7C/lElaXiwImm9kV+iJMgwq0sBWHnsRsKryO1xINnGgd1vGzHp2Xu6ebr6YkhATsSx2i3PgsrKnpUPQTMoGPbzSBSJiZ5wNTzbdO7rBU0ZdmW9OpovpERuWHpEqS1DyDC0rDpeJDCMS+t4KLibRbQmYp27xa/tQ6y8F9a/TYZr/7rJT8X8kwsvuWtQ== 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=te08SncPJs9pzuzAWgfCVG1cQWmF5frYw2juvL6YllE=; b=WsYt3rWBdMis3p37kdrD3QSfYw9jHYPgGfS/RKoeM3JlIJ49pCAf+RZ7MqcRIOKqqC5RjBnXYFaXlRNzEsH9yW3rrssvzGH3BYrJq6t2Q44/hnn0FvGP0UzrOdYLeNQwyuaZZttlQLEKRGy8i4Ve4MSBgfy+ku4S1O4DI/OTvgq4DSCyT2t46lapxfCDQFN3xyvtjv4QwSPPCTJIwemJAZI88E6DI9tU+OVURGt3Xb170LmXQ9lFJiR8EwbSGKwQLW72sdvhOrTRwkMteGF4cMZTUC64Xn4onXfz7h12kVuzpttbnFY6k3vk2vVnycpmhQrdNI5hZw3acbA4xIVtOw== 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 AS8P189CA0028.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::13) by AM9PR08MB7014.eurprd08.prod.outlook.com (2603:10a6:20b:41b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Thu, 14 Jul 2022 16:51:06 +0000 X-Received: from AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31f:cafe::c2) by AS8P189CA0028.outlook.office365.com (2603:10a6:20b:31f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.11 via Frontend Transport; Thu, 14 Jul 2022 16:51:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT040.mail.protection.outlook.com (10.152.17.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 14 Jul 2022 16:51:06 +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; Thu, 14 Jul 2022 16:50:45 +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; Thu, 14 Jul 2022 16:50:43 +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; Thu, 14 Jul 2022 16:50:43 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , Subject: [edk2-devel] [PATCH v6 8/8] DynamicTablesPkg: IORT generator updates for Rev E.d spec Date: Thu, 14 Jul 2022 17:50:31 +0100 Message-ID: <20220714165031.42640-9-sami.mujawar@arm.com> In-Reply-To: <20220714165031.42640-1-sami.mujawar@arm.com> References: <20220714165031.42640-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 9353ed39-cc57-4c4d-70c3-08da65b910aa X-MS-TrafficTypeDiagnostic: AM9PR08MB7014:EE_|AM5EUR03FT010:EE_|DB6PR08MB2823: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: uB52YuTEqnJNR6Sxpk389SBeBOKSWBskwIEK7eoQbgmzyzq6jb+OT/Hoo2D7NuMlWJFQDHl7m5t4Kxbu6UZI2vkkP93Tt+WX5cQcBB1KZ3pJLFLBh3MGV+aE2MhT5BwrNh6i2fi/6m/zepL8BVTHoIzT87Znv/e21tQBwshAIBwakrZerWP1/NN4BLgKJ0r62nZKW8GZ9ooieZcWdPdaHYn3upPdSuqwp1y70/rfUaGQ78EvlkDY8kHuoOvexfaCvVSlSHJ4KAGEmF7eQ7UN91H2eJYpQfP5R7ABHqdVe7Npq9YCv+04dDqOeLVLWhB3v0Qr9rFL8bcgUi6I5pEsy/LAC5VHIzEvgJPDyPVG0JD2D+wjJSpU4D9Yi7YIFCeK1srUsy0S0W+92kwm1gg/n9xgSUPB6AwzkY58OPjzWxwynxhIUyz/xhqBg3zpZSXCMAQZeVRkxbMp9ABJILfYD68SXPpVpKuKOvYtWh2JpVZRe6HmXrVdZcIodpONvWeJn0eiaH9RY+/wztoD7Ynq0w6Gi+C5LqrLPGdZ/GCkZUSGrlCNDKj/1JCxQgFv/MQ5bIIw0zAw4pzOmvcfei0ZVtWOHfET68M2fK1JPHPRdAY06LAa9lqw+UlAdn3ZhFPhXhiVmYhmefN7Sc+3sXYey6pf+U73BfG2YBtf3dAAbwPgsc5rZwdfURu2UCV8vBmersmO0D6WAwJ62ugRxcKqBjGD7pPNY94VjoLUcKXRLFWNEgSiWbw6WHos9n9fFetum2bQ3tMRIZmypuzDywX7zSPj0hVFWAYytakwFP9J7RDc8c5Z8+yLvVS6iYWQlBJl5PomKn+mRDGrq8yo41prQJ4XDOAhmmJ7l4v8vF31oBU+2aSLVxhsmg2KxP76tUF4yy7KSLS8t8WXZHYQbyQ17zuG5t0hPOlw/Bm+iWiAuAM= 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)(136003)(396003)(346002)(39860400002)(36840700001)(40470700004)(46966006)(54906003)(6916009)(81166007)(186003)(5660300002)(478600001)(44832011)(7696005)(30864003)(83380400001)(70206006)(70586007)(8936002)(8676002)(4326008)(36756003)(19627235002)(316002)(36860700001)(82740400003)(40480700001)(2616005)(356005)(966005)(40460700003)(26005)(1076003)(41300700001)(47076005)(336012)(426003)(86362001)(6666004)(15650500001)(82310400005)(2906002)(36900700001)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB7014 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c7ce3a73-a6a6-441e-fe7e-08da65b90b89 X-Microsoft-Antispam-Message-Info: 9k2XrYyTAg8JdTNuqMtPm8Ahgab0eGIK9IwdHhXLke1BgScAyee62dkKf96o0QtkFdRYVsHQZ+aeT7qK26WBrY6i92Yc/OSEhievSoYq5BY/34KiNKhkrq8SQLH4KLVOuXfJnyQc7a8/Bs5dCDwrUY5kN9xXdsnV6S1t/7an2WglXbm3x3VMFAWKN0MkeI8FiTRUjOTKrzjCWOHEgAbCVCGKzHg2Ubfltpv584362xqSKzwwNHZRLGhC64yqEYJ8kHkGpRafqJ/l84GkOMn/qM5+8qcDVTJhKh7np7r8EwPKRBt4WK35DjNphzNXKwpH6p2x95d65XbSrBSEe1uqGCWb80sH8nYs+uOWfsA2cf0B+5IRv2BjyEw8X5RN7O/+tDhdGH9Ax67HROK0UixPViNzIWLn2geq3IRskwzpASEWExEaCTJDQTPzHwUZbifO7HpgMcnCCNc8B85+8Nx6h1l9FC256l0E7J77cmEwMqfuHoYfX/BIvS65PyAsTQe600LgDjDgFkanHyZkQnzDihF19jHYzT1a1U7K3RqRXhuDBwH/4uVrlGGrJh4DWDDafMfKHlilUoKzytqQwbl5A1RlVanwVRKjIcZ5lfWkHLcNDRta63chZMGgCrArGgH2x0eY7erqbGHnkcUj3UxyKksoE1e4/kMf1oV9sz+rA2P0gv9TJJ70BJYGOJ4kMRIppQuHI3gAEDKXbnCuaZP6gV1aJmIuUz3GiSSjrVZD672ZkvlyCsZ1gF0ykQnTf5c2SsDHys8eNmgKMIivpr016ibR8y9Mqq2Sv9tagvgh4wkBh+TcF52aLD0xaqAuF9yR1nH+IZKyJtZ0ZszKlPZu3vwPPMCdtn6O1T666A3Q2QhyOi2q9ESXetNHxMK4aIu9 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 16:51:14.8369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9353ed39-cc57-4c4d-70c3-08da65b910aa 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: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2823 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: gJNqU44xEZNR5LR0dW6I3qbSx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1657817481; bh=ObeXOl6FA4OjkCgtDY2mjtiTXLTfkcEjRfE0F8cTduI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=U6OZ11sux+Xd0fD49ICRit4+AVY/PJdQW7dxc3GMaLL1+en5WKi9KPO1I58bOc7y6y2 1MltT3o8r3vg4rsz4fh9kmMoHXL4nMIC9IDnJ0ED0FbWSrJnefrwOn+zWozV5vZCvvBlc EbOeM/N+1lI9xS8BxUG2/h8QCWFDI0dzF3o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1657817483672100009 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. - Added checks to not generate IORT Rev E, Rev E.. Signed-off-by: Sami Mujawar Reviewed-by: Pierre Gondois --- Notes: v6: - Add check to not generate IORT Rev E, E.. [PIERR= E] - Added checks to not generate IORT table Rev E, E.. [SAMI] =20 v5: - Change IORT revision macro name to make it similar to [THOMA= S] macro names for other ACPI tables. - Updated IORT revision macros from [SAMI] EFI_ACPI_IO_REMAPPING_TABLE_REVx to EFI_ACPI_IO_REMAPPING_TABLE_REVISION_0x Ref: https://edk2.groups.io/g/devel/message/91119 - Minor updates initialise RcNode.PasidCapabilities in [SAMI] case of EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00 so that backward compatibility is maintained. =20 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 | 655 +++= +++++++++++++++-- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h | 5 +- 2 files changed, 610 insertions(+), 50 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 63381441e2d6515a7cc9731c89b9739a12c65599..40d99162cc610de2d0c2f0a5fff= 6e457c08d07fb 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,19 @@ 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.Identifier =3D EFI_ACPI_RESERVED_DWORD; ItsGroupNode->Node.NumIdMappings =3D 0; ItsGroupNode->Node.IdReference =3D 0; =20 + if (AcpiTableInfo->AcpiTableRevision < + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) + { + 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 +946,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 +963,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 +999,18 @@ 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.Identifier =3D EFI_ACPI_RESERVED_DWORD; NcNode->Node.NumIdMappings =3D NodeList->IdMappingCount; =20 + if (AcpiTableInfo->AcpiTableRevision < + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) + { + 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 +1091,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 +1108,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 +1142,23 @@ 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.Identifier =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_REVISION_05) + { + RcNode->Node.Revision =3D 1; + RcNode->Node.Identifier =3D EFI_ACPI_RESERVED_DWORD; + RcNode->PasidCapabilities =3D EFI_ACPI_RESERVED_WORD; + } 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; @@ -1018,7 +1167,6 @@ AddRootComplexNodes ( RcNode->AtsAttribute =3D NodeList->AtsAttribute; RcNode->PciSegmentNumber =3D NodeList->PciSegmentNumber; RcNode->MemoryAddressSize =3D NodeList->MemoryAddressSize; - RcNode->PasidCapabilities =3D EFI_ACPI_RESERVED_WORD; RcNode->Reserved1[0] =3D EFI_ACPI_RESERVED_BYTE; =20 if (NodeList->IdMappingCount > 0) { @@ -1134,6 +1282,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. @@ -1150,6 +1299,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, @@ -1186,8 +1336,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.Identifier =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) + @@ -1196,6 +1344,16 @@ AddSmmuV1V2Nodes ( (NodeList->PmuInterruptCount * sizeof (EFI_ACPI_6_0_IO_REMAPPING= _SMMU_INT))); =20 + if (AcpiTableInfo->AcpiTableRevision < + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) + { + 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; @@ -1339,6 +1497,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. @@ -1353,6 +1512,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, @@ -1385,12 +1545,20 @@ 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.Identifier =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_REVISION_05) + { + 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; @@ -1468,6 +1636,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. @@ -1482,6 +1651,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, @@ -1516,12 +1686,20 @@ 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.Identifier =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_REVISION_05) + { + 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; @@ -1588,6 +1766,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 @@ -1632,6 +2078,7 @@ BuildIortTable ( UINT32 SmmuV1V2NodeCount; UINT32 SmmuV3NodeCount; UINT32 PmcgNodeCount; + UINT32 RmrNodeCount; =20 UINT32 ItsGroupOffset; UINT32 NamedComponentOffset; @@ -1639,6 +2086,7 @@ BuildIortTable ( UINT32 SmmuV1V2Offset; UINT32 SmmuV3Offset; UINT32 PmcgOffset; + UINT32 RmrOffset; =20 CM_ARM_ITS_GROUP_NODE *ItsGroupNodeList; CM_ARM_NAMED_COMPONENT_NODE *NamedComponentNodeList; @@ -1646,6 +2094,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; @@ -1672,6 +2121,16 @@ BuildIortTable ( return EFI_INVALID_PARAMETER; } =20 + if ((AcpiTableInfo->AcpiTableRevision > EFI_ACPI_IO_REMAPPING_TABLE_REVI= SION_00) && + (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REVI= SION_05)) + { + DEBUG (( + DEBUG_ERROR, + "ERROR: IORT: Revisions E (1), E.a(2),b(3),c(4) are not supported.\n" + )); + return EFI_INVALID_PARAMETER; + } + Generator =3D (ACPI_IORT_GENERATOR *)This; *Table =3D NULL; =20 @@ -1789,6 +2248,29 @@ BuildIortTable ( // Add the PMCG node count IortNodeCount +=3D PmcgNodeCount; =20 + if (AcpiTableInfo->AcpiTableRevision >=3D + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) + { + // 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) * @@ -1998,6 +2480,40 @@ BuildIortTable ( )); } =20 + // RMR Nodes + if ((AcpiTableInfo->AcpiTableRevision >=3D + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) && + (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" \ @@ -2019,6 +2535,21 @@ BuildIortTable ( goto error_handler; } =20 + // Validate that the identifiers for the nodes are unique + if (AcpiTableInfo->AcpiTableRevision >=3D + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) + { + 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) { @@ -2067,6 +2598,7 @@ BuildIortTable ( Status =3D AddItsGroupNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, ItsGroupOffset, ItsGroupNodeList, @@ -2086,6 +2618,7 @@ BuildIortTable ( Status =3D AddNamedComponentNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, NamedComponentOffset, NamedComponentNodeList, @@ -2105,6 +2638,7 @@ BuildIortTable ( Status =3D AddRootComplexNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, RootComplexOffset, RootComplexNodeList, @@ -2124,6 +2658,7 @@ BuildIortTable ( Status =3D AddSmmuV1V2Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV1V2Offset, SmmuV1V2NodeList, @@ -2143,6 +2678,7 @@ BuildIortTable ( Status =3D AddSmmuV3Nodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, SmmuV3Offset, SmmuV3NodeList, @@ -2162,6 +2698,7 @@ BuildIortTable ( Status =3D AddPmcgNodes ( This, CfgMgrProtocol, + AcpiTableInfo, Iort, PmcgOffset, PmcgNodeList, @@ -2170,7 +2707,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; @@ -2255,9 +2812,9 @@ 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_4_IO_REMAPPING_TABLE_SIGNATURE, // ACPI Table Revision supported by this Generator - EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00, + EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05, // Minimum supported ACPI Table Revision EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00, // Creator ID 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 (#91362): https://edk2.groups.io/g/devel/message/91362 Mute This Topic: https://groups.io/mt/92383467/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-