public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: "'Sunil V L'" <sunilvl@ventanamicro.com>, <devel@edk2.groups.io>
Cc: "'Andrei Warkentin'" <andrei.warkentin@intel.com>,
	"'Ard Biesheuvel'" <ardb+tianocore@kernel.org>,
	"'Jiewen Yao'" <jiewen.yao@intel.com>,
	"'Jordan Justen'" <jordan.l.justen@intel.com>,
	"'Gerd Hoffmann'" <kraxel@redhat.com>,
	"'Michael D Kinney'" <michael.d.kinney@intel.com>,
	"'Andrew Fish'" <afish@apple.com>,
	"'Leif Lindholm'" <leif@nuviainc.com>
Subject: 回复: [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB
Date: Tue, 28 Feb 2023 14:43:13 +0800	[thread overview]
Message-ID: <04e001d94b3f$eeb87870$cc296950$@byosoft.com.cn> (raw)
In-Reply-To: <20230225053200.2051719-1-sunilvl@ventanamicro.com>

Sunil:
  Is this a critical issue? Dose this fix need to catch this stable tag? Has
it been verified and code review?

Thanks
Liming
> -----邮件原件-----
> 发件人: Sunil V L <sunilvl@ventanamicro.com>
> 发送时间: 2023年2月25日 13:32
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>; Andrei Warkentin
> <andrei.warkentin@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>;
> Jiewen Yao <jiewen.yao@intel.com>; Jordan Justen
> <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>
> 主题: [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4350
> 
> Currently, stack HOB is not created for the stack memory. This causes
> stack memory to be treated as free memory and any memory allocation
> which
> happens at this address causes random memory corruption. Fix this by
> creating the stack HOB which marks the memory as BS data.
> 
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Andrei Warkentin <andrei.warkentin@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> Reported-by: Andrei Warkentin <andrei.warkentin@intel.com>
> Tested-by: Andrei Warkentin <andrei.warkentin@intel.com>
> Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
> ---
> Changes since V1:
> 	1) Added BZ reference
> 	2) Added edk2-stable202302 in the title to request to catch
> 	   the stable tag
> 	3) Updated tags
> 
>  OvmfPkg/RiscVVirt/Sec/SecMain.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/OvmfPkg/RiscVVirt/Sec/SecMain.c
> b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> index 73b9b21a67ba..adf73f2eb66c 100644
> --- a/OvmfPkg/RiscVVirt/Sec/SecMain.c
> +++ b/OvmfPkg/RiscVVirt/Sec/SecMain.c
> @@ -55,6 +55,7 @@ SecStartup (
>    EFI_STATUS                  Status;
>    UINT64                      UefiMemoryBase;
>    UINT64                      StackBase;
> +  UINT32                      StackSize;
> 
>    //
>    // Report Status Code to indicate entering SEC core
> @@ -71,9 +72,9 @@ SecStartup (
>    FirmwareContext.FlattenedDeviceTree = (UINT64)DeviceTreeAddress;
>    SetFirmwareContextPointer (&FirmwareContext);
> 
> -  StackBase = (UINT64)FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) +
> -              FixedPcdGet32 (PcdOvmfSecPeiTempRamSize);
> -  UefiMemoryBase = StackBase - SIZE_32MB;
> +  StackBase      = (UINT64)FixedPcdGet32
> (PcdOvmfSecPeiTempRamBase);
> +  StackSize      = FixedPcdGet32 (PcdOvmfSecPeiTempRamSize);
> +  UefiMemoryBase = StackBase + StackSize - SIZE_32MB;
> 
>    // Declare the PI/UEFI memory region
>    HobList = HobConstructor (
> @@ -86,6 +87,8 @@ SecStartup (
> 
>    SecInitializePlatform ();
> 
> +  BuildStackHob (StackBase, StackSize);
> +
>    //
>    // Process all libraries constructor function linked to SecMain.
>    //
> --
> 2.34.1




  reply	other threads:[~2023-02-28  6:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-25  5:32 [edk2-stable202302 PATCH V2 1/1] OvmfPkg/RiscVVirt: Add Stack HOB Sunil V L
2023-02-28  6:43 ` gaoliming [this message]
2023-02-28  6:47   ` [edk2-devel] 回复: " Sunil V L
2023-03-01 14:47     ` 回复: " gaoliming
2023-03-02  6:50       ` Sunil V L

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='04e001d94b3f$eeb87870$cc296950$@byosoft.com.cn' \
    --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