2 Definition for the CPU_HOT_EJECT_DATA structure, which shares
3 CPU hot-eject state between OVMF's SmmCpuFeaturesLib instance in
4 PiSmmCpuDxeSmm, and CpuHotplugSmm.
6 CPU_HOT_EJECT_DATA is allocated in SMRAM, and pointed-to by
7 PcdCpuHotEjectDataAddress.
9 PcdCpuHotEjectDataAddress is valid when SMM_REQUIRE is TRUE
10 and PcdCpuMaxLogicalProcessorNumber > 1.
12 Copyright (C) 2021, Oracle Corporation.
14 SPDX-License-Identifier: BSD-2-Clause-Patent
17 #ifndef CPU_HOT_EJECT_DATA_H_
18 #define CPU_HOT_EJECT_DATA_H_
21 CPU Hot-eject handler, called from SmmCpuFeaturesRendezvousExit()
22 on each CPU at exit from SMM.
24 @param[in] ProcessorNum ProcessorNum denotes the CPU exiting SMM,
25 and will be used as an index into
26 CPU_HOT_EJECT_DATA->QemuSelectorMap. It is
27 identical to the processor handle in
28 EFI_SMM_CPU_SERVICE_PROTOCOL.
32 (EFIAPI
*CPU_HOT_EJECT_HANDLER
) (
37 // CPU_EJECT_QEMU_SELECTOR_INVALID marks CPUs not being ejected in
38 // CPU_HOT_EJECT_DATA->QemuSelectorMap.
40 // QEMU CPU Selector is UINT32, so we choose an invalid value larger
43 #define CPU_EJECT_QEMU_SELECTOR_INVALID (MAX_UINT64)
47 // Maps ProcessorNum -> QemuSelector for pending hot-ejects
49 volatile UINT64
*QemuSelectorMap
;
51 // Handler to do the CPU ejection
53 volatile CPU_HOT_EJECT_HANDLER Handler
;
55 // Entries in the QemuSelectorMap
60 #endif // CPU_HOT_EJECT_DATA_H_