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 918E0D806DA for ; Tue, 9 Apr 2024 06:24:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=2VZodl37ShzyzlQrAoapP72vK7CjGB8Wo/1nm3kFaUE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20240206; t=1712643841; v=1; b=Z9Fb3yyMsL1s3h0kJKy8H8JblvyL/tFzqleMWMA4QG1nyZQY3b9NI9uqXmoS9kEt6Ex8eKIr iWYqAhnek2v7xLeKn7+YYtpmU1uEAXGdoz8z3DnV1ZsRGzYIjx09vnb0tKJo7H+kpwqBc/+mK+X tgMlDJYmhmx0co0xNHN4lUJ2j6ApoMAajsU0qiTl3oXp6E0da/M6ZnseFk3/GYQtH0opfWxSgXe wAt4xq9dvAFcQo8BoO7zTmAvNtD191vidboex5wYDY2t4GgIYOo0k2eTBKZpvwYKwTqrdJTafCs BMt1hMdg/4RyeQqfuz4/qOCuCzBV0Ig6q2JlujFOm9baQ== X-Received: by 127.0.0.2 with SMTP id MivIYY7687511xe5M7uSH3Sg; Mon, 08 Apr 2024 23:24:01 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web11.130100.1712643839872500638 for ; Mon, 08 Apr 2024 23:24:00 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 8F38CA32E112 for ; Tue, 9 Apr 2024 14:23:57 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 7C3D5A32E0A2 for ; Tue, 9 Apr 2024 14:23:57 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 80C58A32E11A for ; Tue, 9 Apr 2024 14:23:54 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Tue, 09 Apr 2024 14:23:52 +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 via groups.io" To: , Cc: "'Bi, Dandan'" , "'Liu, Yun Y'" , "'Yao, Jiewen'" , "'Ni, Ray'" , "'Kinney, Michael D'" , "'Liu, Zhiguang'" References: <20240326075733.4223-1-aaron.li@intel.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYyIDEvMV0gTWRlTW9kdWxlUGtnL0FjcGlUYWJsZUR4ZTogUENEIHN3aXRjaCB0byBhdm9pZCB1c2luZyBBQ1BJIHJlY2xhaW0gbWVtb3J5?= Date: Tue, 9 Apr 2024 14:23:52 +0800 Message-ID: <003601da8a46$7e3865a0$7aa930e0$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQLU8bBnpPaIbFlJxf2/onSm8yuJwwHAqYN+AddyqnSvTeinAA== 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 Resent-Date: Mon, 08 Apr 2024 23:24:00 -0700 Resent-From: gaoliming@byosoft.com.cn Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: IBSV3T7PO5uxMXeiZTCzW5D6x7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=Z9Fb3yyM; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io PR https://github.com/tianocore/edk2/pull/5539 has been created. Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Aaron Li > =B7=A2=CB=CD=CA=B1=BC=E4: 2024=C4=EA4=D4=C21=C8=D5 10:32 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; Liming Gao > =B3=AD=CB=CD: Bi, Dandan ; Liu, Yun Y ; > Yao, Jiewen ; Ni, Ray ; Kinney, > Michael D ; Liu, Zhiguang > > =D6=F7=CC=E2: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: = PCD > switch to avoid using ACPI reclaim memory >=20 > Hi Liming, >=20 > Could you please help review and merge it? Thanks. >=20 > Best, > Aaron >=20 > -----Original Message----- > From: Liu, Zhiguang > Sent: Monday, April 1, 2024 10:06 AM > To: Li, Aaron ; devel@edk2.groups.io > Cc: Bi, Dandan ; Liming Gao > ; Liu, Yun Y ; Yao, Jiewen > ; Ni, Ray ; Kinney, Michael D > > Subject: RE: [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to > avoid using ACPI reclaim memory >=20 > Reviewed-by: Zhiguang Liu >=20 > > -----Original Message----- > > From: Li, Aaron > > Sent: Tuesday, March 26, 2024 3:58 PM > > To: devel@edk2.groups.io > > Cc: Liu, Zhiguang ; Bi, Dandan > > ; Liming Gao ; Liu, Yun > Y > > ; Yao, Jiewen ; Ni, Ray > > ; Kinney, Michael D > > Subject: [PATCH v2 1/1] MdeModulePkg/AcpiTableDxe: PCD switch to avoid > > using ACPI reclaim memory > > > > UEFI spec defined ACPI Tables at boot time can be contained in memory o= f > > type EfiACPIReclaimMemory or EfiAcpiMemoryNVS, although > InstallAcpiTable > > with AcpiTableProtocol will only allocate memory with type > > EfiACPIReclaimMemory (Except FACS). > > > > This patch provides an optional method controlled by PCD to avoid using > > EfiACPIReclaimMemory, by setting the PCD PcdNoACPIReclaimMemory to > > TRUE, all ACPI allocated memory will use EfiAcpiMemoryNVS instead. > > > > Cc: Zhiguang Liu > > Cc: Dandan Bi > > Cc: Liming Gao > > Cc: Liu Yun > > Cc: Jiewen Yao > > Cc: Ray Ni > > Cc: Michael D Kinney > > Signed-off-by: Aaron Li > > --- > > MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 37 > > +++++++++++++++----- > > MdeModulePkg/MdeModulePkg.dec > | 7 ++++ > > MdeModulePkg/MdeModulePkg.uni > | 8 +++++ > > MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf | 1 > + > > 4 files changed, 45 insertions(+), 8 deletions(-) > > > > diff --git > a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > > b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > > index e09bc9b704f5..080768033cfa 100644 > > --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > > +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > > @@ -340,6 +340,7 @@ ReallocateAcpiTableBuffer ( > > EFI_ACPI_TABLE_INSTANCE TempPrivateData; > > EFI_STATUS Status; > > UINT64 CurrentData; > > + EFI_MEMORY_TYPE AcpiAllocateMemoryType; > > > > CopyMem (&TempPrivateData, AcpiTableInstance, sizeof > > (EFI_ACPI_TABLE_INSTANCE)); > > // > > @@ -359,6 +360,12 @@ ReallocateAcpiTableBuffer ( > > NewMaxTableNumber * sizeof (UINT32); > > } > > > > + if (PcdGetBool (PcdNoACPIReclaimMemory)) { > > + AcpiAllocateMemoryType =3D EfiACPIMemoryNVS; } else { > > + AcpiAllocateMemoryType =3D EfiACPIReclaimMemory; } > > + > > if (mAcpiTableAllocType !=3D AllocateAnyPages) { > > // > > // Allocate memory in the lower 32 bit of address range for @@ > -372,13 > > +379,13 @@ ReallocateAcpiTableBuffer ( > > PageAddress =3D 0xFFFFFFFF; > > Status =3D gBS->AllocatePages ( > > mAcpiTableAllocType, > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > EFI_SIZE_TO_PAGES (TotalSize), > > &PageAddress > > ); > > } else { > > Status =3D gBS->AllocatePool ( > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > TotalSize, > > (VOID **)&Pointer > > ); > > @@ -512,6 +519,7 @@ AddTableToList ( > > EFI_PHYSICAL_ADDRESS AllocPhysAddress; > > UINT64 Buffer64; > > BOOLEAN AddToRsdt; > > + EFI_MEMORY_TYPE AcpiAllocateMemoryType; > > > > // > > // Check for invalid input parameters @@ -550,6 +558,12 @@ > > AddTableToList ( > > CurrentTableList->TableSize =3D CurrentTableSize; > > CurrentTableList->PoolAllocation =3D FALSE; > > > > + if (PcdGetBool (PcdNoACPIReclaimMemory)) { > > + AcpiAllocateMemoryType =3D EfiACPIMemoryNVS; } else { > > + AcpiAllocateMemoryType =3D EfiACPIReclaimMemory; } > > + > > // > > // Allocation memory type depends on the type of the table > > // > > @@ -585,7 +599,7 @@ AddTableToList ( > > // such as AArch64 that allocate multiples of 64 KB > > // > > Status =3D gBS->AllocatePool ( > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > CurrentTableList->TableSize, > > (VOID **)&CurrentTableList->Table > > ); > > @@ -596,7 +610,7 @@ AddTableToList ( > > // > > Status =3D gBS->AllocatePages ( > > mAcpiTableAllocType, > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > EFI_SIZE_TO_PAGES > (CurrentTableList->TableSize), > > &AllocPhysAddress > > ); > > @@ -1944,6 +1958,7 @@ AcpiTableAcpiTableConstructor ( > > UINTN RsdpTableSize; > > UINT8 *Pointer; > > EFI_PHYSICAL_ADDRESS PageAddress; > > + EFI_MEMORY_TYPE AcpiAllocateMemoryType; > > > > // > > // Check for invalid input parameters @@ -1978,17 +1993,23 @@ > > AcpiTableAcpiTableConstructor ( > > RsdpTableSize +=3D sizeof > > (EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER); > > } > > > > + if (PcdGetBool (PcdNoACPIReclaimMemory)) { > > + AcpiAllocateMemoryType =3D EfiACPIMemoryNVS; } else { > > + AcpiAllocateMemoryType =3D EfiACPIReclaimMemory; } > > + > > if (mAcpiTableAllocType !=3D AllocateAnyPages) { > > PageAddress =3D 0xFFFFFFFF; > > Status =3D gBS->AllocatePages ( > > mAcpiTableAllocType, > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > EFI_SIZE_TO_PAGES (RsdpTableSize), > > &PageAddress > > ); > > } else { > > Status =3D gBS->AllocatePool ( > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > RsdpTableSize, > > (VOID **)&Pointer > > ); > > @@ -2037,13 +2058,13 @@ AcpiTableAcpiTableConstructor ( > > PageAddress =3D 0xFFFFFFFF; > > Status =3D gBS->AllocatePages ( > > mAcpiTableAllocType, > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > EFI_SIZE_TO_PAGES (TotalSize), > > &PageAddress > > ); > > } else { > > Status =3D gBS->AllocatePool ( > > - EfiACPIReclaimMemory, > > + AcpiAllocateMemoryType, > > TotalSize, > > (VOID **)&Pointer > > ); > > diff --git a/MdeModulePkg/MdeModulePkg.dec > > b/MdeModulePkg/MdeModulePkg.dec index a82dedc070df..a91058e5b5df > > 100644 > > --- a/MdeModulePkg/MdeModulePkg.dec > > +++ b/MdeModulePkg/MdeModulePkg.dec > > @@ -1533,6 +1533,13 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] > > # @Prompt Exposed ACPI table versions. > > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x3E|UIN > > T32|0x0001004c > > > > + ## Indicates whether ACPI Reclaim memory is not available # Default > > + is FALSE that means ACPI Reclaim memory is available # If it is set > > + to TRUE that means ACPI Reclaim memory is not available # For > example > > + ACPI Table protocol will use ACPI NVS memory instead of ACPI Reclaim > > + memory # @Prompt ACPI Reclaim memory is not available. > > + > > + > > > gEfiMdeModulePkgTokenSpaceGuid.PcdNoACPIReclaimMemory|FALSE|BOOL > > EAN|0x > > + 0001008b > > + > > ## This PCD defines the MAX repair count. > > # The default value is 0 that means infinite. > > # @Prompt MAX repair count > > diff --git a/MdeModulePkg/MdeModulePkg.uni > > b/MdeModulePkg/MdeModulePkg.uni index > > a17d34d60b21..6079285e3f8b 100644 > > --- a/MdeModulePkg/MdeModulePkg.uni > > +++ b/MdeModulePkg/MdeModulePkg.uni > > @@ -955,6 +955,14 @@ > > > "BIT 4 - > > EFI_ACPI_TABLE_VERSION_4_0.
\n" > > > "BIT 5 - > > EFI_ACPI_TABLE_VERSION_5_0.
" > > > > +#string > > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNoACPIReclaimMemory_PROM > > PT #language en-US "ACPI Reclaim memory is not available." > > + > > +#string > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNoACPIReclaimMemory_HELP > > #language en-US "Indicates whether ACPI Reclaim memory is not > available\n" > > + > "Default is FALSE that means ACPI > > Reclaim memory is available\n" > > + > "If it is set to TRUE that means > > ACPI Reclaim memory is not available\n" > > + > "For example ACPI Table protocol > > will use ACPI NVS memory instead of ACPI Reclaim memory" > > + > > + > > #string > > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHiiOsRuntimeSupport_PROMPT > > #language en-US "Enable export HII data and configuration to be used in OS > > runtime." > > > > #string > > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdHiiOsRuntimeSupport_HELP > > #language en-US "Indicates if HII data and configuration has been > > exported.

\n" > > diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > > b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > > index 86dea43e27e4..be498a56cff0 100644 > > --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > > +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > > @@ -68,6 +68,7 @@ [Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId > ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision > ## > > CONSUMES > > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions > ## > > CONSUMES > > + gEfiMdeModulePkgTokenSpaceGuid.PcdNoACPIReclaimMemory > ## > > CONSUMES > > > > [Protocols] > > gEfiAcpiTableProtocolGuid ## PRODUCES > > -- > > 2.44.0.windows.1 >=20 >=20 >=20 >=20 >=20 -=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 (#117538): https://edk2.groups.io/g/devel/message/117538 Mute This Topic: https://groups.io/mt/105417180/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-