Skip to content

Commit

Permalink
Revert "UefiCpuPkg/PiSmmCpuDxeSmm: Consume PcdCpuSmmApSyncTimeout2"
Browse files Browse the repository at this point in the history
This reverts commit cb31346.
Intel server platform sync this commit will hit conflict since our code base is old.
We don't want to cherry-pick the dependent patches to avoid potential issue.
We need to revert this commit first and then fix the conflict and reapply the change.
Sorry for the incovenience.

Signed-off-by: Yanbo Huang <[email protected]>
  • Loading branch information
shuishouqiaozhi authored and mergify[bot] committed Jul 5, 2024
1 parent a3359ff commit 4efcd65
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
10 changes: 5 additions & 5 deletions UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @file
SMM MP service implementation
Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
Expand Down Expand Up @@ -268,7 +268,7 @@ SmmWaitForApArrival (
// Sync with APs 1st timeout
//
for (Timer = StartSyncTimer ();
!IsSyncTimerTimeout (Timer, mTimeoutTicker) && !(LmceEn && LmceSignal);
!IsSyncTimerTimeout (Timer) && !(LmceEn && LmceSignal);
)
{
mSmmMpSyncData->AllApArrivedWithException = AllCpusInSmmExceptBlockedDisabled ();
Expand Down Expand Up @@ -309,7 +309,7 @@ SmmWaitForApArrival (
// Sync with APs 2nd timeout.
//
for (Timer = StartSyncTimer ();
!IsSyncTimerTimeout (Timer, mTimeoutTicker2);
!IsSyncTimerTimeout (Timer);
)
{
mSmmMpSyncData->AllApArrivedWithException = AllCpusInSmmExceptBlockedDisabled ();
Expand Down Expand Up @@ -736,7 +736,7 @@ APHandler (
// Timeout BSP
//
for (Timer = StartSyncTimer ();
!IsSyncTimerTimeout (Timer, mTimeoutTicker) &&
!IsSyncTimerTimeout (Timer) &&
!(*mSmmMpSyncData->InsideSmm);
)
{
Expand Down Expand Up @@ -764,7 +764,7 @@ APHandler (
// Now clock BSP for the 2nd time
//
for (Timer = StartSyncTimer ();
!IsSyncTimerTimeout (Timer, mTimeoutTicker2) &&
!IsSyncTimerTimeout (Timer) &&
!(*mSmmMpSyncData->InsideSmm);
)
{
Expand Down
11 changes: 3 additions & 8 deletions UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,6 @@ extern BOOLEAN mSmmDebugAgentSupport;
//
extern UINT64 mAddressEncMask;

extern UINT64 mTimeoutTicker;
extern UINT64 mTimeoutTicker2;

/**
Create 4G PageTable in SMRAM.
Expand Down Expand Up @@ -536,17 +533,15 @@ StartSyncTimer (
);

/**
Check if the SMM AP Sync Timer is timeout specified by Timeout.
Check if the SMM AP Sync timer is timeout.
@param Timer The start timer from the begin.
@param Timeout The timeout ticker to wait.
@param Timer The start timer from the begin.
**/
BOOLEAN
EFIAPI
IsSyncTimerTimeout (
IN UINT64 Timer,
IN UINT64 Timeout
IN UINT64 Timer
);

/**
Expand Down
1 change: 0 additions & 1 deletion UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmProfileSize ## SOMETIMES_CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout2 ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugDataAddress ## SOMETIMES_PRODUCES
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmCodeAccessCheckEnable ## CONSUMES
gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode ## CONSUMES
Expand Down
19 changes: 5 additions & 14 deletions UefiCpuPkg/PiSmmCpuDxeSmm/SyncTimer.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
/** @file
SMM Timer feature support
Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "PiSmmCpuDxeSmm.h"

UINT64 mTimeoutTicker = 0;

UINT64 mTimeoutTicker2 = 0;

//
// Number of counts in a roll-over cycle of the performance counter.
//
Expand Down Expand Up @@ -39,10 +36,6 @@ InitializeSmmTimer (
MultU64x64 (TimerFrequency, PcdGet64 (PcdCpuSmmApSyncTimeout)),
1000 * 1000
);
mTimeoutTicker2 = DivU64x32 (
MultU64x64 (TimerFrequency, PcdGet64 (PcdCpuSmmApSyncTimeout2)),
1000 * 1000
);
if (End < Start) {
mCountDown = TRUE;
mCycle = Start - End;
Expand All @@ -66,17 +59,15 @@ StartSyncTimer (
}

/**
Check if the SMM AP Sync Timer is timeout specified by Timeout.
Check if the SMM AP Sync timer is timeout.
@param Timer The start timer from the begin.
@param Timeout The timeout ticker to wait.
@param Timer The start timer from the begin.
**/
BOOLEAN
EFIAPI
IsSyncTimerTimeout (
IN UINT64 Timer,
IN UINT64 Timeout
IN UINT64 Timer
)
{
UINT64 CurrentTimer;
Expand Down Expand Up @@ -114,5 +105,5 @@ IsSyncTimerTimeout (
}
}

return (BOOLEAN)(Delta >= Timeout);
return (BOOLEAN)(Delta >= mTimeoutTicker);
}

0 comments on commit 4efcd65

Please sign in to comment.