From: Jeff Fan Date: Tue, 25 Apr 2017 03:22:00 +0000 (+0800) Subject: UefiCpuPkg/MpLib.c: Set AP state after X2APIC mode enabled X-Git-Tag: edk2-stable201903~4113 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=59a119f0fcaed5a7cab4829bb19dd7ffa94e16a0;p=mirror_edk2.git 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 Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian --- diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index e5e211de8d..407c44c95e 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 ())); //