From: "gaoliming via groups.io" <gaoliming=byosoft.com.cn@groups.io>
To: "'Taylor Beebe'" <t@taylorbeebe.com>, <devel@edk2.groups.io>
Cc: "'Jian J Wang'" <jian.j.wang@intel.com>,
"'Dandan Bi'" <dandan.bi@intel.com>
Subject: [edk2-devel] 回复: [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts for Guard Page
Date: Wed, 16 Aug 2023 09:01:30 +0800 [thread overview]
Message-ID: <00f601d9cfdd$316eb040$944c10c0$@byosoft.com.cn> (raw)
In-Reply-To: <20230810180630.1879-2-t@taylorbeebe.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
> -----邮件原件-----
> 发件人: Taylor Beebe <t@taylorbeebe.com>
> 发送时间: 2023年8月11日 2:07
> 收件人: devel@edk2.groups.io
> 抄送: Jian J Wang <jian.j.wang@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dandan Bi <dandan.bi@intel.com>
> 主题: [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts
> for Guard Page
>
> From: Taylor Beebe <taylor.d.beebe@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.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Dandan Bi <dandan.bi@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2023-08-16 1:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 18:06 [edk2-devel] [PATCH v1 0/1] Fix Memory Bin Range Calculation to Account for Guard Page Taylor Beebe
2023-08-10 18:06 ` [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts " Taylor Beebe
2023-08-16 1:01 ` gaoliming via groups.io [this message]
2023-09-18 21:25 ` Michael Kubacki
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='00f601d9cfdd$316eb040$944c10c0$@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