Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: a00b71b009a60947fec8ace0ac56ab2ece887d97
      
https://github.com/tianocore/edk2/commit/a00b71b009a60947fec8ace0ac56ab2ece887d97
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M OvmfPkg/Library/TdxMailboxLib/TdxMailbox.c

  Log Message:
  -----------
  OvmfPkg/TdxMailboxLib: Delete global variables

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

TdxMailboxLib once was designed to be used in DXE phase. But now it is
going to be used in SEC/PEI phase (in the following patches). Global
variables are not allowed. The library is refactored after those global
variables are deleted.

Cc: Erdem Aktas <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


  Commit: b21fe5a8a62441975e03728c25318c11d7732509
      
https://github.com/tianocore/edk2/commit/b21fe5a8a62441975e03728c25318c11d7732509
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf
    A OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf

  Log Message:
  -----------
  OvmfPkg/TdxMailboxLib: Add NULL instance of TdxMailboxLib

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

TdxMailboxLib is designed only for TDX guest which arch is X64. This
patch set the VALID_ARCHITECTURES of TdxMailboxLib as X64.

Because in the following patches TdxMailboxLib will be included in
PlatformInitLib. While PlatformInitLib is imported by some X64 platforms
(for example AmdSevX64.dsc). So we need a NULL instance of TdxMailboxLib
which VALID_ARCHITECTURES is X64 as well. Based on this consideration
we design TdxMailboxLibNull.

Cc: Erdem Aktas <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


  Commit: 4d8651c2fbe039cdb1af48b615ba99b64a34845d
      
https://github.com/tianocore/edk2/commit/4d8651c2fbe039cdb1af48b615ba99b64a34845d
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M OvmfPkg/AmdSev/AmdSevX64.dsc
    M OvmfPkg/CloudHv/CloudHvX64.dsc
    M OvmfPkg/Microvm/MicrovmX64.dsc
    M OvmfPkg/OvmfPkgIa32.dsc
    M OvmfPkg/OvmfPkgIa32X64.dsc

  Log Message:
  -----------
  OvmfPkg: Add TdxMailboxLibNull in some platform dsc

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

In the following patches TdxMailboxLib will be included in
PlatformInitLib. While PlatformInitLib is imported by some IA32/X64
platforms (for example AmdSevX64.dsc). So TdxMailboxLibNull is added in
those platforms which don't support TDX feature.

Cc: Erdem Aktas <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


  Commit: 0547ffbf6df53666dfd79def23f8a200dcb23b34
      
https://github.com/tianocore/edk2/commit/0547ffbf6df53666dfd79def23f8a200dcb23b34
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    A OvmfPkg/IntelTdx/Sec/X64/IntelTdxAPs.nasm
    M OvmfPkg/IntelTdx/Sec/X64/SecEntry.nasm
    M OvmfPkg/Sec/X64/SecEntry.nasm

  Log Message:
  -----------
  OvmfPkg/Sec: Move TDX APs related nasm code to IntelTdxAPs.nasm

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

This patch moves the TDX APs nasm code from SecEntry.nasm to
IntelTdxAPs.nasm. IntelTdxX64 and OvmfPkgX64 use the same nasm so that
it can be easier to be managed. In the following patch there will be
AcceptMemory related changes in IntelTdxAPs.nasm.

Cc: Erdem Aktas <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


  Commit: c55cf3f7958969b59dee0513c1826a3694de50b0
      
https://github.com/tianocore/edk2/commit/c55cf3f7958969b59dee0513c1826a3694de50b0
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M OvmfPkg/Include/TdxCommondefs.inc
    M OvmfPkg/IntelTdx/Sec/X64/IntelTdxAPs.nasm

  Log Message:
  -----------
  OvmfPkg: Enable APs to accept memory for TDVF

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4172

TDVF APs once did nothing but spin around to wait for the Wakeup command.
This patch enables APs to handle the AcceptPages command. Once APs find
the AcceptPages command, it set its stack and jump to the function of
ApAcceptMemoryResourceRange (which will be introduced in the following
patch).

Cc: Erdem Aktas <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


  Commit: 451521ccbcaa45de27fbcd2565cb363fd05e3661
      
https://github.com/tianocore/edk2/commit/451521ccbcaa45de27fbcd2565cb363fd05e3661
  Author: Min M Xu <min.m...@intel.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M OvmfPkg/Library/PlatformInitLib/IntelTdx.c
    M OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf

  Log Message:
  -----------
  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 <erdemak...@google.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: James Bottomley <j...@linux.ibm.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Cc: Tom Lendacky <thomas.lenda...@amd.com>
Signed-off-by: Min Xu <min.m...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>


Compare: https://github.com/tianocore/edk2/compare/b2d76fdd421b...451521ccbcaa


_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to