@@ -522,13 +522,13 @@ BSPHandler (
522
522
//
523
523
// Wait for all APs to get ready for programming MTRRs
524
524
//
525
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
525
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #1: Wait APs
526
526
527
527
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
528
528
//
529
529
// Signal all APs it's time for backup MTRRs
530
530
//
531
- ReleaseAllAPs ();
531
+ ReleaseAllAPs (); /// #2: Signal APs
532
532
533
533
//
534
534
// SmmCpuSyncWaitForAPs() may wait for ever if an AP happens to enter SMM at
@@ -543,12 +543,12 @@ BSPHandler (
543
543
//
544
544
// Wait for all APs to complete their MTRR saving
545
545
//
546
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
546
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #3: Wait APs
547
547
548
548
//
549
549
// Let all processors program SMM MTRRs together
550
550
//
551
- ReleaseAllAPs ();
551
+ ReleaseAllAPs (); /// #4: Signal APs
552
552
553
553
//
554
554
// SmmCpuSyncWaitForAPs() may wait for ever if an AP happens to enter SMM at
@@ -560,7 +560,7 @@ BSPHandler (
560
560
//
561
561
// Wait for all APs to complete their MTRR programming
562
562
//
563
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
563
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #5: Wait APs
564
564
}
565
565
}
566
566
@@ -625,18 +625,18 @@ BSPHandler (
625
625
// Notify all APs to exit
626
626
//
627
627
* mSmmMpSyncData -> InsideSmm = FALSE;
628
- ReleaseAllAPs ();
628
+ ReleaseAllAPs (); /// #6: Signal APs
629
629
630
630
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
631
631
//
632
632
// Wait for all APs the readiness to program MTRRs
633
633
//
634
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
634
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #7: Wait APs
635
635
636
636
//
637
637
// Signal APs to restore MTRRs
638
638
//
639
- ReleaseAllAPs ();
639
+ ReleaseAllAPs (); /// #8: Signal APs
640
640
641
641
//
642
642
// Restore OS MTRRs
@@ -649,12 +649,12 @@ BSPHandler (
649
649
//
650
650
// Wait for all APs to complete their pending tasks including MTRR programming if needed.
651
651
//
652
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
652
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #9: Wait APs
653
653
654
654
//
655
655
// Signal APs to Reset states/semaphore for this processor
656
656
//
657
- ReleaseAllAPs ();
657
+ ReleaseAllAPs (); /// #10: Signal APs
658
658
}
659
659
660
660
if (mSmmDebugAgentSupport ) {
@@ -679,7 +679,7 @@ BSPHandler (
679
679
// Gather APs to exit SMM synchronously. Note the Present flag is cleared by now but
680
680
// WaitForAllAps does not depend on the Present flag.
681
681
//
682
- SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex );
682
+ SmmCpuSyncWaitForAPs (mSmmMpSyncData -> SyncContext , ApCount , CpuIndex ); /// #11: Wait APs
683
683
684
684
//
685
685
// At this point, all APs should have exited from APHandler().
@@ -805,14 +805,14 @@ APHandler (
805
805
//
806
806
// Notify BSP of arrival at this point
807
807
//
808
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
808
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #1: Signal BSP
809
809
}
810
810
811
811
if (SmmCpuFeaturesNeedConfigureMtrrs ()) {
812
812
//
813
813
// Wait for the signal from BSP to backup MTRRs
814
814
//
815
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
815
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #2: Wait BSP
816
816
817
817
//
818
818
// Backup OS MTRRs
@@ -822,12 +822,12 @@ APHandler (
822
822
//
823
823
// Signal BSP the completion of this AP
824
824
//
825
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
825
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #3: Signal BSP
826
826
827
827
//
828
828
// Wait for BSP's signal to program MTRRs
829
829
//
830
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
830
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #4: Wait BSP
831
831
832
832
//
833
833
// Replace OS MTRRs with SMI MTRRs
@@ -837,14 +837,14 @@ APHandler (
837
837
//
838
838
// Signal BSP the completion of this AP
839
839
//
840
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
840
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #5: Signal BSP
841
841
}
842
842
843
843
while (TRUE) {
844
844
//
845
845
// Wait for something to happen
846
846
//
847
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
847
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #6: Wait BSP
848
848
849
849
//
850
850
// Check if BSP wants to exit SMM
@@ -884,12 +884,12 @@ APHandler (
884
884
//
885
885
// Notify BSP the readiness of this AP to program MTRRs
886
886
//
887
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
887
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #7: Signal BSP
888
888
889
889
//
890
890
// Wait for the signal from BSP to program MTRRs
891
891
//
892
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
892
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #8: Wait BSP
893
893
894
894
//
895
895
// Restore OS MTRRs
@@ -902,12 +902,12 @@ APHandler (
902
902
//
903
903
// Notify BSP the readiness of this AP to Reset states/semaphore for this processor
904
904
//
905
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
905
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #9: Signal BSP
906
906
907
907
//
908
908
// Wait for the signal from BSP to Reset states/semaphore for this processor
909
909
//
910
- SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
910
+ SmmCpuSyncWaitForBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #10: Wait BSP
911
911
}
912
912
913
913
//
@@ -918,7 +918,7 @@ APHandler (
918
918
//
919
919
// Notify BSP the readiness of this AP to exit SMM
920
920
//
921
- SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex );
921
+ SmmCpuSyncReleaseBsp (mSmmMpSyncData -> SyncContext , CpuIndex , BspIndex ); /// #11: Signal BSP
922
922
}
923
923
924
924
/**
0 commit comments