From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min M Xu <min.m.xu@intel.com>,
Erdem Aktas <erdemaktas@google.com>,
Gerd Hoffmann <kraxel@redhat.com>,
James Bottomley <jejb@linux.ibm.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH V2 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.
Date: Sat, 27 Aug 2022 14:21:14 +0800 [thread overview]
Message-ID: <fa23a54fc85716d1d788fd5c966c70383061734a.1661579220.git.min.m.xu@intel.com> (raw)
In-Reply-To: <cover.1661579220.git.min.m.xu@intel.com>
From: Min M Xu <min.m.xu@intel.com>
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
Lazy accept page can be controlled in build time like below:
-D LAZY_ACCEPT_PARTIAL_MEM=512
The unit is MB. If it is 0 then it means Lazy-accept is turned off.
Lazy-accept is turned off by default in OvmfPkgX64.
Lazy-accept is turned on with 512MB by default in IntelTdxX64.
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 8 ++++++++
OvmfPkg/OvmfPkg.dec | 4 ++++
OvmfPkg/OvmfPkgX64.dsc | 9 +++++++++
3 files changed, 21 insertions(+)
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 71b1cf8e7090..7ab2dc6fffe4 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -62,6 +62,11 @@
#
DEFINE UP_CPU_DXE_GUID = 6490f1c5-ebcc-4665-8892-0075b9bb49b7
+ #
+ # Define the size of lazy accepted memory. The unit is MB.
+ #
+ DEFINE LAZY_ACCEPT_PARTIAL_MEM = 512
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
@@ -453,6 +458,9 @@
# Point to the MdeModulePkg/Application/UiApp/UiApp.inf
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
+ # The partial memory size in Lazy accept
+ gUefiOvmfPkgTokenSpaceGuid.PcdLazyAcceptPartialMemorySize|$(LAZY_ACCEPT_PARTIAL_MEM)
+
################################################################################
#
# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
index 5af76a540529..49fc20831ad0 100644
--- a/OvmfPkg/OvmfPkg.dec
+++ b/OvmfPkg/OvmfPkg.dec
@@ -399,6 +399,10 @@
## The Tdx accept page size. 0x1000(4k),0x200000(2M)
gUefiOvmfPkgTokenSpaceGuid.PcdTdxAcceptPageSize|0x200000|UINT32|0x65
+ ## The partial memory size in Lazy accept. Its unit is MB.
+ ## The default value is 0 which means lazy accept is turned off.
+ gUefiOvmfPkgTokenSpaceGuid.PcdLazyAcceptPartialMemorySize|0|UINT64|0x68
+
[PcdsDynamic, PcdsDynamicEx]
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x10
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 6e68f60dc90f..026251ae7e69 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -78,6 +78,12 @@
DEFINE UP_CPU_PEI_GUID = 280251c4-1d09-4035-9062-839acb5f18c1
DEFINE UP_CPU_DXE_GUID = 6490f1c5-ebcc-4665-8892-0075b9bb49b7
+ #
+ # Define the size of lazy accepted memory. The unit is MB.
+ # In OvmfPkgX64, the lazy accept page is disabled by default.
+ #
+ DEFINE LAZY_ACCEPT_PARTIAL_MEM = 0
+
[BuildOptions]
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
@@ -600,6 +606,9 @@
# Point to the MdeModulePkg/Application/UiApp/UiApp.inf
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
+ # The partial memory size in Lazy accept
+ gUefiOvmfPkgTokenSpaceGuid.PcdLazyAcceptPartialMemorySize|$(LAZY_ACCEPT_PARTIAL_MEM)
+
################################################################################
#
# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
--
2.29.2.windows.2
next prev parent reply other threads:[~2022-08-27 6:22 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 6:21 [PATCH V2 00/14] Introduce Lazy-accept for Tdx guest Min Xu
2022-08-27 6:21 ` [PATCH V2 01/14] MdeModulePkg: Add PrePiHob.h Min Xu
2022-09-01 15:47 ` Gerd Hoffmann
2022-09-01 23:34 ` Min Xu
2022-09-04 11:34 ` Min Xu
2022-09-07 5:30 ` Gerd Hoffmann
2022-09-07 23:56 ` [edk2-devel] " Min Xu
2022-08-27 6:21 ` [PATCH V2 02/14] MdePkg: Increase EFI_RESOURCE_MAX_MEMORY_TYPE Min Xu
2022-08-27 6:21 ` [PATCH V2 03/14] OvmfPkg: Use EFI_RESOURCE_MEMORY_UNACCEPTED which defined in MdeModulePkg Min Xu
2022-08-27 6:21 ` [PATCH V2 04/14] MdePkg: Add UEFI Unaccepted memory definition Min Xu
2022-08-27 6:21 ` [PATCH V2 05/14] MdeModulePkg: Update Dxe to handle unaccepted memory type Min Xu
2022-08-27 6:21 ` [PATCH V2 06/14] ShellPkg: Update shell command memmap to show unaccepted memory Min Xu
2022-09-01 15:50 ` Gerd Hoffmann
2022-08-27 6:21 ` Min Xu [this message]
2022-09-01 15:56 ` [PATCH V2 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page Gerd Hoffmann
2022-09-01 23:33 ` [edk2-devel] " Min Xu
2022-09-02 5:30 ` Gerd Hoffmann
2022-08-27 6:21 ` [PATCH V2 08/14] OvmfPkg: Add MaxAcceptedMemoryAddress in TDX work area Min Xu
2022-08-27 6:21 ` [PATCH V2 09/14] OvmfPkg: Introduce lazy accept in PlatformInitLib and PlatformPei Min Xu
2022-08-27 6:21 ` [PATCH V2 10/14] OvmfPkg: Update ConstructFwHobList for lazy accept Min Xu
2022-08-27 6:21 ` [PATCH V2 11/14] MdePkg: The prototype definition of EdkiiMemoryAcceptProtocol Min Xu
2022-09-01 15:57 ` Gerd Hoffmann
2022-08-27 6:21 ` [PATCH V2 12/14] OvmfPkg: Realize EdkiiMemoryAcceptProtocol in TdxDxe Min Xu
2022-09-01 15:58 ` Gerd Hoffmann
2022-08-27 6:21 ` [PATCH V2 13/14] OvmfPkg: Call gEdkiiMemoryAcceptProtocolGuid to accept pages Min Xu
2022-09-01 15:59 ` Gerd Hoffmann
2022-08-27 6:21 ` [PATCH V2 14/14] MdeModulePkg: Pool and page functions accept memory when OOM occurs Min Xu
2022-08-29 20:47 ` Lendacky, Thomas
2022-08-30 0:29 ` [edk2-devel] " Ni, Ray
2022-08-30 6:00 ` Min Xu
2022-08-30 6:14 ` Ni, Ray
2022-08-30 6:35 ` Min Xu
2022-08-30 7:12 ` Ni, Ray
2022-08-30 7:30 ` Min Xu
2022-08-30 7:43 ` Ni, Ray
2022-08-30 8:08 ` Min Xu
2022-08-30 9:28 ` Ni, Ray
[not found] ` <17100F9FBCB0C570.28430@groups.io>
2022-08-30 7:47 ` Ni, Ray
2022-08-30 3:20 ` Min Xu
2022-08-30 14:24 ` Lendacky, Thomas
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=fa23a54fc85716d1d788fd5c966c70383061734a.1661579220.git.min.m.xu@intel.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