* [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled
@ 2017-04-25 6:54 Jeff Fan
2017-04-25 8:18 ` Tian, Feng
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Fan @ 2017-04-25 6:54 UTC (permalink / raw)
To: edk2-devel; +Cc: Feng Tian, Michael Kinney
After X2APIC mode is enabled, APs need to be set tp IDLE state, otherwise APs
cannot be waken up by MP PPI services.
https://bugzilla.tianocore.org/show_bug.cgi?id=505
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
---
UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 03d6c2d..e502e36 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -434,6 +434,8 @@ CollectProcessorCount (
IN CPU_MP_DATA *CpuMpData
)
{
+ UINTN Index;
+
//
// Send 1st broadcast IPI to APs to wakeup APs
//
@@ -465,6 +467,12 @@ CollectProcessorCount (
// Enable x2APIC on BSP
//
SetApicMode (LOCAL_APIC_MODE_X2APIC);
+ //
+ // Set BSP/Aps state to IDLE
+ //
+ for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
+ SetApState (&CpuMpData->CpuData[Index], CpuStateIdle);
+ }
}
DEBUG ((DEBUG_INFO, "APIC MODE is %d\n", GetApicMode ()));
//
--
2.9.3.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled
2017-04-25 6:54 [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled Jeff Fan
@ 2017-04-25 8:18 ` Tian, Feng
0 siblings, 0 replies; 2+ messages in thread
From: Tian, Feng @ 2017-04-25 8:18 UTC (permalink / raw)
To: Fan, Jeff, edk2-devel@lists.01.org; +Cc: Kinney, Michael D, Tian, Feng
Reviewed-by: Feng Tian <feng.tian@intel.com>
-----Original Message-----
From: Fan, Jeff
Sent: Tuesday, April 25, 2017 2:54 PM
To: edk2-devel@lists.01.org
Cc: Tian, Feng <feng.tian@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled
After X2APIC mode is enabled, APs need to be set tp IDLE state, otherwise APs cannot be waken up by MP PPI services.
https://bugzilla.tianocore.org/show_bug.cgi?id=505
Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
---
UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 03d6c2d..e502e36 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -434,6 +434,8 @@ CollectProcessorCount (
IN CPU_MP_DATA *CpuMpData
)
{
+ UINTN Index;
+
//
// Send 1st broadcast IPI to APs to wakeup APs
//
@@ -465,6 +467,12 @@ CollectProcessorCount (
// Enable x2APIC on BSP
//
SetApicMode (LOCAL_APIC_MODE_X2APIC);
+ //
+ // Set BSP/Aps state to IDLE
+ //
+ for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
+ SetApState (&CpuMpData->CpuData[Index], CpuStateIdle);
+ }
}
DEBUG ((DEBUG_INFO, "APIC MODE is %d\n", GetApicMode ()));
//
--
2.9.3.windows.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-25 8:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25 6:54 [PATCH v2] UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled Jeff Fan
2017-04-25 8:18 ` Tian, Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox