summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenPlatformPei/Cmos.c
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2022-12-20 16:42:40 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-12-21 07:06:17 +0000
commit451521ccbcaa45de27fbcd2565cb363fd05e3661 (patch)
tree9e02fee753b29a92dc326e9e34e2a9c4c553e9ac /OvmfPkg/XenPlatformPei/Cmos.c
parentc55cf3f7958969b59dee0513c1826a3694de50b0 (diff)
downloadedk2-451521ccbcaa45de27fbcd2565cb363fd05e3661.tar.gz
edk2-451521ccbcaa45de27fbcd2565cb363fd05e3661.tar.bz2
edk2-451521ccbcaa45de27fbcd2565cb363fd05e3661.zip
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>
Diffstat (limited to 'OvmfPkg/XenPlatformPei/Cmos.c')
0 files changed, 0 insertions, 0 deletions