Reviewed-by: Liming Gao <gaolim...@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Taylor Beebe <t...@taylorbeebe.com>
> 发送时间: 2023年8月11日 2:07
> 收件人: devel@edk2.groups.io
> 抄送: Jian J Wang <jian.j.w...@intel.com>; Liming Gao
> <gaolim...@byosoft.com.cn>; Dandan Bi <dandan...@intel.com>
> 主题: [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts
> for Guard Page
> 
> From: Taylor Beebe <taylor.d.be...@gmail.com>
> 
> When finding a free page range for allocation, if the found range
> starts below the tracked memory bin address range, the lowest
> memory bin address is updated which will not include the guard page if
> present. When CoreConvertPagesWithGuard() is called on the range
> being allocated, the memory range is adjusted to include guard
> pages which can push it out of the memory bin address range and
> cause the memory type statistics to be unaltered.
> 
> This patch updates the lowest memory bin address range to account for
> the guard page if NeedGuard is TRUE so the memory type statistics
> are updated correctly.
> 
> Signed-off-by: Taylor Beebe <t...@taylorbeebe.com>
> Cc: Jian J Wang <jian.j.w...@intel.com>
> Cc: Liming Gao <gaolim...@byosoft.com.cn>
> Cc: Dandan Bi <dandan...@intel.com>
> ---
>  MdeModulePkg/Core/Dxe/Mem/Page.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c
> b/MdeModulePkg/Core/Dxe/Mem/Page.c
> index 41af50b3d5ab..6497af573353 100644
> --- a/MdeModulePkg/Core/Dxe/Mem/Page.c
> +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c
> @@ -1210,7 +1210,7 @@ FindFreePages (
>                );
>      if (Start != 0) {
>        if (Start < mDefaultBaseAddress) {
> -        mDefaultBaseAddress = Start;
> +        mDefaultBaseAddress = NeedGuard ? Start - EFI_PAGE_SIZE :
> Start;
>        }
> 
>        return Start;
> --
> 2.41.0.windows.3





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107774): https://edk2.groups.io/g/devel/message/107774
Mute This Topic: https://groups.io/mt/100771119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to