From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=nrlIILUJ; spf=pass (domain: arm.com, ip: 40.107.4.86, mailfrom: alexei.fedorov@arm.com) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (EUR03-DB5-obe.outbound.protection.outlook.com [40.107.4.86]) by groups.io with SMTP; Fri, 23 Aug 2019 04:54:25 -0700 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=9jkWJztWawo5GlMram36/ilYzTZJ8AFtbVMFSXeo1G0=; b=nrlIILUJQ0b8k3k02k7TSrIf6NIJQHq8fc5SrC4zIqkVulio8D3V+CCEIvXuIk/ZwhqI0P95oMaACEFH5ml6dsuLSVgbeZwKqN5S6X56UOpLbY3Fw3BvnOjQovKGuLmfGGkZd5flVWr58OXQDUmFahhxMn3leEzZSMA2XfmTLXg= Received: from VI1PR0802CA0003.eurprd08.prod.outlook.com (2603:10a6:800:aa::13) by HE1PR0802MB2603.eurprd08.prod.outlook.com (2603:10a6:3:e0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 11:54:20 +0000 Received: from DB5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::200) by VI1PR0802CA0003.outlook.office365.com (2603:10a6:800:aa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.14 via Frontend Transport; Fri, 23 Aug 2019 11:54:19 +0000 Authentication-Results: spf=temperror (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=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT020.mail.protection.outlook.com (10.152.20.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 11:54:18 +0000 Received: ("Tessian outbound 4ee777a495a5:v27"); Fri, 23 Aug 2019 11:54:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e9232b8bdecb1c1a X-CR-MTA-TID: 64aa7808 Received: from 28a624b84811.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.6.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id F280520E-3DBE-4586-85DD-236083ADBCE0.1; Fri, 23 Aug 2019 11:54:12 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02lp2054.outbound.protection.outlook.com [104.47.6.54]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 28a624b84811.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 23 Aug 2019 11:54:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wd8Cx7QYiJZazMMtXhE3Fzk33bHmNjXT8IKAw6YtiPULRMvw5l7Bt9t9e26qWhPL4N5Ygqitp/OW08eZpqW1RpRSkGpSRCpBJ3rp83x4ZKjLGB1uFEayzQX9CKw1y+WdHzIBFjah5oJ7sLrb+kV1ttFF79wzp96f03ItxZbyrtpYv81Q8SR6Jmu67KLPc5HCHucYMkULvquh00pUCBqzxszuiCV2UOGUI0N2fK7I6S4dea9h5gCd5KJ+98UZJmdwlRwR87m/Lz629rbhMJS30jLJb/k13O6i8mS+DZvxnL+d5uJGdtWOQf+5rpY0Icc76enxq0T0zBCCUkJGSSy+ZQ== 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=TWJvEQuCuXWZzq5IFOeQuotylNpPwwKDM5uhgIchYN0=; b=dATs2CvWQqZIiIjgpxsUEAdDuBVQ5jTQ2l35XGrnDz1A3wvK8+z3QvICIimCn9jwIgckZWKg2beyMDnyXoelwCQk2WOIJdzfXHqkov+WQ52GrEQfcYBW/SgVeGj922RZSwh9Nxd7Kvx4QZU5sM0Go4d3oMysYxNASjC/PMG3t53fZNmFEVHYYckT2iNKbfB4+D88hFjTbPLIGX/hhBVCNowULYmMXckny7eTj42pUP5biTGEw/+JxcpfVM1uWPjfied0HhDYZ4I26xiP7oHqnEO8wfFHu3aexlaViavWHASTWOJePsU+gPs/TvYboBjtLHFmon5NF6Dznxivyf5uHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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=TWJvEQuCuXWZzq5IFOeQuotylNpPwwKDM5uhgIchYN0=; b=KXnU6wvW2wiQbgasc9b7HqepqiOCnYSrAOtNZHN7Ckj7aPSeejc/FzAjTtnB3t9MOXdHsT7t/NXClMuKf4hKpgFdd8uTcDNqSJHO8uFCVF0OJA9lNlc98o0E3PLY9o2vpD6wccUbAmvf+gzRlXAYLogyim09Veqc00GqbDog4hY= Received: from AM5PR0801MB1732.eurprd08.prod.outlook.com (10.169.244.21) by AM5PR0801MB1699.eurprd08.prod.outlook.com (10.169.247.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.16; Fri, 23 Aug 2019 11:54:11 +0000 Received: from AM5PR0801MB1732.eurprd08.prod.outlook.com ([fe80::50d7:cef5:ee39:2e83]) by AM5PR0801MB1732.eurprd08.prod.outlook.com ([fe80::50d7:cef5:ee39:2e83%9]) with mapi id 15.20.2178.020; Fri, 23 Aug 2019 11:54:11 +0000 From: "Alexei Fedorov" To: Sami Mujawar , "devel@edk2.groups.io" Subject: Re: [PATCH v1 09/19] DynamicTablesPkg: Fix unaligned pointers usage Thread-Topic: [PATCH v1 09/19] DynamicTablesPkg: Fix unaligned pointers usage Thread-Index: AQHVWaGEs3uLLvRmmEG570tUC9PWJ6cIn6O8 Date: Fri, 23 Aug 2019 11:54:11 +0000 Message-ID: References: <20190823105539.13260-1-sami.mujawar@arm.com>,<20190823105539.13260-10-sami.mujawar@arm.com> In-Reply-To: <20190823105539.13260-10-sami.mujawar@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Alexei.Fedorov@arm.com; x-originating-ip: [217.140.106.49] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 43a92d92-3798-4a5d-608e-08d727c0a102 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:AM5PR0801MB1699; X-MS-TrafficTypeDiagnostic: AM5PR0801MB1699:|HE1PR0802MB2603: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:3826;OLM:3826; x-forefront-prvs: 0138CD935C X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(136003)(346002)(39860400002)(366004)(396003)(376002)(199004)(189003)(3846002)(6246003)(6116002)(7696005)(66446008)(66476007)(71200400001)(33656002)(2906002)(86362001)(55016002)(76176011)(64756008)(52536014)(256004)(53936002)(14444005)(74316002)(7736002)(478600001)(5660300002)(66066001)(105004)(25786009)(446003)(11346002)(19627405001)(110136005)(99286004)(66556008)(81166006)(2501003)(102836004)(6506007)(8936002)(186003)(53546011)(26005)(316002)(486006)(9686003)(14454004)(76116006)(229853002)(71190400001)(81156014)(8676002)(54896002)(476003)(66946007)(6436002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0801MB1699;H:AM5PR0801MB1732.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: PYiBobkDYCCJJuTLrBpPrqe55AM/GYdugAMsENGNiJIFnwGrIxWy4alAuCkNHQT9Bn9S59jpekyWMcZlHAqJoFp7ydV/biM0s1+DtAX7IMAZ2upQNwyGUPIuGpGbNoZ9tHvlo8jtFMJf6zwvxJuLRwUWdRUQIW5iKhF88HFt7znRHVAxuysxJ+wbkIlPodwR9H47U5+Q4VlT/pkJfR4FnL0m/JOSbs02G15Hp8ByCDVHDZESyp1GpPhUAM1+XfWCKuJl+dd3ihvWKaoYPS9JdX7mnU6wh/L0no489pRHsXvYqodDbcTVRX1XsN/o+h5s/oIdTpmMTN4S8wFWHOeCZ6duCPfRGJ3eC/mhOY8NBFG1XCMEvO3UCy5rjBuYV6J5A6hiGY+bCv5S0T9kL1dYl05DGvnwJ+HvB6Y9MpXeZ/w= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1699 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alexei.Fedorov@arm.com; Return-Path: Alexei.Fedorov@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;IPV:CAL;SCL:-1;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(346002)(376002)(396003)(39860400002)(136003)(2980300002)(40434004)(199004)(189003)(55016002)(71190400001)(5024004)(2501003)(76176011)(14444005)(25786009)(86362001)(22756006)(3846002)(6116002)(19627405001)(9686003)(229853002)(70206006)(70586007)(8936002)(110136005)(16586007)(81156014)(7696005)(81166006)(14454004)(316002)(8676002)(66066001)(105004)(7736002)(186003)(26005)(336012)(53546011)(6506007)(102836004)(2906002)(356004)(5660300002)(30864003)(76130400001)(6246003)(54896002)(99286004)(63370400001)(63350400001)(478600001)(11346002)(446003)(26826003)(74316002)(52536014)(33656002)(126002)(486006)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2603;H:64aa7808-outbound-1.mta.getcheckrecipient.com;FPR:;SPF:TempError;LANG:en;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;A:1;MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 43a60eef-f41e-467e-26f1-08d727c09cd5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(710020)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:HE1PR0802MB2603; X-Forefront-PRVS: 0138CD935C X-Microsoft-Antispam-Message-Info: Wl1X4zVpzRQTLI3Z7KFGATKE8rwulo2mq52Bf9ihBBZYEsZEDgXo4zn9UVv6xzov01vq2JZwOy8yJMrI8LEOAvAOI6OVV2lymYL9VwLUeyptz2+a9zv8RB9AJIXJH4BV7sCyqsv+eb/MP/KPR1A6bbyNcMNYexGdqvak92fBkCgdmCrsO0LxdDDNwDuua9gulJbH1SeeO7FagAcUb2G97fh91e6vxbjTj0NeyjA0bk78RA9euEBMvJEWXMJzYvFzL04J0jpDlHO6IbR3EBzV4uUqTiAknsLcw3TPSL45707lXffukui2fhPpnnChfejvzvagzhi3Yf9fOhsj3ZFyJ2c9D5cTaUuLIB33/KQoCWSZhJ1lC6F/hQyEUmC9BTyoW5Ssvp3T+0hWQ7uvYOw/IStdn9Y3ul814OAzc0JI4LQ= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 11:54:18.3995 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43a92d92-3798-4a5d-608e-08d727c0a102 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2603 Content-Language: en-GB Content-Type: multipart/alternative; boundary="_000_AM5PR0801MB173265CB438ACBAE210211359AA40AM5PR0801MB1732_" --_000_AM5PR0801MB173265CB438ACBAE210211359AA40AM5PR0801MB1732_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Alexei Fedorov Alexei ________________________________ From: Sami Mujawar Sent: 23 August 2019 11:55 To: devel@edk2.groups.io Cc: Sami Mujawar ; Alexei Fedorov ; leif.lindholm@linaro.org ; Matteo Carlini = ; nd Subject: [PATCH v1 09/19] DynamicTablesPkg: Fix unaligned pointers usage The VS2017 compiler reports 'warning C4366: The result of the unary '&' operator may be unaligned' if an address of an unaligned structure member is passed as an argument to a function. Fix this warning by using local variables in place of unaligned structure members. Signed-off-by: Sami Mujawar --- DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c | 24 ++++= +++++++++++----- DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h | 13 ++++= +------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c index 40699ce113caa8530c89ac20562cf5abda26b88e..82070403ac8757f54e839fd00eb= 4acb3292fc60c 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c @@ -1066,6 +1066,9 @@ BuildPpttTable ( EFI_STATUS Status; UINT32 TableSize; UINT32 ProcTopologyStructCount; + UINT32 ProcHierarchyNodeCount; + UINT32 CacheStructCount; + UINT32 IdStructCount; UINT32 ProcHierarchyNodeOffset; UINT32 CacheStructOffset; @@ -1113,7 +1116,7 @@ BuildPpttTable ( CfgMgrProtocol, CM_NULL_TOKEN, &ProcHierarchyNodeList, - &Generator->ProcHierarchyNodeCount + &ProcHierarchyNodeCount ); if (EFI_ERROR (Status)) { DEBUG (( @@ -1124,7 +1127,8 @@ BuildPpttTable ( goto error_handler; } - ProcTopologyStructCount =3D Generator->ProcHierarchyNodeCount; + ProcTopologyStructCount =3D ProcHierarchyNodeCount; + Generator->ProcHierarchyNodeCount =3D ProcHierarchyNodeCount; // Get the cache info and update the processor topology structure count = with // Cache Type Structures (Type 1) @@ -1132,7 +1136,7 @@ BuildPpttTable ( CfgMgrProtocol, CM_NULL_TOKEN, &CacheStructList, - &Generator->CacheStructCount + &CacheStructCount ); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { DEBUG (( @@ -1143,7 +1147,8 @@ BuildPpttTable ( goto error_handler; } - ProcTopologyStructCount +=3D Generator->CacheStructCount; + ProcTopologyStructCount +=3D CacheStructCount; + Generator->CacheStructCount =3D CacheStructCount; // Get the processor hierarchy node ID info and update the processor top= ology // structure count with ID Structures (Type 2) @@ -1151,7 +1156,7 @@ BuildPpttTable ( CfgMgrProtocol, CM_NULL_TOKEN, &IdStructList, - &Generator->IdStructCount + &IdStructCount ); if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND)) { DEBUG (( @@ -1163,7 +1168,8 @@ BuildPpttTable ( goto error_handler; } - ProcTopologyStructCount +=3D Generator->IdStructCount; + ProcTopologyStructCount +=3D IdStructCount; + Generator->IdStructCount =3D IdStructCount; // Allocate Node Indexer array NodeIndexer =3D (PPTT_NODE_INDEXER*)AllocateZeroPool ( @@ -1475,6 +1481,12 @@ ACPI_PPTT_GENERATOR PpttGenerator =3D { // Processor topology node count 0, + // Count of Processor Hierarchy Nodes + 0, + // Count of Cache Structures + 0, + // Count of Id Structures + 0, // Pointer to PPTT Node Indexer NULL }; diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator= .h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h index 6a0fdd08e1533c57285f420555586314c70a5ed5..0a14da502d595e27d87262b1bac= 681318f1d9ced 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h @@ -167,6 +167,12 @@ typedef struct AcpiPpttGenerator { ACPI_TABLE_GENERATOR Header; /// PPTT structure count UINT32 ProcTopologyStructCount; + /// Count of Processor Hierarchy Nodes + UINT32 ProcHierarchyNodeCount; + /// Count of Cache Structures + UINT32 CacheStructCount; + /// Count of Id Structures + UINT32 IdStructCount; /// List of indexed CM objects for PPTT generation PPTT_NODE_INDEXER * NodeIndexer; /// Pointer to the start of Processor Hierarchy nodes in @@ -176,13 +182,6 @@ typedef struct AcpiPpttGenerator { PPTT_NODE_INDEXER * CacheStructIndexedList; /// Pointer to the start of Id Structures in the Node Indexer array PPTT_NODE_INDEXER * IdStructIndexedList; - /// Count of Processor Hierarchy Nodes - UINT32 ProcHierarchyNodeCount; - /// Count of Cache Structures - UINT32 CacheStructCount; - /// Count of Id Structures - UINT32 IdStructCount; - } ACPI_PPTT_GENERATOR; #pragma pack() -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. --_000_AM5PR0801MB173265CB438ACBAE210211359AA40AM5PR0801MB1732_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>

Alexei


From: Sami Mujawar <sami= .mujawar@arm.com>
Sent: 23 August 2019 11:55
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>; Alexei Fedorov <Al= exei.Fedorov@arm.com>; leif.lindholm@linaro.org <leif.lindholm@linaro= .org>; Matteo Carlini <Matteo.Carlini@arm.com>; nd <nd@arm.com&= gt;
Subject: [PATCH v1 09/19] DynamicTablesPkg: Fix unaligned pointers u= sage
 
The VS2017 compiler reports 'warning C4366: The re= sult of
the unary '&' operator may be unaligned' if an address of
an unaligned structure member is passed as an argument to
a function.

Fix this warning by using local variables in place of
unaligned structure members.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
 DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c | 24= +++++++++++++++= ;-----
 DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h | 13= +++++------
 2 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator= .c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
index 40699ce113caa8530c89ac20562cf5abda26b88e..82070403ac8757f54e839fd00eb= 4acb3292fc60c 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGene= rator.c
@@ -1066,6 +1066,9 @@ BuildPpttTable (
   EFI_STATUS        &nbs= p;             = Status;
   UINT32         &n= bsp;            = ;    TableSize;
   UINT32         &n= bsp;            = ;    ProcTopologyStructCount;
+  UINT32         &nb= sp;            =     ProcHierarchyNodeCount;
+  UINT32         &nb= sp;            =     CacheStructCount;
+  UINT32         &nb= sp;            =     IdStructCount;
 
   UINT32         &n= bsp;            = ;    ProcHierarchyNodeOffset;
   UINT32         &n= bsp;            = ;    CacheStructOffset;
@@ -1113,7 +1116,7 @@ BuildPpttTable (
            &nb= sp; CfgMgrProtocol,
            &nb= sp; CM_NULL_TOKEN,
            &nb= sp; &ProcHierarchyNodeList,
-             &= amp;Generator->ProcHierarchyNodeCount
+           &nbs= p; &ProcHierarchyNodeCount
            &nb= sp; );
   if (EFI_ERROR (Status)) {
     DEBUG ((
@@ -1124,7 +1127,8 @@ BuildPpttTable (
     goto error_handler;
   }
 
-  ProcTopologyStructCount =3D Generator->ProcHierarchyNodeCount; +  ProcTopologyStructCount =3D ProcHierarchyNodeCount;
+  Generator->ProcHierarchyNodeCount =3D ProcHierarchyNodeCount= ;
 
   // Get the cache info and update the processor topology struct= ure count with
   // Cache Type Structures (Type 1)
@@ -1132,7 +1136,7 @@ BuildPpttTable (
            &nb= sp; CfgMgrProtocol,
            &nb= sp; CM_NULL_TOKEN,
            &nb= sp; &CacheStructList,
-             &= amp;Generator->CacheStructCount
+           &nbs= p; &CacheStructCount
            &nb= sp; );
   if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND))= {
     DEBUG ((
@@ -1143,7 +1147,8 @@ BuildPpttTable (
     goto error_handler;
   }
 
-  ProcTopologyStructCount +=3D Generator->CacheStructCount; +  ProcTopologyStructCount +=3D CacheStructCount;
+  Generator->CacheStructCount =3D CacheStructCount;
 
   // Get the processor hierarchy node ID info and update the pro= cessor topology
   // structure count with ID Structures (Type 2)
@@ -1151,7 +1156,7 @@ BuildPpttTable (
            &nb= sp; CfgMgrProtocol,
            &nb= sp; CM_NULL_TOKEN,
            &nb= sp; &IdStructList,
-             &= amp;Generator->IdStructCount
+           &nbs= p; &IdStructCount
            &nb= sp; );
   if (EFI_ERROR (Status) && (Status !=3D EFI_NOT_FOUND))= {
     DEBUG ((
@@ -1163,7 +1168,8 @@ BuildPpttTable (
     goto error_handler;
   }
 
-  ProcTopologyStructCount +=3D Generator->IdStructCount;
+  ProcTopologyStructCount +=3D IdStructCount;
+  Generator->IdStructCount =3D IdStructCount;
 
   // Allocate Node Indexer array
   NodeIndexer =3D (PPTT_NODE_INDEXER*)AllocateZeroPool (
@@ -1475,6 +1481,12 @@ ACPI_PPTT_GENERATOR PpttGenerator =3D {
 
   // Processor topology node count
   0,
+  // Count of Processor Hierarchy Nodes
+  0,
+  // Count of Cache Structures
+  0,
+  // Count of Id Structures
+  0,
   // Pointer to PPTT Node Indexer
   NULL
 };
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator= .h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h
index 6a0fdd08e1533c57285f420555586314c70a5ed5..0a14da502d595e27d87262b1bac= 681318f1d9ced 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGene= rator.h
@@ -167,6 +167,12 @@ typedef struct AcpiPpttGenerator {
   ACPI_TABLE_GENERATOR  Header;
   /// PPTT structure count
   UINT32         &n= bsp;      ProcTopologyStructCount;
+  /// Count of Processor Hierarchy Nodes
+  UINT32         &nb= sp;      ProcHierarchyNodeCount;
+  /// Count of Cache Structures
+  UINT32         &nb= sp;      CacheStructCount;
+  /// Count of Id Structures
+  UINT32         &nb= sp;      IdStructCount;
   /// List of indexed CM objects for PPTT generation
   PPTT_NODE_INDEXER   * NodeIndexer;
   /// Pointer to the start of Processor Hierarchy nodes in
@@ -176,13 +182,6 @@ typedef struct AcpiPpttGenerator {
   PPTT_NODE_INDEXER   * CacheStructIndexedList;
   /// Pointer to the start of Id Structures in the Node Indexer = array
   PPTT_NODE_INDEXER   * IdStructIndexedList;
-  /// Count of Processor Hierarchy Nodes
-  UINT32          &= nbsp;     ProcHierarchyNodeCount;
-  /// Count of Cache Structures
-  UINT32          &= nbsp;     CacheStructCount;
-  /// Count of Id Structures
-  UINT32          &= nbsp;     IdStructCount;
-
 } ACPI_PPTT_GENERATOR;
 
 #pragma pack()
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in any medium. Thank you. --_000_AM5PR0801MB173265CB438ACBAE210211359AA40AM5PR0801MB1732_--