From nobody Fri Nov 15 08:25:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+90223+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90223+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1654484438; cv=none; d=zohomail.com; s=zohoarc; b=dDwlF44r+rK20EJBCmbne8GXLRZ1fUB7vcCI55xb0NQAoDp7D8Cx1djOOUf00YL7AaX6oddhZvxIFEJ6BgGqvTD6/j5tFG9xR/Iq5ysj7YXTdEF1Lxx6XMqnnbhZV981rLHUgTPQ3G83NVW4qmf3dfEIAfokcIFvP2H0VjeyWiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654484438; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=LQSFxPgihhWLLdyKefJQrZWI2wsxjPGp7f2/ZAVXjc0=; b=J4S9Uww5qI/klFuPm2YrhASimfIykj/j36IzXJLLbWABgqWYYcT7hCwijrnACdQWT1QmRS93DxMEXbgzo1TS2qxI8Ow0g2Dqz1ocYQ2eO/NXSQlu0v09uTCwtxel58F0OgoepWMuWaAHfTFh4P847DjqG1TURfqGUb7W+GnFE+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90223+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165448443808025.10505788081889; Sun, 5 Jun 2022 20:00:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id W4oKYY1788612xBvNPhF2JZ8; Sun, 05 Jun 2022 20:00:37 -0700 X-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 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" X-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" X-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: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page. Date: Mon, 6 Jun 2022 10:59:55 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: 3AG9u4VJrYKIk1srlFvzJheGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1654484437; bh=LrwGNcdENsTvxkM7xx/w2yPqJxaxP+6jVhK3DuK5G+w=; h=Cc:Date:From:Reply-To:Subject:To; b=F6pcnLamfLqA8Iao6/yXcRJJimPKArDutOkTPoa0yuv3QggZNziQtta9NLpO21RYJM5 92qkHDHgl45qPVwV+gBmhZugFnbr5PtUz6zu6rPO/m/W3OzLTxFJlQjWuxz21r41Qmluz T0VeQX8Ij4zcDLUnlP6gS2I5AaiqqzMcmj0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1654484438886100021 Content-Type: text/plain; charset="utf-8" From: Min M Xu RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3937 Lazy accept page can be controlled in build time like below: -D LAZY_ACCEPT_PARTIAL_MEM=3D512 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/IntelTdxX6= 4.dsc index 43ab8bd089d9..c6195ab9c9d7 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -62,6 +62,11 @@ # DEFINE UP_CPU_DXE_GUID =3D 6490f1c5-ebcc-4665-8892-0075b9bb49b7 =20 + # + # Define the size of lazy accepted memory. The unit is MB. + # + DEFINE LAZY_ACCEPT_PARTIAL_MEM =3D 512 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS =3D /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, 0= x31 } =20 + # 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 Pla= tform 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 =20 + ## 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 =3D 280251c4-1d09-4035-9062-839acb5f18c1 DEFINE UP_CPU_DXE_GUID =3D 6490f1c5-ebcc-4665-8892-0075b9bb49b7 =20 + # + # 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 =3D 0 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS =3D /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, 0= x31 } =20 + # 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 Pla= tform --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90223): https://edk2.groups.io/g/devel/message/90223 Mute This Topic: https://groups.io/mt/91570202/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-