From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: chasel.chiu@intel.com) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by groups.io with SMTP; Mon, 02 Sep 2019 06:54:43 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Sep 2019 06:54:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,459,1559545200"; d="scan'208";a="333571159" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by orsmga004.jf.intel.com with ESMTP; 02 Sep 2019 06:54:41 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by KMSMSX153.gar.corp.intel.com ([169.254.5.69]) with mapi id 14.03.0439.000; Mon, 2 Sep 2019 21:54:40 +0800 From: "Chiu, Chasel" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [PATCH 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Topic: [PATCH 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Index: AQHVYYo3vjKb3Kugp0qZUiC+XRZe1qcYaKvw Date: Mon, 2 Sep 2019 13:54:40 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC5047E72C@PGSMSX111.gar.corp.intel.com> References: <20190902123017.26220-1-shenglei.zhang@intel.com> <20190902123017.26220-3-shenglei.zhang@intel.com> In-Reply-To: <20190902123017.26220-3-shenglei.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjljMWQ4NTUtNzE2NC00ZDhmLThjNjYtOTZmY2EzZDBiNGQ5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidWh0YVlMcG95R0Y5Y0M0d3g1bFdTanpac2pFYUc4ZjhtN0tUTHJoREdoQ0Z6eWxWV283eE1XZTJcL0lreDRWSlkifQ== x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Same with 1/2 patch, please extend copyright. With above update, Reviewed-by: Chasel Chiu > -----Original Message----- > From: Zhang, Shenglei > Sent: Monday, September 2, 2019 8:30 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [PATCH 2/2] MinPlatformPkg/AcpiTables: Add error handling to > SortCpuLocalApicInTable >=20 > Change ASSERT_EFI_ERROR to return value when the "if" statement is true. > As a result, when SortCpuLocalApicInTable is called, error handling is > needed. So add "if" statement to judge the returned Status from > SortCpuLocalApicInTable () in function InstallMadtFromScratch(). >=20 > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- > .../Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > index 85d1bd9a..dc68dfaa 100644 > --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c > @@ -354,7 +354,7 @@ SortCpuLocalApicInTable ( >=20 > if(MAX_CPU_NUM <=3D Index) { > DEBUG ((EFI_D_ERROR, "Asserting the SortCpuLocalApicInTable > Index Bufferflow\n")); > - ASSERT_EFI_ERROR(EFI_INVALID_PARAMETER); > + return EFI_INVALID_PARAMETER; > } >=20 > TempVal =3D mCpuApicIdOrderTable[Index].ApicId; > @@ -874,7 +874,11 @@ InstallMadtFromScratch ( > DetectApicIdMap(); >=20 > // Call for Local APIC ID Reorder > - SortCpuLocalApicInTable (); > + Status =3D SortCpuLocalApicInTable (); > + if (EFI_ERROR (Status)) { > + DEBUG ((EFI_D_ERROR, "SortCpuLocalApicInTable failed: %r\n", > Status)); > + goto Done; > + } >=20 > MaxMadtStructCount =3D (UINT32) ( > MAX_CPU_NUM + // processor local APIC structures > -- > 2.18.0.windows.1