From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.74]) by mx.groups.io with SMTP id smtpd.web10.9999.1657817474727756330 for ; Thu, 14 Jul 2022 09:51:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=e8MpzX9J; spf=pass (domain: arm.com, ip: 40.107.21.74, mailfrom: sami.mujawar@arm.com) 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]) 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=hYBSszMBHXrSHp9sCk17+IBGgWviSYGM6cgKYkTa4Ts=; b=e8MpzX9Jw/DOiSVQbHU42EhrnIN4XZFxbI4egm7btu5gKVyWikm9YEqymRrYYT8ON5MKbnM5ybTrUng5Z8+mzQkapTFaYKLHd/1SN2xvBR0PV0MKTymsMFz+lbkCgjILewtmGuOhonX/lTKGMCWleclsSUe09sOxZlc+Ufr++Us= 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 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 (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 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 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 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 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 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=hYBSszMBHXrSHp9sCk17+IBGgWviSYGM6cgKYkTa4Ts=; b=e8MpzX9Jw/DOiSVQbHU42EhrnIN4XZFxbI4egm7btu5gKVyWikm9YEqymRrYYT8ON5MKbnM5ybTrUng5Z8+mzQkapTFaYKLHd/1SN2xvBR0PV0MKTymsMFz+lbkCgjILewtmGuOhonX/lTKGMCWleclsSUe09sOxZlc+Ufr++Us= 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 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 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 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 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: [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> X-Mailer: git-send-email 2.16.2.windows.1 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 Return-Path: Sami.Mujawar@arm.com 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: BCL:0; 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-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:(13230016)(4636009)(376002)(39860400002)(396003)(346002)(136003)(36840700001)(46966006)(40470700004)(26005)(81166007)(6916009)(70586007)(7696005)(82310400005)(41300700001)(478600001)(6666004)(8676002)(40460700003)(86362001)(316002)(70206006)(54906003)(4326008)(83380400001)(426003)(2616005)(36860700001)(1076003)(336012)(186003)(47076005)(82740400003)(36756003)(8936002)(40480700001)(5660300002)(44832011)(2906002);DIR:OUT;SFP:1101; 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 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 Reviewed-by: Pierre Gondois --- Notes: v6: - No code change since v1. Re-sending with v6 series. [SAMI] v5: - No code change since v1. Re-sending with v5 series. [SAMI] v4: - No code change since v1. Re-sending with v4 series. [SAMI] v3: - No code change since v1. Re-sending with v3 series. [SAMI] 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..a4dd3d4a895e0a1ae305c937d9a413665fb8e171 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 = 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; @@ -1007,7 +1007,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; @@ -1188,11 +1189,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; @@ -1360,8 +1362,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; @@ -1491,7 +1493,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)'