@@ -522,14 +522,14 @@ BSPHandler (
522
522
//
523
523
// Wait for all APs of arrival at this point
524
524
//
525
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
525
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #1: Wait APs
526
526
527
527
//
528
528
// Signal all APs it's time for:
529
529
// 1. Backup MTRRs if needed.
530
530
// 2. Perform SMM CPU Platform Hook before executing MMI Handler.
531
531
//
532
- ReleaseAllAPs ();
532
+ ReleaseAllAPs (); /// #2: Signal APs
533
533
534
534
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
535
535
//
@@ -545,12 +545,12 @@ BSPHandler (
545
545
//
546
546
// Wait for all APs to complete their MTRR saving
547
547
//
548
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
548
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #3: Wait APs
549
549
550
550
//
551
551
// Let all processors program SMM MTRRs together
552
552
//
553
- ReleaseAllAPs ();
553
+ ReleaseAllAPs (); /// #4: Signal APs
554
554
555
555
//
556
556
// SmmCpuSyncWaitForAPs() may wait for ever if an AP happens to enter SMM at
@@ -562,7 +562,7 @@ BSPHandler (
562
562
//
563
563
// Wait for all APs to complete their MTRR programming
564
564
//
565
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
565
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #5: Wait APs
566
566
}
567
567
}
568
568
@@ -632,18 +632,18 @@ BSPHandler (
632
632
// Notify all APs to exit
633
633
//
634
634
* mSmmMpSyncData -> InsideSmm = FALSE;
635
- ReleaseAllAPs ();
635
+ ReleaseAllAPs (); /// #6: Signal APs
636
636
637
637
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
638
638
//
639
639
// Wait for all APs the readiness to program MTRRs
640
640
//
641
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
641
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #7: Wait APs
642
642
643
643
//
644
644
// Signal APs to restore MTRRs
645
645
//
646
- ReleaseAllAPs ();
646
+ ReleaseAllAPs (); /// #8: Signal APs
647
647
648
648
//
649
649
// Restore OS MTRRs
@@ -656,12 +656,12 @@ BSPHandler (
656
656
//
657
657
// Wait for all APs to complete their pending tasks including MTRR programming if needed.
658
658
//
659
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
659
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #9: Wait APs
660
660
661
661
//
662
662
// Signal APs to Reset states/semaphore for this processor
663
663
//
664
- ReleaseAllAPs ();
664
+ ReleaseAllAPs (); /// #10: Signal APs
665
665
}
666
666
667
667
if (mSmmDebugAgentSupport ) {
@@ -686,7 +686,7 @@ BSPHandler (
686
686
// Gather APs to exit SMM synchronously. Note the Present flag is cleared by now but
687
687
// WaitForAllAps does not depend on the Present flag.
688
688
//
689
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
689
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #11: Wait APs
690
690
691
691
//
692
692
// At this point, all APs should have exited from APHandler().
@@ -812,14 +812,14 @@ APHandler (
812
812
//
813
813
// Notify BSP of arrival at this point
814
814
//
815
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
815
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #1: Signal BSP
816
816
817
817
//
818
818
// Wait for the signal from BSP to:
819
819
// 1. Backup MTRRs if needed.
820
820
// 2. Perform SMM CPU Platform Hook before executing MMI Handler.
821
821
//
822
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
822
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #2: Wait BSP
823
823
}
824
824
825
825
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
@@ -831,12 +831,12 @@ APHandler (
831
831
//
832
832
// Signal BSP the completion of this AP
833
833
//
834
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
834
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #3: Signal BSP
835
835
836
836
//
837
837
// Wait for BSP's signal to program MTRRs
838
838
//
839
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
839
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #4: Wait BSP
840
840
841
841
//
842
842
// Replace OS MTRRs with SMI MTRRs
@@ -846,7 +846,7 @@ APHandler (
846
846
//
847
847
// Signal BSP the completion of this AP
848
848
//
849
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
849
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #5: Signal BSP
850
850
}
851
851
852
852
//
@@ -858,7 +858,7 @@ APHandler (
858
858
//
859
859
// Wait for something to happen
860
860
//
861
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
861
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #6: Wait BSP
862
862
863
863
//
864
864
// Check if BSP wants to exit SMM
@@ -898,12 +898,12 @@ APHandler (
898
898
//
899
899
// Notify BSP the readiness of this AP to program MTRRs
900
900
//
901
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
901
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #7: Signal BSP
902
902
903
903
//
904
904
// Wait for the signal from BSP to program MTRRs
905
905
//
906
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
906
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #8: Wait BSP
907
907
908
908
//
909
909
// Restore OS MTRRs
@@ -916,12 +916,12 @@ APHandler (
916
916
//
917
917
// Notify BSP the readiness of this AP to Reset states/semaphore for this processor
918
918
//
919
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
919
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #9: Signal BSP
920
920
921
921
//
922
922
// Wait for the signal from BSP to Reset states/semaphore for this processor
923
923
//
924
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
924
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #10: Wait BSP
925
925
}
926
926
927
927
//
@@ -932,7 +932,7 @@ APHandler (
932
932
//
933
933
// Notify BSP the readiness of this AP to exit SMM
934
934
//
935
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
935
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #11: Signal BSP
936
936
}
937
937
938
938
/**
0 commit comments