Reviewed-by: Liming Gao <[email protected]>

> -----邮件原件-----
> 发件人: Taylor Beebe <[email protected]>
> 发送时间: 2023年8月11日 2:07
> 收件人: [email protected]
> 抄送: Jian J Wang <[email protected]>; Liming Gao
> <[email protected]>; Dandan Bi <[email protected]>
> 主题: [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts
> for Guard Page
> 
> From: Taylor Beebe <[email protected]>
> 
> 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 <[email protected]>
> Cc: Jian J Wang <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Dandan Bi <[email protected]>
> ---
>  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: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to