From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.46431.1661581332997885650 for ; Fri, 26 Aug 2022 23:22:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=a6vVwxSe; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661581349; x=1693117349; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S6iEurXFQgvKOnM/A9ZrMgXi+1uXcAzWIO5wXObAl3Y=; b=a6vVwxSezskpJQsPr9XY+pyKYQBWcUcszvZA5fnr1PcNW6iaS9dtgBcf FDg+YdPL07LFvI5vs4SDsfcnvZIQarQ7J4DahXcfH9sbJD5hI3onpA/aA tbcsbeLMgl1a2DgLyjjDdRINy5wP2tsMkz76gC+yGVaz1iM2bhyWMta0U LOdbWPm6O1LDrqH3zoHuEEsexYA4YeP9Zc8zzEEK91Ea6KfxjIiXlkT+b 0AiE+f6D4od8LOdiCOQcUkrQQEOKDOr4akOoTA/ejbGz8c+F4cJN3i7Db Qo9NxAnFxzd+KqUFsQw/ilbzGJDX6g4ikIxQdvxBNbCYn6SX0sHRCOz72 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="356355828" X-IronPort-AV: E=Sophos;i="5.93,267,1654585200"; d="scan'208";a="356355828" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 23:22:28 -0700 X-IronPort-AV: E=Sophos;i="5.93,267,1654585200"; d="scan'208";a="671738760" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.171.119]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 23:22:26 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [PATCH V2 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page. Date: Sat, 27 Aug 2022 14:21:14 +0800 Message-Id: X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu 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 Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu --- 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