From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C4A387803D1 for ; Mon, 18 Sep 2023 21:25:16 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=I4jC+8mkgDNx+5Od8Y/eylZWvRQzzFRUnuYjxjoOmPo=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695072315; v=1; b=BASg39TsD4BftOXLotD5gmMVeUMrkHWbd4vI3JlygyJJkv8hCMeTjjTFLEkIGYSZcNUKBQ+z hS8nMEJZjMYxGzF1nuaI9VHALS9fRggv5hgq0ly9pblDtq359wUciVa0AW24iJUhQ+7nYivVB3y uG/0LjLynduecW7HHPTWzPDo= X-Received: by 127.0.0.2 with SMTP id Kq18YY7687511xeTDgNdSu0V; Mon, 18 Sep 2023 14:25:15 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.3384.1695072314946677137 for ; Mon, 18 Sep 2023 14:25:15 -0700 X-Received: from [192.168.4.22] (unknown [47.201.241.95]) by linux.microsoft.com (Postfix) with ESMTPSA id DC2A3212C484; Mon, 18 Sep 2023 14:25:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DC2A3212C484 Message-ID: Date: Mon, 18 Sep 2023 17:25:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts for Guard Page To: devel@edk2.groups.io, t@taylorbeebe.com Cc: Jian J Wang , Liming Gao , Dandan Bi References: <20230810180630.1879-1-t@taylorbeebe.com> <20230810180630.1879-2-t@taylorbeebe.com> From: "Michael Kubacki" In-Reply-To: <20230810180630.1879-2-t@taylorbeebe.com> Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mikuback@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: q1g5DjCkNhgjnGIWzH38xkhhx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=BASg39Ts; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Merged -=20 https://github.com/tianocore/edk2/commit/408e4631359d3e67633b36f6adf9a13a7c= c573d3 On 8/10/2023 2:06 PM, Taylor Beebe wrote: > From: Taylor Beebe >=20 > 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. >=20 > 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. >=20 > Signed-off-by: Taylor Beebe > Cc: Jian J Wang > Cc: Liming Gao > Cc: Dandan Bi > --- > MdeModulePkg/Core/Dxe/Mem/Page.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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 !=3D 0) { > if (Start < mDefaultBaseAddress) { > - mDefaultBaseAddress =3D Start; > + mDefaultBaseAddress =3D NeedGuard ? Start - EFI_PAGE_SIZE : Star= t; > } > =20 > return Start; -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108807): https://edk2.groups.io/g/devel/message/108807 Mute This Topic: https://groups.io/mt/100668862/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-