/* EjectCpu needs to know the BSP at SMI exit at a point when some of the EFI_SMM_CPU_SERVICE_PROTOCOL state has been torn down. Reuse the logic from OvmfPkg::PlatformSmmBspElection() to do that. */
STATIC BOOLEAN CheckIfBsp(VOID)
/* EjectCpu needs to know the BSP at SMI exit at a point when some of the EFI_SMM_CPU_SERVICE_PROTOCOL state has been torn down. Reuse the logic from OvmfPkg::PlatformSmmBspElection() to do that. */
STATIC BOOLEAN CheckIfBsp(VOID)
{
  MSR_IA32_APIC_BASE_REGISTER  ApicBaseMsr;
  BOOLEAN                      IsBsp;
  ApicBaseMsr.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);
  IsBsp              = (BOOLEAN)(ApicBaseMsr.Bits.BSP == 1);
  return IsBsp;
}