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; Wed, 11 Sep 2019 21:07:57 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2019 21:07:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,495,1559545200"; d="scan'208";a="214912630" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by fmsmga002.fm.intel.com with ESMTP; 11 Sep 2019 21:07:55 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.128]) by KMSMSX153.gar.corp.intel.com ([169.254.5.31]) with mapi id 14.03.0439.000; Thu, 12 Sep 2019 12:06:06 +0800 From: "Chiu, Chasel" To: "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Topic: [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Index: AQHVaRorxKWBYU7kmUW5k4L4b7G0lqcnbI4Q Date: Thu, 12 Sep 2019 04:06:05 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC504945BA@PGSMSX111.gar.corp.intel.com> References: <20190912032720.38132-1-shenglei.zhang@intel.com> <20190912032720.38132-4-shenglei.zhang@intel.com> In-Reply-To: <20190912032720.38132-4-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjg2ZmE3MzMtNDg4Yi00MDUyLTk4NDktOGM2MWIxYzJmNjMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRlRHSlJlakFWOEFwVVlZWGprd2pidTNKUFNLUWdMZ21YSW0rYlo2OWxxVjVCMUZLZUdJZ3FOcGhnMDFBMUNcL0YifQ== 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 Reviewed-by: Chasel Chiu > -----Original Message----- > From: Zhang, Shenglei > Sent: Thursday, September 12, 2019 11:27 AM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [PATCH v2 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 2cc55ee8..ae25d753 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