1 | /** @file
|
---|
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.
|
---|
5 |
|
---|
6 | CPU_HOT_EJECT_DATA is allocated in SMRAM, and pointed-to by
|
---|
7 | PcdCpuHotEjectDataAddress.
|
---|
8 |
|
---|
9 | PcdCpuHotEjectDataAddress is valid when SMM_REQUIRE is TRUE
|
---|
10 | and PcdCpuMaxLogicalProcessorNumber > 1.
|
---|
11 |
|
---|
12 | Copyright (C) 2021, Oracle Corporation.
|
---|
13 |
|
---|
14 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
15 | **/
|
---|
16 |
|
---|
17 | #ifndef CPU_HOT_EJECT_DATA_H_
|
---|
18 | #define CPU_HOT_EJECT_DATA_H_
|
---|
19 |
|
---|
20 | /**
|
---|
21 | CPU Hot-eject handler, called from SmmCpuFeaturesRendezvousExit()
|
---|
22 | on each CPU at exit from SMM.
|
---|
23 |
|
---|
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.
|
---|
29 | **/
|
---|
30 | typedef
|
---|
31 | VOID
|
---|
32 | (EFIAPI *CPU_HOT_EJECT_HANDLER)(
|
---|
33 | IN UINTN ProcessorNum
|
---|
34 | );
|
---|
35 |
|
---|
36 | //
|
---|
37 | // CPU_EJECT_QEMU_SELECTOR_INVALID marks CPUs not being ejected in
|
---|
38 | // CPU_HOT_EJECT_DATA->QemuSelectorMap.
|
---|
39 | //
|
---|
40 | // QEMU CPU Selector is UINT32, so we choose an invalid value larger
|
---|
41 | // than that type.
|
---|
42 | //
|
---|
43 | #define CPU_EJECT_QEMU_SELECTOR_INVALID (MAX_UINT64)
|
---|
44 |
|
---|
45 | typedef struct {
|
---|
46 | //
|
---|
47 | // Maps ProcessorNum -> QemuSelector for pending hot-ejects
|
---|
48 | //
|
---|
49 | volatile UINT64 *QemuSelectorMap;
|
---|
50 | //
|
---|
51 | // Handler to do the CPU ejection
|
---|
52 | //
|
---|
53 | volatile CPU_HOT_EJECT_HANDLER Handler;
|
---|
54 | //
|
---|
55 | // Entries in the QemuSelectorMap
|
---|
56 | //
|
---|
57 | UINT32 ArrayLength;
|
---|
58 | } CPU_HOT_EJECT_DATA;
|
---|
59 |
|
---|
60 | #endif // CPU_HOT_EJECT_DATA_H_
|
---|