]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/DxeMpLib: Place APs to suitable state on Legacy OS boot
authorJeff Fan <jeff.fan@intel.com>
Fri, 11 Nov 2016 11:51:36 +0000 (19:51 +0800)
committerJeff Fan <jeff.fan@intel.com>
Mon, 14 Nov 2016 01:56:59 +0000 (09:56 +0800)
Currently, DxeMpLib only places APs into specified c-state in Exit Boot Service
callback function for UEFI OS boot. We need to put APs into specified c-state
for legacy OS boot also.

https://bugzilla.tianocore.org/show_bug.cgi?id=210

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c

index 03a899451643c4ca8d05d126dcf792d3edd3c7cd..972c9ad7edba20b165f2a6d7ddf4853accc82636 100644 (file)
@@ -58,6 +58,7 @@
 \r
 [Guids]\r
   gEfiEventExitBootServicesGuid                 ## CONSUMES  ## Event\r
+  gEfiEventLegacyBootGuid                       ## CONSUMES  ## Event\r
 \r
 [Pcd]\r
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber        ## CONSUMES\r
index 8be0bb885b40ff47f403fc814410c7bb199dd158..7f3900b4c10d8fb577da5714cddf43e6bae5601e 100644 (file)
@@ -22,6 +22,7 @@
 CPU_MP_DATA      *mCpuMpData = NULL;\r
 EFI_EVENT        mCheckAllApsEvent = NULL;\r
 EFI_EVENT        mMpInitExitBootServicesEvent = NULL;\r
+EFI_EVENT        mLegacyBootEvent = NULL;\r
 volatile BOOLEAN mStopCheckAllApsStatus = TRUE;\r
 VOID             *mReservedApLoopFunc = NULL;\r
 \r
@@ -340,6 +341,7 @@ InitMpGlobalData (
                   AP_CHECK_INTERVAL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
+\r
   Status = gBS->CreateEvent (\r
                   EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
                   TPL_CALLBACK,\r
@@ -348,6 +350,16 @@ InitMpGlobalData (
                   &mMpInitExitBootServicesEvent\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
+\r
+  Status = gBS->CreateEventEx (\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  TPL_CALLBACK,\r
+                  MpInitChangeApLoopCallback,\r
+                  NULL,\r
+                  &gEfiEventLegacyBootGuid,\r
+                  &mLegacyBootEvent\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
 /**\r