Rename an existing PCD might break lots of platform builds. When 5-level paging capability was added to ResetVector, I also considered to remove the PcdUse5LevelPageTable reference from C code.
Let me think about it... Thanks, Ray > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd > Hoffmann > Sent: Thursday, January 25, 2024 4:21 PM > To: devel@edk2.groups.io > Cc: Liming Gao <gaolim...@byosoft.com.cn>; László Érsek > <ler...@redhat.com>; Oliver Steffen <ostef...@redhat.com>; Gerd Hoffmann > <kra...@redhat.com> > Subject: [edk2-devel] [PATCH v2 1/2] MdeModulePkg: rename > PcdUse5LevelPageTable to PcdEnable5LevelPageTable > > The PCD will allow but not require 5-level paging. Whenever 5-level > paging is used or not will be decided by the ResetVector, by looking > at CPU capabilities. Rename the PCD to make that clear. > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > --- > MdeModulePkg/MdeModulePkg.dec | 2 +- > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 2 +- > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 4 ++-- > MdeModulePkg/MdeModulePkg.uni | 4 ++-- > 4 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec > index a2cd83345f5b..80047f029d36 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -2105,7 +2105,7 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, > PcdsDynamic, PcdsDynamicEx] > # TRUE - 5-Level Paging will be enabled.<BR> > # FALSE - 5-Level Paging will not be enabled.<BR> > # @Prompt Enable 5-Level Paging support in long mode. > - > gEfiMdeModulePkgTokenSpaceGuid.PcdUse5LevelPageTable|FALSE|BOOLEA > N|0x0001105F > + > gEfiMdeModulePkgTokenSpaceGuid.PcdEnable5LevelPageTable|FALSE|BOOLE > AN|0x0001105F > > ## Capsule In Ram is to use memory to deliver the capsules that will be > processed after system > # reset.<BR><BR> > diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > index f1990eac7760..d73add2d814d 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > @@ -104,7 +104,7 @@ [Pcd.IA32,Pcd.X64] > gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask > ## CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask ## > CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## > CONSUMES > - gEfiMdeModulePkgTokenSpaceGuid.PcdUse5LevelPageTable ## > SOMETIMES_CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdEnable5LevelPageTable ## > SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase ## > CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize ## > CONSUMES > > diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > index 980c2002d4f5..46528e4f719d 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > @@ -745,13 +745,13 @@ CreateIdentityMappingPageTables ( > // > Cr4.UintN = AsmReadCr4 (); > Page5LevelSupport = (Cr4.Bits.LA57 != 0); > - ASSERT (PcdGetBool (PcdUse5LevelPageTable) == Page5LevelSupport); > + ASSERT (PcdGetBool (PcdEnable5LevelPageTable) == Page5LevelSupport); > } else { > // > // If cpu runs in 32bit protected mode PEI, Page table Level in DXE is > decided > by PCD and feature capability. > // > Page5LevelSupport = FALSE; > - if (PcdGetBool (PcdUse5LevelPageTable)) { > + if (PcdGetBool (PcdEnable5LevelPageTable)) { > AsmCpuidEx ( > CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS, > CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_SUB_LEAF_INFO, > diff --git a/MdeModulePkg/MdeModulePkg.uni > b/MdeModulePkg/MdeModulePkg.uni > index a17d34d60b21..7a98dc64832b 100644 > --- a/MdeModulePkg/MdeModulePkg.uni > +++ b/MdeModulePkg/MdeModulePkg.uni > @@ -1332,9 +1332,9 @@ > > "required to be accessed in PcdDxe > driver entry point. So, its value must be set in PEI phase." > > "It can't depend on EFI variable > service, and can't be DynamicExHii PCD." > > -#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUse5LevelPageTable_PROMPT > #language en-US "Enable 5-Level Paging support in long mode" > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEnable5LevelPageTable_PROMP > T #language en-US "Enable 5-Level Paging support in long mode" > > -#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdUse5LevelPageTable_HELP > #language en-US "Indicates if 5-Level Paging will be enabled in long mode. 5- > Level Paging will not be enabled" > +#string > STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEnable5LevelPageTable_HELP > #language en-US "Indicates if 5-Level Paging will be enabled in long mode. 5- > Level Paging will not be enabled" > > "when the PCD is TRUE but CPU > doesn't support 5-Level Paging." > > " TRUE - 5-Level Paging will be > enabled." > > " FALSE - 5-Level Paging will not be > enabled." > -- > 2.43.0 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114392): https://edk2.groups.io/g/devel/message/114392 Mute This Topic: https://groups.io/mt/103950404/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-