2 Define the FIRST_SMI_HANDLER_CONTEXT structure, which is an exchange area
3 between the SMM Monarch and the hot-added CPU, for relocating the SMBASE of
6 Copyright (c) 2020, Red Hat, Inc.
8 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef FIRST_SMI_HANDLER_CONTEXT_H_
12 #define FIRST_SMI_HANDLER_CONTEXT_H_
15 // The following structure is used to communicate between the SMM Monarch
16 // (running the root MMI handler) and the hot-added CPU (handling its first
17 // SMI). It is placed at SMM_DEFAULT_SMBASE, which is in SMRAM under QEMU's
18 // "SMRAM at default SMBASE" feature.
23 // When ApicIdGate is MAX_UINT64, then no hot-added CPU may proceed with
26 // Otherwise, the hot-added CPU whose APIC ID equals ApicIdGate may proceed
27 // with SMBASE relocation.
29 // This field is intentionally wider than APIC_ID (UINT32) because we need a
30 // "gate locked" value that is different from all possible APIC_IDs.
34 // The new SMBASE value for the hot-added CPU to set in the SMRAM Save State
35 // Map, before leaving SMM with the RSM instruction.
39 // The hot-added CPU sets this field to 1 right before executing the RSM
40 // instruction. This tells the SMM Monarch to proceed to polling the last
41 // byte of the normal RAM reserved page (Post-SMM Pen).
43 UINT8 AboutToLeaveSmm
;
44 } FIRST_SMI_HANDLER_CONTEXT
;
47 #endif // FIRST_SMI_HANDLER_CONTEXT_H_