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.65, mailfrom: michael.a.kubacki@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Wed, 11 Sep 2019 23:17:19 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Sep 2019 23:17:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,495,1559545200"; d="scan'208";a="209907362" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by fmsmga004.fm.intel.com with ESMTP; 11 Sep 2019 23:17:05 -0700 Received: from orsmsx126.amr.corp.intel.com (10.22.240.126) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Sep 2019 23:17:05 -0700 Received: from orsmsx121.amr.corp.intel.com ([169.254.10.57]) by ORSMSX126.amr.corp.intel.com ([169.254.4.36]) with mapi id 14.03.0439.000; Wed, 11 Sep 2019 23:17:05 -0700 From: "Kubacki, Michael A" To: "devel@edk2.groups.io" , "Zhang, Shenglei" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Topic: [edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable Thread-Index: AQHVaRojWz0O/QXY90Kupo+JlKeSyqcnkJKg Date: Thu, 12 Sep 2019 06:17:04 +0000 Message-ID: <49AB4ACB9627B8468F29D589A27B745588ABF553@ORSMSX121.amr.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: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWE0NWY5ZTMtMmFkYS00MDM1LTkwNzUtMmQ0M2U4OTZkYWRiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOVZcL1FPdDVTXC9zaHRndlQ4SU9UOWZIUW12R05zbDg5U3hiRHRoT21ITnFoZUVnMzZZeFwvNStJMThmdzkwWVZIYiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: michael.a.kubacki@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kubacki > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Zhang, > Shenglei > Sent: Wednesday, September 11, 2019 8:27 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add erro= r > 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 n= eeded. > 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 Ind= ex > 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 >=20 >=20 >=20