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.88, mailfrom: nathaniel.l.desimone@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Thu, 12 Sep 2019 11:36:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2019 11:36:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,498,1559545200"; d="scan'208";a="184883374" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by fmsmga008.fm.intel.com with ESMTP; 12 Sep 2019 11:36:01 -0700 Received: from orsmsx152.amr.corp.intel.com (10.22.226.39) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 12 Sep 2019 11:36:01 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.225]) by ORSMSX152.amr.corp.intel.com ([169.254.8.93]) with mapi id 14.03.0439.000; Thu, 12 Sep 2019 11:36:01 -0700 From: "Nate DeSimone" To: "devel@edk2.groups.io" , "Zhang, Shenglei" CC: "Kubacki, Michael A" , "Chiu, Chasel" , "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: AQHVaRojp98XqS9NB0aYVPB54zq3o6coX4dA Date: Thu, 12 Sep 2019 18:36:00 +0000 Message-ID: <02A34F284D1DA44BB705E61F7180EF0AAEEB43B1@ORSMSX114.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: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2JkMmVlMTAtYjFkYy00MmQ3LWE0ODgtMjIzMGQ4Zjc0NGMzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC9CRWZWSXViQ0kyR1I0NXpIejNndFwvMUtzY2V1cGFqRlhLbzJkVUNCSEVkM2xCbXJQdjkyd2lib21aMTcrUWdcLyJ9 x-ctpclassification: CTP_NT x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: nathaniel.l.desimone@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: devel@edk2.groups.io On Behalf Of Zhang, Shen= glei Sent: Wednesday, September 11, 2019 8:27 PM To: devel@edk2.groups.io Cc: Kubacki, Michael A ; Chiu, Chasel ; Desimone, Nathaniel L ; G= ao, Liming Subject: [edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error = handling to SortCpuLocalApicInTable Change ASSERT_EFI_ERROR to return value when the "if" statement is true. As a result, when SortCpuLocalApicInTable is called, error handling is nee= ded. So add "if" statement to judge the returned Status from SortCpuLocalAp= icInTable () in function InstallMadtFromScratch(). 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(-) 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