]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/PiSmmCpu: Don't allocate Token for SmmStartupThisAp
authorRay Ni <ray.ni@intel.com>
Wed, 27 Jan 2021 07:45:25 +0000 (15:45 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 11 Mar 2021 01:44:51 +0000 (01:44 +0000)
commit54ba08c6b66090bdc03186110149bfe4b0f75208
tree87c710ef63d4c99e583a48c8efe18b6952f4c8f3
parentedd46cd407ea4a0adaa8d6ca86f550c2a4d5c507
UefiCpuPkg/PiSmmCpu: Don't allocate Token for SmmStartupThisAp

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3199

When Token points to mSmmStartupThisApToken, this routine is called
from SmmStartupThisAp() in non-blocking mode due to
PcdCpuSmmBlockStartupThisAp == FALSE.

In this case, caller wants to startup AP procedure in non-blocking
mode and cannot get the completion status from the Token because there
is no way to return the Token to caller from SmmStartupThisAp().
Caller needs to use its specific way to query the completion status.

There is no need to allocate a token for such case so the 3 overheads
can be avoided:
1. Call AllocateTokenBuffer() when there is no free token.
2. Get a free token from the token buffer.
3. Call ReleaseToken() in APHandler().

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c