From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.72]) by mx.groups.io with SMTP id smtpd.web08.93.1623775024115801509 for ; Tue, 15 Jun 2021 09:37:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=qAFtmipa; spf=pass (domain: arm.com, ip: 40.107.1.72, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lA95Ius7tOpFMqu0tSKKFJ5wwM40SwZkHub7i/tej3k=; b=qAFtmipai4aHB2WS5a3/bZvig7TDiFzUHHRkkUYHYD+KDYNS+BWtef95qgY/pcSohzCIhfw2pKs5Uw8JHNbQCMouVFNNETp7K1c0S/3Xohkb56uqgPy4DVz6TjUTPhcL+CPsN9VGgyasqE9NdsmyO/Y1Y9cFLSgW2Rgr3GqXhY8= Received: from PR3P251CA0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::15) by PAXPR08MB6701.eurprd08.prod.outlook.com (2603:10a6:102:132::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Tue, 15 Jun 2021 16:36:56 +0000 Received: from VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:102:b5:cafe::45) by PR3P251CA0017.outlook.office365.com (2603:10a6:102:b5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Tue, 15 Jun 2021 16:36:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT040.mail.protection.outlook.com (10.152.18.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:55 +0000 Received: ("Tessian outbound a65d687b17e4:v93"); Tue, 15 Jun 2021 16:36:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2602545f0bdac044 X-CR-MTA-TID: 64aa7808 Received: from 501ffb91a300.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F43FB858-629B-447A-A250-20A9B20BECF3.1; Tue, 15 Jun 2021 16:36:49 +0000 Received: from FRA01-MR2-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 501ffb91a300.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 15 Jun 2021 16:36:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUfD5JI2HQ4i7QnhAoUrRsRoeXjQYlYJmU1Fs9X33+tCY+LvpBArMZ6NfP5MbRUum7n76MwANHSJJWM0UdGNkWdHaRLXmWkNpvKtwwd5ah8nMWpnc1ynuMILqyhvhif1BQntmENrSH5pjwa3Rsr+Z1LJ7Qjab9yTkEvntOYSBVpZtHhZEvENU0iSlwfDlQuxNiAlrPUyxKTGZTGpep9ChKuZObVBA2DJSWwQB53BFcRO7ULTPbkAVtM7sFG/LU9+DPYdQQUe0IrnSUR7Roh4MI4pn6zPd8uPZaPK9QVTq9E3PifKNovW//bm5/IzHExCTUdsqJpN41I779PTscJBXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lA95Ius7tOpFMqu0tSKKFJ5wwM40SwZkHub7i/tej3k=; b=GxucMek7Z+6gjJNadrHsuN5bxerUJ177TNEBQpYgkrJxuXJkjv06zAc6wasUlzv1odPsQ3nkhHgOz52WfdsHPC9NbsjRJGKXsn95KRXq6XPysKroIjNDkqd8wO9fbxSeOQFWPMf6wU8yhqqtcG64IJqLfDewyTtT3SdkGiay8n31tVusxurdiGMgNzZ5ATgabA8KIBGYhENQO+FFO2Ep2VexiIIg1dmKvv6P38HWByRoQDDbVYrKjOaK1wvlt21lEO5nN6VjlUGeTlNaiYLMJKi7FCbN1N714d657JyCnn7FNpgQoqV1skeXL6V52emWn10RH8E2Hy4Kl29sNWwWXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lA95Ius7tOpFMqu0tSKKFJ5wwM40SwZkHub7i/tej3k=; b=qAFtmipai4aHB2WS5a3/bZvig7TDiFzUHHRkkUYHYD+KDYNS+BWtef95qgY/pcSohzCIhfw2pKs5Uw8JHNbQCMouVFNNETp7K1c0S/3Xohkb56uqgPy4DVz6TjUTPhcL+CPsN9VGgyasqE9NdsmyO/Y1Y9cFLSgW2Rgr3GqXhY8= Received: from AM6P192CA0088.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::29) by PR2PR08MB4748.eurprd08.prod.outlook.com (2603:10a6:101:1f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Tue, 15 Jun 2021 16:36:43 +0000 Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::99) by AM6P192CA0088.outlook.office365.com (2603:10a6:209:8d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.22 via Frontend Transport; Tue, 15 Jun 2021 16:36:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 16:36:42 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 15 Jun 2021 16:36:22 +0000 Received: from E114225.Arm.com (10.1.196.43) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 15 Jun 2021 16:36:22 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , Subject: [PATCH v1 5/8] DynamicTablesPkg: IORT set reference to Id array only if present Date: Tue, 15 Jun 2021 17:36:15 +0100 Message-ID: <20210615163618.85200-6-sami.mujawar@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20210615163618.85200-1-sami.mujawar@arm.com> References: <20210615163618.85200-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ef7ee87-2be2-4798-2447-08d9301bc9f1 X-MS-TrafficTypeDiagnostic: PR2PR08MB4748:|PAXPR08MB6701: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zAH/V32KPCVl2bQVDxObcgioZHc7D1tapXJkqX+6s/MiIieP0IW6Og6NicBNzNTKea56Q9lJLggw4LwlKGcCWOhP4ysWDtJeRNsjvCNO9OPvwLeiXBKDFANbtYzgUAj/HBWw9h4jiCcJ1+N3ZfVPS7s/8yn5Utt8KlbPBUyyiYOfRGhugqpxiVDSTf2afYMCwXtDLKp4UTnS+NUzFCVFJWomMeSnIcM07j8SLcQM1OlllmVO4lUddLzV7PWsDIS6BbNsO6YW2xyJO4EFZeYDHM/vAW8W/guEx4gXDGnFgsNps+GRAtP+idkDUmTgigJbRdrEN9sIALQmqGx2+7VmislwmZ13lLXJa7dEokC7cDePDoMgJ+yfjn8TraYFPFMmHVw9M6rA1DvV+hMYKP22GdOYn1hf1itx4wivpEgKAaTs5UzkPti+E+aI7OxFVT7xUHw5MAb+PF0R96yIkrW0BDeaGh1DlwrjBfmNB0BPWgA9DpyennusFkrmHs+M3rx+gb19OYhJguK5WmH5PiWvQbe5/bn4sOCx61oorUiXPHaygRXrprZHsnyMKRbednh8j7GmTTaq92B6R5TinQYLRGynpvJzr7wd6Ctf5STGMcR+VJNrdu2Q1P0sWTAL+cMtHkwiHHjR8wpqvyIkdfrJt5vM2knpBUFjPnK41KSbVHgDIHKp78xexm7VM4EKb/5S X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(396003)(39850400004)(136003)(376002)(346002)(36840700001)(46966006)(47076005)(6916009)(81166007)(6666004)(54906003)(70206006)(36860700001)(4326008)(316002)(70586007)(83380400001)(1076003)(26005)(2616005)(478600001)(36756003)(336012)(7696005)(82310400003)(86362001)(44832011)(2906002)(426003)(186003)(5660300002)(8936002)(82740400003)(8676002)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4748 Return-Path: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f966e6b3-acb3-4088-7a80-08d9301bc213 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ONRs+UzBZK6WZp5C9gRBDCGqspaTYxuYtodiyAzRcUKy6Desy76+s2mq+uBxV50CNtQouRvMhc/yrpmo0SmIGHI1D4G/NWFafj0uO19VTl5hVOvaLZgJiGWBdNAv6XZd7cnzz/Etw+vs5UWYfVrJIQtYNvPb70Ng+Y/YnXtBhTtf6RlzQ3KJzWga5pavoIdGanGdPbbKL/xTqaq8elzEki038FTfG3n3MpDIrqFIh4smchTgcbBXXSoFNkheSuhRwpBbyMHhV3y5wXMKmu5+9BUrFaAnEmFwpSkznk2mKObVQuEVX3OCCR4SFPz7GtyBSt2ELnEBnXhunD0ot2jHKfy5C857zbP+94UJ/Qh6RE61146BH9xyipkjH7y3XUw6T7yckr3sCurFc0yXb4HUxHddpftQcujGVri/OslG0B+bJlXX8StW5rdNyK54EIenfF6bjgp4IYuK+nS4amHA64s2ebAGZNaxVisMHHcxCDqlnY0j/PAADz0JHeyptNeNPqcR//FVxIcqXgMUBrenSSA2lr07lnUAPWcsESoqI9lMyxGvjjufir8mIgY+jb+1rVGHkVvWVXSPXo76DnSvYjtgH+zBupNp+JoD8F7a5Xpul05jLwfuWMtFctgUl87nEi0giNqaRQnqU0wa/LW1xhXQm+HqWJBct9T+HuQEK+o= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(396003)(136003)(39850400004)(376002)(346002)(36840700001)(46966006)(83380400001)(81166007)(186003)(426003)(36756003)(336012)(316002)(2616005)(54906003)(478600001)(26005)(7696005)(6916009)(1076003)(6666004)(47076005)(44832011)(8676002)(5660300002)(4326008)(70206006)(2906002)(36860700001)(82740400003)(82310400003)(8936002)(70586007)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 16:36:55.8710 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ef7ee87-2be2-4798-2447-08d9301bc9f1 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: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6701 Content-Type: text/plain 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 --- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 349caa8006bc34ca789cb3e321a0f87c0cd4ff0d..bdf839eab25e2b84b40c50da38f2bf961cdc5f42 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 - Copyright (c) 2017 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2017 - 2021, Arm Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @par Reference(s): @@ -870,9 +870,9 @@ AddNamedComponentNodes ( NcNode->Node.NumIdMappings = NodeList->IdMappingCount; ObjectNameLength = AsciiStrLen (NodeList->ObjectName) + 1; - NcNode->Node.IdReference = - (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + - (ALIGN_VALUE (ObjectNameLength, 4))); + NcNode->Node.IdReference = (NodeList->IdMappingCount == 0) ? + 0 : ((UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) + + (ALIGN_VALUE (ObjectNameLength, 4)))); // Named Component specific data NcNode->Flags = NodeList->Flags; @@ -990,7 +990,8 @@ AddRootComplexNodes ( RcNode->Node.Revision = 1; RcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; RcNode->Node.NumIdMappings = NodeList->IdMappingCount; - RcNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE); + RcNode->Node.IdReference = (NodeList->IdMappingCount == 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE); // Root Complex specific data RcNode->CacheCoherent = NodeList->CacheCoherent; @@ -1160,11 +1161,12 @@ AddSmmuV1V2Nodes ( SmmuNode->Node.Revision = 0; SmmuNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; SmmuNode->Node.NumIdMappings = NodeList->IdMappingCount; - SmmuNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) + - (NodeList->ContextInterruptCount * - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) + - (NodeList->PmuInterruptCount * - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)); + SmmuNode->Node.IdReference = (NodeList->IdMappingCount == 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))); // SMMU v1/v2 specific data SmmuNode->Base = NodeList->BaseAddress; @@ -1319,8 +1321,8 @@ AddSmmuV3Nodes ( SmmuV3Node->Node.Revision = 2; SmmuV3Node->Node.Reserved = EFI_ACPI_RESERVED_DWORD; SmmuV3Node->Node.NumIdMappings = NodeList->IdMappingCount; - SmmuV3Node->Node.IdReference = - sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); + SmmuV3Node->Node.IdReference = (NodeList->IdMappingCount == 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE); // SMMUv3 specific data SmmuV3Node->Base = NodeList->BaseAddress; @@ -1438,7 +1440,8 @@ AddPmcgNodes ( PmcgNode->Node.Revision = 1; PmcgNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD; PmcgNode->Node.NumIdMappings = NodeList->IdMappingCount; - PmcgNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE); + PmcgNode->Node.IdReference = (NodeList->IdMappingCount == 0) ? + 0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE); // PMCG specific data PmcgNode->Base = NodeList->BaseAddress; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'