audk/OvmfPkg/Library
Min M Xu 451521ccbc OvmfPkg/PlatformInitLib: Implement multi-core accept memory for TDVF
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

TDVF once accepts memory only by BSP. To improve the boot performance
this patch introduce the multi-core accpet memory. Multi-core means
BSP and APs work together to accept memory.

TDVF leverages mailbox to wake up APs. It is not enabled in MpInitLib
(Which requires SIPI). So multi-core accept memory cannot leverages
MpInitLib to coordinate BSP and APs to work together.

So TDVF split the accept memory into 2 phases.
- AcceptMemoryForAPsStack:
  BSP accepts a small piece of memory which is then used by APs to setup
  stack. We assign a 16KB stack for each AP. So a td-guest with 256 vCPU
  requires 255*16KB = 4080KB.
- AcceptMemory:
  After above small piece of memory is accepted, BSP commands APs to
  accept memory by sending AcceptPages command in td-mailbox. Together
  with the command and accpet-function, the APsStack address is send
  as well. APs then set the stack and jump to accept-function to accept
  memory.

AcceptMemoryForAPsStack accepts as small memory as possible and then jump
to AcceptMemory. It fully takes advantage of BSP/APs to work together.
After accept memory is done, the memory region for APsStack is not used
anymore. It can be used as other private memory. Because accept-memory
is in the very beginning of boot process and it will not impact other
phases.

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>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2022-12-21 07:06:17 +00:00
..
AcpiTimerLib OvmfPkg: Update DxeAcpiTimerLib to read HostBridgeDevId in PlatformInfoHob 2022-04-02 10:09:47 +00:00
BaseCachingPciExpressLib OvmfPkg/BaseCachingPciExpressLib: Migrate BaseCachingPciExpressLib 2022-01-29 17:36:59 +00:00
BaseMemEncryptSevLib OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib 2022-11-14 04:55:34 +00:00
BaseMemEncryptTdxLib OvmfPkg: Call gEdkiiMemoryAcceptProtocolGuid to accept pages 2022-11-01 10:08:10 +00:00
BasePciCapLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BasePciCapPciSegmentLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BhyveFwCtlLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BlobVerifierLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CcExitLib OvmfPkg: Add INVD case in #VE handler 2022-12-09 07:08:50 +00:00
CcProbeLib OvmfPkg: Update CcProbeLib to DxeCcProbeLib 2022-09-06 06:03:45 +00:00
DxePciLibI440FxQ35 OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EmuVariableFvbLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GenericQemuLoadImageLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HardwareInfoLib Ovmf/HardwareInfoLib: Add Dxe lib to dynamically parse heterogenous data 2022-06-22 15:34:16 +00:00
LoadLinuxLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
LockBoxLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MpInitLibDepLib OvmfPkg: Add MpInitLibDepLib 2022-05-11 08:40:53 +00:00
NvVarsFileLib OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot 2022-09-06 07:21:42 +00:00
PciHostBridgeLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciHostBridgeLibScan OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PciHostBridgeUtilityLib OvmfPkg/PciHostBridgeUtilityLib: Initialize RootBridges apertures with spec 2022-06-22 15:34:16 +00:00
PeilessStartupLib OvmfPkg: Use BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTED defined in MdeModulePkg 2022-11-01 10:08:10 +00:00
PlatformBmPrintScLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformBootManagerLib OvmfPkg/QemuBootOrderLib: add StoreQemuBootOrder() 2022-09-06 16:55:33 +00:00
PlatformBootManagerLibBhyve OvmfPkg: Call PlatformInitializeConsole for GPU passthrough case 2021-12-17 17:36:14 +00:00
PlatformBootManagerLibGrub OvmfPkg: Call PlatformInitializeConsole for GPU passthrough case 2021-12-17 17:36:14 +00:00
PlatformDebugLibIoPort OvmfPkg/DebugLibIoPort: use Rom version for PEI 2022-12-14 17:45:41 +00:00
PlatformFvbLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PlatformHasIoMmuLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
PlatformInitLib OvmfPkg/PlatformInitLib: Implement multi-core accept memory for TDVF 2022-12-21 07:06:17 +00:00
PlatformSecureLib OvmfPkg: strip trailing whitespace 2019-10-04 11:18:32 +01:00
PxeBcPcdProducerLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
QemuBootOrderLib OvmfPkg: rename QemuBootOrderNNNN to VMMBootOrderNNNN 2022-10-07 18:14:05 +00:00
QemuFwCfgLib OvmfPkg/QemuFwCfgLib: remove mQemuFwCfgSupported + mQemuFwCfgDmaSupported 2022-12-14 17:45:41 +00:00
QemuFwCfgS3Lib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
QemuFwCfgSimpleParserLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ResetSystemLib OvmfPkg: Handle Cloud Hypervisor host bridge 2021-12-11 14:26:05 +00:00
SerializeVariablesLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmbiosVersionLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmCpuFeaturesLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmCpuPlatformHookLibQemu OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Tcg2PhysicalPresenceLibNull OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Tcg2PhysicalPresenceLibQemu OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
TdxMailboxLib OvmfPkg/TdxMailboxLib: Add NULL instance of TdxMailboxLib 2022-12-21 07:06:17 +00:00
TlsAuthConfigLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UefiDriverEntryPointFwCfgOverrideLib OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver load 2022-09-10 08:23:27 +00:00
UefiPciCapPciIoLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VirtioLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VirtioMmioDeviceLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
X86QemuLoadImageLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenConsoleSerialPortLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenHypercallLib OvmfPkg/XenHypercallLib: Fix naming of AArch64 2022-07-28 01:22:13 +00:00
XenIoMmioLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenPlatformLib OvmfPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XenRealTimeClockLib OvmfPkg: Remove duplicated words 2022-09-05 13:52:51 +00:00