From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.1758.1641870498950607811 for ; Mon, 10 Jan 2022 19:08:19 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 11 Jan 2022 11:08:12 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , Cc: "'Dandan Bi'" , "'Michael D Kinney'" References: <20220107193612.1350-1-stacy.howell@intel.com> <01ca01d8068e$e98aa590$bc9ff0b0$@byosoft.com.cn> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiDlm57lpI06IFtlZGsyLWRldmVsXSBbUEFUQ0hdIE1kZU1vZHVsZVBrZ1xDb3JlRHhlOiBBbGxvdyBEWEUgRHJpdmVycyB0byB1c2UgdW50ZXN0ZWQgbWVtb3J5?= Date: Tue, 11 Jan 2022 11:08:16 +0800 Message-ID: <01df01d80698$7aab6c40$700244c0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIs+xFC0ABOah1IIY4Lnv5LhQdu7wIYo5yPAeLYa7Grk1xv8A== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Sean: Yes. Platform can report the tested memory for the specific range.=20 Stacy: Can you evaluate Sean's solution for your problem? Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Sean > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B41=E6=9C=8811=E6=97=A5 = 10:47 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com.= cn; > stacy.howell@intel.com > =E6=8A=84=E9=80=81: 'Dandan Bi' > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH] MdeModul= ePkg\CoreDxe: Allow DXE > Drivers to use untested memory >=20 > if this is auto promotion is happening in the core then what is the > value of memory testing and tracking that state. Is memory testing > state a necessary feature of the Dxe Core? >=20 >=20 > I think it makes more sense that if you platform wants to use a given > range your platform should either test it and/or mark it as tested. >=20 > OR >=20 > The dxe core should do away with the memory testing tracking. >=20 >=20 > On most platforms i have seen in the past few years all memory is marked > as tested without doing any testing. The only value in the flag is keep > the initial memory allocations in a given low range (below 4gb). >=20 >=20 >=20 >=20 > On 1/10/2022 5:59 PM, gaoliming wrote: > > Stacy: > > This fix covers the case with AllocateAddress allocation type. I agr= ee > > this fix. Reviewed-by: Liming Gao > > > > Thanks > > Liming > >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > >> =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Stacy > Howell > >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B41=E6=9C=888=E6=97= =A5 3:36 > >> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > >> =E6=8A=84=E9=80=81: Stacy Howell ; Dandan Bi > >> ; Liming Gao > >> =E4=B8=BB=E9=A2=98: [edk2-devel] [PATCH] MdeModulePkg\CoreDxe: Allow D= XE Drivers > to > >> use untested memory > >> > >> REF: https://https://bugzilla.tianocore.org/show_bug.cgi?id=3D3795 > >> CC: Dandan Bi > >> CC: Liming Gao > >> > >> Updated CoreInternalAllocatePages() to call PromoteMemoryResource() > and > >> re-attempt the allocation if unable to convert the specified memory ra= nge > >> > >> Signed-off-by: Stacy Howell > >> --- > >> MdeModulePkg/Core/Dxe/Mem/Page.c | 14 ++++++++++++++ > >> 1 file changed, 14 insertions(+) > >> > >> diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c > >> b/MdeModulePkg/Core/Dxe/Mem/Page.c > >> index 47d4c5d92e..cc0b90ac0d 100644 > >> --- a/MdeModulePkg/Core/Dxe/Mem/Page.c > >> +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c > >> @@ -1417,6 +1417,20 @@ CoreInternalAllocatePages ( > >> Status =3D CoreConvertPages (Start, NumberOfPages, MemoryType); > >> } > >> > >> + if (EFI_ERROR (Status)) { > >> + // > >> + // If requested memory region is unavailable it may be untested > >> memory > >> + // Attempt to promote memory resources, then re-attempt the > >> allocation > >> + // > >> + if (PromoteMemoryResource ()) { > >> + if (NeedGuard) { > >> + Status =3D CoreConvertPagesWithGuard (Start, NumberOfPages, > >> MemoryType); > >> + } else { > >> + Status =3D CoreConvertPages (Start, NumberOfPages, > MemoryType); > >> + } > >> + } > >> + } > >> + > >> Done: > >> CoreReleaseMemoryLock (); > >> > >> -- > >> 2.32.0.windows.2 > >> > >> > >> > >> > >> > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20