From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9248521AE30DB for ; Tue, 18 Sep 2018 18:03:34 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 18:03:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,392,1531810800"; d="scan'208";a="81539695" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 18 Sep 2018 18:03:33 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 18 Sep 2018 18:03:33 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 18 Sep 2018 18:03:33 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.226]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.240]) with mapi id 14.03.0319.002; Wed, 19 Sep 2018 09:03:31 +0800 From: "Dong, Eric" To: "Wang, Jian J" , "edk2-devel@lists.01.org" CC: "Bi, Dandan" , "Wu, Hao A" , Laszlo Ersek Thread-Topic: [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error Thread-Index: AQHUTy6wJ63U7Bm2lEWVhZp5yUB5LqT2yrPQ Date: Wed, 19 Sep 2018 01:03:31 +0000 Message-ID: References: <20180918090435.7232-1-jian.j.wang@intel.com> In-Reply-To: <20180918090435.7232-1-jian.j.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2018 01:03:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Wang, Jian J > Sent: Tuesday, September 18, 2018 5:05 PM > To: edk2-devel@lists.01.org > Cc: Bi, Dandan ; Wu, Hao A ; > Dong, Eric ; Laszlo Ersek > Subject: [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error >=20 > > v2 changes: > > Incorpate Laszlo's reivew comments > > a. change title > > b. drop unrelated changes > > c. remove error message >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1166 >=20 > Visual Studio 2012 will complain uninitialized variable, StackBase, in th= e > CpuPaging.c. This patch adds code to init it to zero and ASSERT check aga= inst 0. > This is enough since uninit case will only happen during retrieving stack > memory via gEfiHobMemoryAllocStackGuid. > But this HOB will always be created in advance. >=20 > Cc: Dandan Bi > Cc: Hao A Wu > Cc: Eric Dong > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jian J Wang > --- > UefiCpuPkg/CpuMpPei/CpuPaging.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/UefiCpuPkg/CpuMpPei/CpuPaging.c > b/UefiCpuPkg/CpuMpPei/CpuPaging.c index bcb942a8e5..c7e0822452 > 100644 > --- a/UefiCpuPkg/CpuMpPei/CpuPaging.c > +++ b/UefiCpuPkg/CpuMpPei/CpuPaging.c > @@ -554,6 +554,8 @@ SetupStackGuardPage ( > MpInitLibGetNumberOfProcessors(&NumberOfProcessors, NULL); > MpInitLibWhoAmI (&Bsp); > for (Index =3D 0; Index < NumberOfProcessors; ++Index) { > + StackBase =3D 0; > + > if (Index =3D=3D Bsp) { > Hob.Raw =3D GetHobList (); > while ((Hob.Raw =3D GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, > Hob.Raw)) !=3D NULL) { @@ -570,6 +572,7 @@ SetupStackGuardPage ( > // > MpInitLibStartupThisAP(GetStackBase, Index, NULL, 0, (VOID > *)&StackBase, NULL); > } > + ASSERT (StackBase !=3D 0); > // > // Set Guard page at stack base address. > // > -- > 2.16.2.windows.1