Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-16 Thread Dionna Glaze via groups.io
> Are you possibly including the memory pinning time (that happens in the > hypervisor before the guest is started) in your measurement? > I might be, sorry. I'd go with your numbers. > This is for 2GB (0x8000) of RAM. If I've done my calculations > correctly for a 1600MHz TSC, that comes

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-16 Thread Lendacky, Thomas via groups.io
On 6/16/22 11:44, Dionna Amalie Glaze wrote: A question: is there some performance impact when accepting all memory under 4GB? On SEV-SNP, we accept the HOBs 0-0xA000 and 0x10_-0xC00_, which takes a couple seconds, which is non-negligible. Are you possibly including the memory

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-16 Thread Dionna Glaze via groups.io
> A question: is there some performance impact when accepting all memory under > 4GB? On SEV-SNP, we accept the HOBs 0-0xA000 and 0x10_-0xC00_, which takes a couple seconds, which is non-negligible. For VMs that want to boot very fast and still have access to a lot of memory in the long

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-16 Thread Lendacky, Thomas via groups.io
On 6/16/22 00:51, Gerd Hoffmann wrote: Hi, Tom Lendacky's suggestion for SEV-SNP is to pre-accept all memory under 4GB to make all that complexity go away. Only this approach worked in my own testing. With the MMIO hole it's just validating 3GB of memory. Accepting all memory under 4GB

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-16 Thread Min Xu
On June 16, 2022 1:51 PM, Gerd Hoffmann wrote: > > > Tom Lendacky's suggestion for SEV-SNP is to pre-accept all memory > > > under 4GB to make all that complexity go away. Only this approach > > > worked in my own testing. With the MMIO hole it's just validating 3GB of > memory. > > Accepting all

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-15 Thread Gerd Hoffmann
Hi, > > Tom Lendacky's suggestion for SEV-SNP is to pre-accept all memory under > > 4GB to make all that complexity go away. Only this approach worked in my > > own testing. With the MMIO hole it's just validating 3GB of memory. > Accepting all memory under 4GB will make the things much

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-15 Thread Min Xu
On June 16, 2022 4:52 AM, Dionna Glaze wrote: > > > > > > > With the help of fw_cfg, we can know the size of > > > QemuFwCfgItemKernelSize/ > > > QemuFwCfgItemInitrdSize/QemuFwCfgItemKernelSetupSize. > > > > That'll only work with direct kernel boot, when some boot loader is in > > your boot

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-15 Thread Dionna Glaze via groups.io
> > > > With the help of fw_cfg, we can know the size of > > QemuFwCfgItemKernelSize/ > > QemuFwCfgItemInitrdSize/QemuFwCfgItemKernelSetupSize. > > That'll only work with direct kernel boot, when some boot loader > is in your boot workflow this will not work. Indeed, the TDX startup library does

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-15 Thread Gerd Hoffmann
Hi, > > Where does the 512MB figure come from? > 512MB is an experiment value. It includes the minimum DXE memories > (~96MB) and the memories to load a normal kernel-image/initrd. In our > internal test, 512MB can satisfy most of the usage scenarios without > accepting more memories later.

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-14 Thread Min Xu
Hi, Glaze We’re discussing it in another thread. I have added you into that mail thread. Your comments is always welcomed. Min From: dionnaglaze via groups.io Sent: Wednesday, June 15, 2022 12:10 AM To: Xu, Min M ; devel@edk2.groups.io Subject: Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-14 Thread Min Xu
On June 8, 2022 2:18 PM, Gerd Hoffmann wrote: > On Wed, Jun 08, 2022 at 12:06:28AM +, Xu, Min M wrote: > > On June 7, 2022 6:46 PM, Gerd Hoffmann wrote: > > > On Mon, Jun 06, 2022 at 10:59:55AM +0800, Min Xu wrote: > > > > From: Min M Xu > > > > > > > > RFC:

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-14 Thread Dionna Glaze via groups.io
Since there will be guest OSes that don't support unaccepted memory type (at least initially), and what will be run won't be known at firmware build time, can PcdLazyAcceptPartialMemorySize be initialized by a QemuFwCfg option instead of a FixedPcd? I started a different thread on this, but

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-08 Thread Gerd Hoffmann
On Wed, Jun 08, 2022 at 12:06:28AM +, Xu, Min M wrote: > On June 7, 2022 6:46 PM, Gerd Hoffmann wrote: > > On Mon, Jun 06, 2022 at 10:59:55AM +0800, Min Xu wrote: > > > From: Min M Xu > > > > > > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937 > > > > > > Lazy accept page can be

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-07 Thread Min Xu
On June 7, 2022 6:46 PM, Gerd Hoffmann wrote: > On Mon, Jun 06, 2022 at 10:59:55AM +0800, Min Xu wrote: > > 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 > >

Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-07 Thread Gerd Hoffmann
On Mon, Jun 06, 2022 at 10:59:55AM +0800, Min Xu wrote: > 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

[edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page.

2022-06-05 Thread Min Xu
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.