From: "Dong, Eric" <eric.dong@intel.com>
To: "Wang, Jian J" <jian.j.wang@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Bi, Dandan" <dandan.bi@intel.com>,
"Wu, Hao A" <hao.a.wu@intel.com>,
Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error
Date: Wed, 19 Sep 2018 01:03:31 +0000 [thread overview]
Message-ID: <ED077930C258884BBCB450DB737E66224AC9DF28@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20180918090435.7232-1-jian.j.wang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
> -----Original Message-----
> From: Wang, Jian J
> Sent: Tuesday, September 18, 2018 5:05 PM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan <dandan.bi@intel.com>; Wu, Hao A <hao.a.wu@intel.com>;
> Dong, Eric <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>
> Subject: [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error
>
> > v2 changes:
> > Incorpate Laszlo's reivew comments
> > a. change title
> > b. drop unrelated changes
> > c. remove error message
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1166
>
> Visual Studio 2012 will complain uninitialized variable, StackBase, in the
> CpuPaging.c. This patch adds code to init it to zero and ASSERT check against 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.
>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
> UefiCpuPkg/CpuMpPei/CpuPaging.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> 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 = 0; Index < NumberOfProcessors; ++Index) {
> + StackBase = 0;
> +
> if (Index == Bsp) {
> Hob.Raw = GetHobList ();
> while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION,
> Hob.Raw)) != NULL) { @@ -570,6 +572,7 @@ SetupStackGuardPage (
> //
> MpInitLibStartupThisAP(GetStackBase, Index, NULL, 0, (VOID
> *)&StackBase, NULL);
> }
> + ASSERT (StackBase != 0);
> //
> // Set Guard page at stack base address.
> //
> --
> 2.16.2.windows.1
prev parent reply other threads:[~2018-09-19 1:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 9:04 [PATCH v2] UefiCpuPkg/CpuMpPei: fix vs2012 build error Jian J Wang
2018-09-18 16:44 ` Laszlo Ersek
2018-09-19 1:03 ` Dong, Eric [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ED077930C258884BBCB450DB737E66224AC9DF28@shsmsx102.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox