From nobody Tue Feb 10 14:33:10 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46268+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1566557837798148.55723362485276; Fri, 23 Aug 2019 03:57:17 -0700 (PDT) Return-Path: X-Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.49]) by groups.io with SMTP; Fri, 23 Aug 2019 03:57:16 -0700 X-Received: from HE1PR0802CA0010.eurprd08.prod.outlook.com (2603:10a6:3:bd::20) by AM6SPR01MB14.eurprd08.prod.outlook.com (2603:10a6:209:3c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Fri, 23 Aug 2019 10:57:11 +0000 X-Received: from AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by HE1PR0802CA0010.outlook.office365.com (2603:10a6:3:bd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.14 via Frontend Transport; Fri, 23 Aug 2019 10:57:11 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46268+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) 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.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:57:09 +0000 X-Received: ("Tessian outbound 4ee777a495a5:v27"); Fri, 23 Aug 2019 10:57:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fa66d4c7401ee795 X-CR-MTA-TID: 64aa7808 X-Received: from fb679d1035a9.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.14.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id AC5B32C6-EEAA-482C-8111-7298D68AA322.1; Fri, 23 Aug 2019 10:57:03 +0000 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2058.outbound.protection.outlook.com [104.47.14.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fb679d1035a9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Fri, 23 Aug 2019 10:57:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VgNq0KuVgglOd2uTVYuS4oDLZIt/2HbwrBRzC5Og8kujjkgL/MZkX+WObqDaZ93fTzaOyXIYXdg78FBLSrNbUi8mxR3ud5uycjaWRiBSxunoOTCkmugtpRQ1tjLboNepzj1dAE3gvdXsSOuLslzb/KuvPbb9tJ6+Rn4qi/HUHjaBPaPcesOqATsVzeNfGytYhcNbiqj6e/dslS9rYhffD+z6+CxiSGIdIIucEvYZ806QJVU7uq1hI/aTPyaVnOn5G0Cnjjc4gQd5B4F7jv4PBY0XjdTiM1ltj7nlOavu26l08IeYsB9sCxF4uICH+va2/guOuOA78QBTYN7QhqawMQ== 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=cZR+FSgHYiRws2EF1diUudTo/SgsxqLZWiWS5HL2Tsg=; b=HQnUqucqwUFrpjnvZA+1VIWBTEzkXc46PTLIXqj83oniQOe0I1/XkW365eUZ5hVnOhWH9V74/BjzeCGbxPrDdn/lLst+zR7iAQKHWADobyq07bBAW5+BZ6Cwt1Ovf+tLwmEKk3rzEJ+h/uKdoiXgXJiH+1yTgk+w0EZfHLeGzoC8hhCGy+wtl+OSts8+zryMmSzFtYIjiltfeh8pNqSpSxf0G/bCLwgyL2Q8L2YynuZlVnzxWRTng7bnI2nxCpJpTp+LnoId+SkhDJ1Nvm51gz9PbSt3UHMeD5LBrm5R1ZIn7hE3RRdJb5nm8Q27dZMLJlAkYazz5479wuAX5rgv0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=temperror action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from VE1PR08CA0019.eurprd08.prod.outlook.com (2603:10a6:803:104::32) 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 10:57:01 +0000 X-Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by VE1PR08CA0019.outlook.office365.com (2603:10a6:803:104::32) 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 10:57:00 +0000 Authentication-Results-Original: spf=temperror (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=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2199.13 via Frontend Transport; Fri, 23 Aug 2019 10:56:59 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Fri, 23 Aug 2019 10:56:22 +0000 X-Received: from E107187.Arm.com (10.1.195.55) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Fri, 23 Aug 2019 10:56:22 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , Subject: [edk2-devel] [PATCH v1 09/19] DynamicTablesPkg: Fix unaligned pointers usage Date: Fri, 23 Aug 2019 11:55:29 +0100 Message-ID: <20190823105539.13260-10-sami.mujawar@arm.com> In-Reply-To: <20190823105539.13260-1-sami.mujawar@arm.com> References: <20190823105539.13260-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:NLI;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(396003)(39860400002)(346002)(136003)(2980300002)(189003)(199004)(2616005)(76176011)(14444005)(86362001)(6916009)(70206006)(70586007)(1076003)(16586007)(81156014)(54906003)(7696005)(51416003)(81166006)(47776003)(316002)(8936002)(8676002)(305945005)(186003)(26005)(36756003)(336012)(50466002)(2906002)(50226002)(4326008)(356004)(5660300002)(2351001)(53416004)(63370400001)(478600001)(63350400001)(11346002)(446003)(426003)(44832011)(53936002)(126002)(48376002)(486006)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2603;H:nebula.arm.com;FPR:;SPF:TempError;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7534d67-840f-4291-c798-08d727b8a507 X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328);SRVR:HE1PR0802MB2603; X-MS-TrafficTypeDiagnostic: HE1PR0802MB2603:|AM6SPR01MB14: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true X-MS-Oob-TLC-OOBClassifiers: OLM:3826;OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: 71PX83e5BDby9npWb1ar2dD8Nl5MVxCZw1nJVgqwy4UxVPblwNbmxf8qxtG9pWzigkuGRto7yax/9LW4XHr0SSDw6SejzZTT0acCFEpVaosnNNWKXUfG2LAUAYcFi8YzmHXFgfncnwiBsnZ/9HNc8ANY1VaY5cjBnzQDyItCbY+m2rxCL/KaGAKBWZ9HOV0hMCKPi7D/zlxpv6npd77T/dHuaKEocsxkJdC3Rltw+7CYGnnfQPeZRMuLJ/ELEOgI5pzmVpzZUMZUVwhuNB5VPq7D8/kXMDNgzsIaEaCLn2poM8uYNQYTqXfjGNa2Dv9jNbcOVnsRON5teDK7+4BTgkEU1q/dYVGqrxytQlbRLXAUzyB4fk029ylKhC+qaHdAXGIG0mtntTBth/ewjWe4NPtkEPhEPs7yeWIitIjExQc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2603 Original-Authentication-Results: spf=temperror (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=temperror action=none header.from=arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 336e7bde-92e7-4c4c-5f11-08d727b89eff NoDisclaimer: True X-Microsoft-Antispam-Message-Info: Ou+9HkmOfw8SIoTNwYvA0SRgnGiXL5ztME699OzxD7cK1FVD6j3FoMtqGBfAhlaLAzASaZVdSaeNkyWGgq1HZvItT21O2J2OFB8OGzqy9A5JDzhF+x25jgQ9iW+OZK0s45B/I+a1arIBmLAxm/ZT+ri5C/mip6bpq7WY0fkz+qM+ShSkg9OvPw5b8hLQitG+yfzfJgJScleUZgxI4tNrXs67L5hdOdO4AVdkwO9xIVusuvvoglwtSZ8Nm0gxO25whwb4f4/pgKzOIUHGTTt1oPSQGwzh5cthbLj07J0StvEtwhUsw0pUu+HJwpX152m8FGWvDbixmLIAog9MFWbJvDXr4GGVN6FHMP446n7ALAXFcsSTyBq4weTS/Mczt93qfNIY2K1dlRlz7rNpeCdGBL1ewFvsDlfpFKlPWuqKtRM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2019 10:57:09.1700 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7534d67-840f-4291-c798-08d727b8a507 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: AM6SPR01MB14 Precedence: Bulk List-Unsubscribe: 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1566557837; bh=6lIJ7hhXL+lhLbQoqCu8c5Uh6aZuAnNUhf1ssyV+gHc=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=XOGPqb3yc9GbDfh1x3bvNapg/HqvibP0S5U6k5JZqf7czjFfkXp1VXL30tXUC18r3il q74LfAmoFAuyW/HB2iOHJQiveLzMFNSMozGSjCzgbRetDCL1HmotZE/FM5fCWuWvi9Bcy Q/hGFLHJWItqLyYJArMHgA2U33pekHO0BbA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Alexei Fedorov --- 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; =20 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; } =20 - ProcTopologyStructCount =3D Generator->ProcHierarchyNodeCount; + ProcTopologyStructCount =3D ProcHierarchyNodeCount; + Generator->ProcHierarchyNodeCount =3D ProcHierarchyNodeCount; =20 // 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; } =20 - ProcTopologyStructCount +=3D Generator->CacheStructCount; + ProcTopologyStructCount +=3D CacheStructCount; + Generator->CacheStructCount =3D CacheStructCount; =20 // 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; } =20 - ProcTopologyStructCount +=3D Generator->IdStructCount; + ProcTopologyStructCount +=3D IdStructCount; + Generator->IdStructCount =3D IdStructCount; =20 // Allocate Node Indexer array NodeIndexer =3D (PPTT_NODE_INDEXER*)AllocateZeroPool ( @@ -1475,6 +1481,12 @@ ACPI_PPTT_GENERATOR PpttGenerator =3D { =20 // 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; =20 #pragma pack() --=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 (#46268): https://edk2.groups.io/g/devel/message/46268 Mute This Topic: https://groups.io/mt/32999786/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-