From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: michael.d.kinney@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Thu, 01 Aug 2019 13:30:18 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 13:30:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,335,1559545200"; d="scan'208";a="174730245" Received: from orsmsx103.amr.corp.intel.com ([10.22.225.130]) by fmsmga007.fm.intel.com with ESMTP; 01 Aug 2019 13:30:18 -0700 Received: from orsmsx123.amr.corp.intel.com (10.22.240.116) by ORSMSX103.amr.corp.intel.com (10.22.225.130) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 13:30:17 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.177]) by ORSMSX123.amr.corp.intel.com ([169.254.1.245]) with mapi id 14.03.0439.000; Thu, 1 Aug 2019 13:30:17 -0700 From: "Michael D Kinney" To: Sami Mujawar , "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Carsey, Jaben" , "Ni, Ray" , "Gao, Zhichao" 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+95YxETk9jb0OXz3JA9irwnqbFipMAgCFU4mA= Date: Thu, 1 Aug 2019 20:30:17 +0000 Message-ID: References: <20190710223507.14396-1-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Sami, I agree with your feedback. I saw that there was a larger patch set for the ShellPkg, so I let that complete before returning to this topic. The reason that I noticed this issue in the first place is when I added the acpiview command to a platform and there was an IA32 build failure. It would be better if the ShellPkg build caught this issue. Adding the acpiview command to the standard shell build adds 50K to an uncompressed DEBUG IA32 build. 869,312 Shell_7C04A583-9E3E-4f1c-AD65-E05268D0B4D1.efi 920,928 Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi Should acpiview be added to the standard ShellPkg build, or should I add an extra build of the Shell to the=20 ShellPkg DSC file with a different GUID to make sure the shell builds when all NULL libs are included without any !if statements. For example: ShellPkg/Application/Shell/Shell.inf { FILE_GUID =3D EA4BB293-2D7F-4456-A681-1F22F42CD0BC gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Comm= andsLib.inf NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1Comm= andsLib.inf NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Comm= andsLib.inf NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Co= mmandsLib.inf NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1= CommandsLib.inf NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comm= andsLib.inf NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1= CommandsLib.inf NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2= CommandsLib.inf NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewC= ommandLib.inf } Thanks, Mike > -----Original Message----- > From: Sami Mujawar [mailto:Sami.Mujawar@arm.com] > Sent: Thursday, July 11, 2019 1:24 AM > To: devel@edk2.groups.io; Kinney, Michael D > > Cc: Carsey, Jaben ; Ni, Ray > ; Gao, Zhichao > > Subject: RE: [edk2-devel] [Patch] ShellPkg/AcpiView: > Fix IA32 link error >=20 > Hi Mike, >=20 > 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 have a check that limits the validation to > MAX_UINT32? >=20 > 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 count is > MAX_UINT32\n"); } >=20 > Regards, >=20 > Sami Mujawar >=20 > -----Original Message----- > From: devel@edk2.groups.io On > Behalf Of Michael D Kinney via Groups.Io > Sent: 10 July 2019 11:35 PM > To: devel@edk2.groups.io > Cc: Jaben Carsey ; Ray Ni > ; Zhichao Gao > Subject: [edk2-devel] [Patch] ShellPkg/AcpiView: Fix > IA32 link error >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1970 >=20 > Update local variable in ParseAcpiSlot() to be UINT32 > instead of UINT64 to avoid 64-bit multiply operation in > the SLIT_ELEMENT() macro. >=20 > Cc: Jaben Carsey > Cc: Ray Ni > Cc: Zhichao Gao > Signed-off-by: Michael D Kinney > > --- >=20 > .../UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser > .c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git > a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/ > Slit/SlitParser.c > b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/ > Slit/SlitParser.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 >=20 >=20 >=20 >=20 > IMPORTANT NOTICE: The contents of this email and any > attachments are confidential and may also be > privileged. If you are not the intended recipient, > please 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.