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=Zz+SK3VF; spf=pass (domain: arm.com, ip: 40.107.14.85, mailfrom: sami.mujawar@arm.com) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (EUR01-VE1-obe.outbound.protection.outlook.com [40.107.14.85]) by groups.io with SMTP; Thu, 11 Jul 2019 01:24:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SrBw0svuhSRl3d98LF/ToCjr5W9AjFDxVQtH/00eE84P/pi37jo2Jd+6GBbZjF4aOq9UL3yC0fgWSBievq1CCqcpzDLn1cHnTQwgvrk5hTWb3XJB5MMU3n9gQ1TPCcGpYNyuvQounNW9lSnkp46qFAoW9MuhZZ5nmi22JSXg4/2ob/CcnzSPJ46GIYYrmSjUtj6HG8yqcmX8lSb+ZzhGVMo1HLeWVGVKYBFuUG31LQGkmv+/BzWciajhc7CgW4DSZL2ZUJItzxssGRFGBHwauwZ3+XuxaogJaCatqZXEggtkm8m4FtY34rBZQBjxCpO7R5riPMtO53pKeBI26OnDuA== 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=XSMWmiKJYkAhwSIfMa14uPm19Leww7pZeDVztV5YMQg=; b=W6H/7UYXTRcILwX3z+pD8YgVyXTF+nBdRpp2qpES2iCDbtKoLtidp2X5NcmJ+Q0aUb/FwkXI+sk6rhnOLQCueP8qRgHa3DvQXvm+Tcp5GUapIQByqmUh6OARXm7VgeGYfyYpEjgbEk7Bdx7rCKz/Ykr75s57Q1Nziyuslr7VY50wg4ZPLNl28ClPv+X71VenCT/f1G75tASLFokSyHZb4zgn0NxRSEQPeXA/VtPCJb6wzLINBRhP0rJciOTA9BnbowdXO4nawKGS9WjshvoGRDYZYh3T8xSFTGg2LwFaZ/tYFZfh3e1OsvlxBjl6HQekpgpLyxGPUroKIFv+Tp/87g== 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=XSMWmiKJYkAhwSIfMa14uPm19Leww7pZeDVztV5YMQg=; b=Zz+SK3VF+Z3APPg67FbrJwoRu6Mz28vjWMeTjOW+s/ViWF6MKhYgais08kL4v2OlCaMyVt87gNVqeEVCmR9EoiOXhy7D4I4d7jxOSbeWuVtVbpwmhslBAAdXMkFkHBY5k1tC8hfpmDIGocks0rTkjEXcjlekNwHe9p6T7zcxbg4= Received: from AM4PR0802MB2372.eurprd08.prod.outlook.com (10.172.218.144) by AM4PR0802MB2209.eurprd08.prod.outlook.com (10.172.221.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Thu, 11 Jul 2019 08:24:26 +0000 Received: from AM4PR0802MB2372.eurprd08.prod.outlook.com ([fe80::40bb:b815:89a5:39e]) by AM4PR0802MB2372.eurprd08.prod.outlook.com ([fe80::40bb:b815:89a5:39e%9]) with mapi id 15.20.2032.023; Thu, 11 Jul 2019 08:24:26 +0000 From: "Sami Mujawar" To: "devel@edk2.groups.io" , "michael.d.kinney@intel.com" CC: Jaben Carsey , Ray Ni , Zhichao Gao Subject: Re: [edk2-devel] [Patch] ShellPkg/AcpiView: Fix IA32 link error Thread-Topic: [edk2-devel] [Patch] ShellPkg/AcpiView: Fix IA32 link error Thread-Index: AQHVN2/ArOxUEBCFWEmkHM2ufBJ6VqbFD4IQ Date: Thu, 11 Jul 2019 08:24:26 +0000 Message-ID: References: <20190710223507.14396-1-michael.d.kinney@intel.com> In-Reply-To: <20190710223507.14396-1-michael.d.kinney@intel.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 2bc57056-9a03-4084-aab3-3c51c889b2a2.1 x-checkrecipientchecked: true authentication-results: spf=none (sender IP is ) smtp.mailfrom=Sami.Mujawar@arm.com; x-originating-ip: [217.140.106.50] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f1b11155-8ad4-41ca-b396-08d705d92fd8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:AM4PR0802MB2209; x-ms-traffictypediagnostic: AM4PR0802MB2209: x-ms-exchange-purlcount: 4 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0095BCF226 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(136003)(366004)(396003)(346002)(376002)(39860400002)(189003)(13464003)(40434004)(199004)(186003)(5024004)(14444005)(14454004)(476003)(256004)(11346002)(6306002)(76176011)(9686003)(316002)(26005)(305945005)(6246003)(33656002)(7736002)(74316002)(966005)(55016002)(229853002)(8936002)(53936002)(2501003)(66066001)(478600001)(66946007)(446003)(66556008)(66476007)(66446008)(64756008)(71200400001)(71190400001)(25786009)(76116006)(102836004)(86362001)(53546011)(5660300002)(6506007)(7696005)(4326008)(6116002)(3846002)(68736007)(2906002)(99286004)(6436002)(54906003)(8676002)(81156014)(81166006)(110136005)(52536014)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0802MB2209;H:AM4PR0802MB2372.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: 1MK+u4BiF8T6sUcMMQpawEFuMZ/esge9vFvthZCOfUuG8X95tXYO07tUUuE9SAbgtBZxLIPTQYOiO8/otBf3qRVk0reKzKI9cBrr8MWLkMAJAYrfkqeZhmAVXNIf3uDowCiYEabBZuk0jCpB1Pqk9UXcICPctOOyqx0QU3idARmwIZLc3CpsYa4hX11x2AnFPZC/rUuVeF0zehokhSwBt4XPAKyBHZC7LWcnnr1uBK1HmyUTBme4WnZoV2XU2snndrCNDQR4JEfb3seqb5U0EXwA+pEIOdQxEgPoRMepOGYI8DU6mA9WhEdaiSoB25rw0wYd6SFr8gBRMAUUrrZe4WYSk9m3Jtav0xZfapjiCQcOZRSuov0g7RNkycITqZlrO02g4ZcEx0eAk6+jcFEP03Z0wvY+3RdvGPuumZugLo0= MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1b11155-8ad4-41ca-b396-08d705d92fd8 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2019 08:24:26.4246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Sami.Mujawar@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2209 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Mike, Since LocalityCount is 64-bit wide the SLIT validation code could possibly= end up in an infinite loop. I am not aware of a platform that has a large = enough LocalityCount to hit this condition. However, would it be good to ha= ve a check that limits the validation to MAX_UINT32? e.g. Something like if (LocalityCount < MAX_UINT32) { // Validate for (Count =3D 0; Count < LocalityCount; Count++) { for (Index =3D 0; Index < LocalityCount; Index++) { ... } else { Print (L"INFO: Skipping validation of System Localities as locality coun= t is > MAX_UINT32\n"); } Regards, Sami Mujawar -----Original Message----- From: devel@edk2.groups.io On Behalf Of Michael D K= inney via Groups.Io Sent: 10 July 2019 11:35 PM To: devel@edk2.groups.io Cc: Jaben Carsey ; Ray Ni ; Zhic= hao Gao Subject: [edk2-devel] [Patch] ShellPkg/AcpiView: Fix IA32 link error https://bugzilla.tianocore.org/show_bug.cgi?id=3D1970 Update local variable in ParseAcpiSlot() to be UINT32 instead of UINT64 to= avoid 64-bit multiply operation in the SLIT_ELEMENT() macro. Cc: Jaben Carsey Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Michael D Kinney --- .../UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/Sli= tParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitP= arser.c index 1f9dac66ee..af85c9aa1c 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser= .c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitPars +++ er.c @@ -57,8 +57,8 @@ ParseAcpiSlit ( ) { UINT32 Offset; - UINT64 Count; - UINT64 Index; + UINT32 Count; + UINT32 Index; UINT64 LocalityCount; UINT8* LocalityPtr; CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi -- 2.21.0.windows.1 IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you.