25#define ICH9_LPC_SMI_F_BROADCAST BIT0
31#define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1
37#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2
55STATIC FIRMWARE_CONFIG_ITEM mRequestedFeaturesItem;
56STATIC FIRMWARE_CONFIG_ITEM mFeaturesOkItem;
80 FIRMWARE_CONFIG_ITEM SupportedFeaturesItem;
81 UINTN SupportedFeaturesSize;
82 UINTN RequestedFeaturesSize;
84 UINT64 RequestedFeaturesMask;
94 "etc/smi/supported-features",
95 &SupportedFeaturesItem,
96 &SupportedFeaturesSize
101 "etc/smi/requested-features",
102 &mRequestedFeaturesItem,
103 &RequestedFeaturesSize
108 "etc/smi/features-ok",
116 "%a: SMI feature negotiation unavailable\n",
126 if ((SupportedFeaturesSize !=
sizeof mSmiFeatures) ||
127 (RequestedFeaturesSize !=
sizeof mSmiFeatures) ||
128 (FeaturesOkSize !=
sizeof (UINT8)))
132 "%a: size mismatch in feature negotiation\n",
148 RequestedFeaturesMask = ICH9_LPC_SMI_F_BROADCAST;
153 RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOTPLUG;
154 RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOT_UNPLUG;
157 mSmiFeatures &= RequestedFeaturesMask;
171 "%a: negotiation failed for feature bitmap 0x%Lx\n",
178 if ((mSmiFeatures & ICH9_LPC_SMI_F_BROADCAST) == 0) {
183 DEBUG ((DEBUG_INFO,
"%a: SMI broadcast unavailable\n", __func__));
196 "%a: PiSmmCpuDxeSmm PCD configuration failed\n",
202 DEBUG ((DEBUG_INFO,
"%a: using SMI broadcast\n", __func__));
205 if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) == 0) {
206 DEBUG ((DEBUG_INFO,
"%a: CPU hotplug not negotiated\n", __func__));
210 "%a: CPU hotplug with SMI negotiated\n",
215 if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) == 0) {
216 DEBUG ((DEBUG_INFO,
"%a: CPU hot-unplug not negotiated\n", __func__));
220 "%a: CPU hot-unplug with SMI negotiated\n",
247 IN OUT VOID *Context OPTIONAL,
248 IN OUT VOID *ExternalScratchBuffer
252 RETURN_STATUS Status;
254 ScratchBuffer = ExternalScratchBuffer;
259 ScratchBuffer->Features = mSmiFeatures;
261 mRequestedFeaturesItem,
262 sizeof ScratchBuffer->Features
274 sizeof ScratchBuffer->FeaturesOk
285 &ScratchBuffer->FeaturesOk,
286 sizeof ScratchBuffer->FeaturesOk,
296 "%a: SMI feature negotiation boot script saved\n",
315 RETURN_STATUS Status;
VOID EFIAPI CpuDeadLoop(VOID)
#define RETURN_ERROR(StatusCode)
#define DEBUG(Expression)
BOOLEAN EFIAPI MemEncryptSevIsEnabled(VOID)
#define PcdSet64S(TokenName, Value)
#define PcdSet8S(TokenName, Value)
VOID EFIAPI QemuFwCfgWriteBytes(IN UINTN Size, IN VOID *Buffer)
UINT8 EFIAPI QemuFwCfgRead8(VOID)
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
RETURN_STATUS EFIAPI QemuFwCfgS3ScriptReadBytes(IN INT32 FirmwareConfigItem, IN UINTN NumberOfBytes)
RETURN_STATUS EFIAPI QemuFwCfgS3ScriptWriteBytes(IN INT32 FirmwareConfigItem, IN UINTN NumberOfBytes)
RETURN_STATUS EFIAPI QemuFwCfgS3CallWhenBootScriptReady(IN FW_CFG_BOOT_SCRIPT_CALLBACK_FUNCTION *Callback, IN OUT VOID *Context OPTIONAL, IN UINTN ScratchBufferSize)
RETURN_STATUS EFIAPI QemuFwCfgS3ScriptCheckValue(IN VOID *ScratchData, IN UINT8 ValueSize, IN UINT64 ValueMask, IN UINT64 Value)
BOOLEAN NegotiateSmiFeatures(VOID)
STATIC VOID EFIAPI AppendFwCfgBootScript(IN OUT VOID *Context OPTIONAL, IN OUT VOID *ExternalScratchBuffer)
VOID SaveSmiFeatures(VOID)