From nobody Sun Feb 8 15:21:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107698+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107698+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1691690804; cv=none; d=zohomail.com; s=zohoarc; b=lhvKmcPFzj6row/iqKEHBJYyffw0nNc6dD6ArqWe59GIyftThftvLzLRuDO9xxRkIX7ZU4dgXkaHE7JqtNDTfAEpNSPgGp+0lyrqT/ha9touoL+2hG162uXeY+yOoSdNKRvZmF81DB0rab9cIEsz1HMRjVujf1tkBY7slbtbpHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691690804; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wS2XE5jRZht66sV59u9v1pL15Hp88Y0xTkU1YnugvLw=; b=SP6KeYC3tZD08lIE2b4FJRfYGieBdbmLYuBV6/ZEDLpA198r1vpUDeLGBIScxr64QOOsAl/ir+osFpqQfhGjITQs1N6ajJtHAEbDa0G7aAnUtKBjNXWLa4/fx02DBhdCKSb50WORm6DvxT+P4AB9hxfxONJCqOpMOY92Fa4STUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107698+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1691690804977938.6651853272315; Thu, 10 Aug 2023 11:06:44 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=dKKUnd6wbte+GFgzE9q+VPzF3zVTplUL8+kKqgchjyk=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1691690804; v=1; b=U9ExjZOkQM4hy4h+eSv941sQyKvZ7bvjQsMu2T/+VLbZYphJkkNkpd7Mm5BM2cxsx9lRvFMe kvjtdS7r7krvYtU4A5y6uOwCEcBG90CoGVS6JG4HAdNZlENBjeb7MCadhq+cid53AAVsW9DjLr1 9fJlcD0QW9dCcf1WFzFCoZvI= X-Received: by 127.0.0.2 with SMTP id StjZYY1788612xQWwDGnBtsf; Thu, 10 Aug 2023 11:06:44 -0700 X-Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web11.24834.1691690803894904815 for ; Thu, 10 Aug 2023 11:06:43 -0700 X-Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-686efb9ee3cso1090865b3a.3 for ; Thu, 10 Aug 2023 11:06:43 -0700 (PDT) X-Gm-Message-State: 5TUvr7AoA23F0ec9EgpSlhzbx1787277AA= X-Google-Smtp-Source: AGHT+IEl9Tbc6OE8uFz8LZRUhvptkoF5k+j5dAQOc2+Mg9CExGvbcJ3zf6W7dqosVZ9jcrekeZhqWA== X-Received: by 2002:a05:6a20:5512:b0:13a:ccb9:d5ad with SMTP id ko18-20020a056a20551200b0013accb9d5admr3324348pzb.44.1691690803114; Thu, 10 Aug 2023 11:06:43 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id c2-20020aa78802000000b00687087d8bc3sm1873579pfo.141.2023.08.10.11.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 11:06:42 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Dandan Bi Subject: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Memory Bin Range Update Accounts for Guard Page Date: Thu, 10 Aug 2023 11:06:30 -0700 Message-ID: <20230810180630.1879-2-t@taylorbeebe.com> In-Reply-To: <20230810180630.1879-1-t@taylorbeebe.com> References: <20230810180630.1879-1-t@taylorbeebe.com> MIME-Version: 1.0 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,t@taylorbeebe.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1691690805205100001 Content-Type: text/plain; charset="utf-8" From: Taylor Beebe 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 Cc: Jian J Wang Cc: Liming Gao Cc: Dandan Bi Reviewed-by: Liming Gao --- 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/P= age.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 : Start; } =20 return Start; --=20 2.41.0.windows.3 -=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 (#107698): https://edk2.groups.io/g/devel/message/107698 Mute This Topic: https://groups.io/mt/100668862/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-