UefiCpuPkg/PiSmmCpuDxeSmm: Modify PcdCpuSmmRestrictedMemoryAccess retrieval
Currently if PcdCpuSmmRestrictedMemoryAccess is a DynamicPcd it will be accessed during SMM entry causing an error since code outside of SMM will be called (PcdGetBool). To fix that PcdCpuSmmRestrictedMemoryAccess is retrieved during SMM initialization and cached value is used at runtime Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
0d472346df
commit
8b2c56e638
@@ -389,5 +389,10 @@ PiCpuSmmEntry (
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Initialize value of mIsRestrictedMemoryAccess
|
||||
//
|
||||
IsRestrictedMemoryAccess ();
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
#include "PiSmmCpuCommon.h"
|
||||
|
||||
BOOLEAN mIsRestrictedMemoryAccess = TRUE;
|
||||
BOOLEAN mIsRestrictedMemoryAccessInitialized = FALSE;
|
||||
|
||||
/**
|
||||
Return whether access to non-SMRAM is restricted.
|
||||
|
||||
@@ -18,5 +21,10 @@ IsRestrictedMemoryAccess (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
return PcdGetBool (PcdCpuSmmRestrictedMemoryAccess);
|
||||
if (!mIsRestrictedMemoryAccessInitialized) {
|
||||
mIsRestrictedMemoryAccess = PcdGetBool (PcdCpuSmmRestrictedMemoryAccess);
|
||||
mIsRestrictedMemoryAccessInitialized = TRUE;
|
||||
}
|
||||
|
||||
return mIsRestrictedMemoryAccess;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user