From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.27749.1654484424914450989 for ; Sun, 05 Jun 2022 20:00:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=GS1TBEJv; spf=pass (domain: intel.com, ip: 134.134.136.24, 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=1654484437; x=1686020437; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KrnP+PXk0OybKFQI3MW9BpSA05sZOOmiXuEHt749dHk=; b=GS1TBEJvlcHqdjxhfllbGRzZICUsgAsgxBLY8BkWbIUnxIDGXyeI+o71 c/81do1Fwz3T/TdgJZcLepZKiFgl4D5oinr7OWedc7tiR1wBsvFWwEL+l 7XS65bEIX0kwfh2kWlGwZGysTL4FSLVcu7IOuTaIkamZRTdW/Tt2t8RHU 4nE+ANEB8g5dFhEYD4g/HQc1smb0vqki3d4rmDruDn6oy6rtGdRZ8qZjA 5LG4PeLzCR1ib9Ule+qZJXShMJA+YMiezCLssqySrMITucMiJw9Xe3rlv LYroHsYH/pvHHj1R1aYxGLeFLsvBDtItSzShc9mCrD1gY8cmx+rU2wdPY g==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="276458115" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="276458115" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:00:36 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="647285792" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.66]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:00:34 -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 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page. Date: Mon, 6 Jun 2022 10:59:55 +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 43ab8bd089d9..c6195ab9c9d7 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 @@ -450,6 +455,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 5fe487f82d1a..7444765fe760 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 1448f925b782..398981b6dad8 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 @@ -601,6 +607,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