summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f442002)
when gBS->ExitBootServices() is called, the APs should avoid to access
the unsafed buff datas which were allocated by boot services.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16397
6f19259b-4bc3-4df7-8a09-
765794883524
UINTN gPollInterval = 100; // 100 microseconds\r
\r
MP_SYSTEM_DATA mMpSystemData;\r
UINTN gPollInterval = 100; // 100 microseconds\r
\r
MP_SYSTEM_DATA mMpSystemData;\r
-EFI_HANDLE mMpServiceHandle = NULL;\r
+EFI_HANDLE mMpServiceHandle = NULL;\r
+EFI_EVENT mExitBootServicesEvent = (EFI_EVENT)NULL;\r
\r
VOID *mCommonStack = 0;\r
VOID *mTopOfApCommonStack = 0;\r
\r
VOID *mCommonStack = 0;\r
VOID *mTopOfApCommonStack = 0;\r
return EFI_SUCCESS;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
+/**\r
+ Callback function for ExitBootServices.\r
+\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context The pointer to the notification function's context,\r
+ which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+ExitBootServicesCallback (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ //\r
+ // Avoid APs access invalid buff datas which allocated by BootServices,\r
+ // so we send INIT IPI to APs to let them wait for SIPI state.\r
+ //\r
+ SendInitIpiAllExcludingSelf ();\r
+}\r
+\r
/**\r
Initialize Multi-processor support.\r
\r
/**\r
Initialize Multi-processor support.\r
\r
(gMaxLogicalProcessorNumber - mMpSystemData.NumberOfProcessors) *\r
gApStackSize));\r
}\r
(gMaxLogicalProcessorNumber - mMpSystemData.NumberOfProcessors) *\r
gApStackSize));\r
}\r
+\r
+ Status = gBS->CreateEvent (\r
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+ TPL_CALLBACK,\r
+ ExitBootServicesCallback,\r
+ NULL,\r
+ &mExitBootServicesEvent\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r