From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: "Liming Gao" <gaoliming@byosoft.com.cn>,
"László Érsek" <lersek@redhat.com>,
"Oliver Steffen" <osteffen@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [edk2-devel] [PATCH v2 1/2] MdeModulePkg: rename PcdUse5LevelPageTable to PcdEnable5LevelPageTable
Date: Thu, 25 Jan 2024 09:20:56 +0100 [thread overview]
Message-ID: <20240125082057.309133-2-kraxel@redhat.com> (raw)
In-Reply-To: <20240125082057.309133-1-kraxel@redhat.com>
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 <kraxel@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|BOOLEAN|0x0001105F
+ gEfiMdeModulePkgTokenSpaceGuid.PcdEnable5LevelPageTable|FALSE|BOOLEAN|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_PROMPT #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 (#114373): https://edk2.groups.io/g/devel/message/114373
Mute This Topic: https://groups.io/mt/103950404/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-01-25 8:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 8:20 [edk2-devel] [PATCH v2 0/2] MdeModulePkg: 5-level paging fixes Gerd Hoffmann
2024-01-25 8:20 ` Gerd Hoffmann [this message]
2024-01-25 12:01 ` [edk2-devel] [PATCH v2 1/2] MdeModulePkg: rename PcdUse5LevelPageTable to PcdEnable5LevelPageTable Ni, Ray
2024-01-25 12:17 ` Gerd Hoffmann
2024-01-26 2:49 ` Zhiguang Liu
2024-01-26 13:19 ` Gerd Hoffmann
2024-01-25 8:20 ` [edk2-devel] [PATCH v2 2/2] MdeModulePkg/VirtualMemory: fix 5-level paging assert Gerd Hoffmann
2024-01-25 23:22 ` [edk2-devel] [PATCH v2 0/2] MdeModulePkg: 5-level paging fixes Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240125082057.309133-2-kraxel@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox