mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/PiSmmCpuDxeSmm: Fix IsSmmCommBufferForbiddenAddress check
SmiPFHandler depends on the IsSmmCommBufferForbiddenAddress() to do the forbidden address check: For SMM, verifying whether an address is forbidden is necessary only when RestrictedMemoryAccess is enabled. For MM, all accessible address is recorded in the ResourceDescriptor HOB, so no need check the RestrictedMemoryAccess is enabled or not. This patch is to move RestrictedMemoryAccess check into SMM IsSmmCommBufferForbiddenAddress to align with above behavior. With the change, SmiPFHandler doesn't need to check the RestrictedMemoryAccess enable or not. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
parent
c047353a12
commit
897284d47d
|
@ -546,6 +546,10 @@ IsSmmCommBufferForbiddenAddress (
|
|||
UINTN Index;
|
||||
EFI_MEMORY_DESCRIPTOR *Entry;
|
||||
|
||||
if (!IsRestrictedMemoryAccess ()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mUefiMemoryMap != NULL) {
|
||||
MemoryMap = mUefiMemoryMap;
|
||||
MemoryMapEntryCount = mUefiMemoryMapSize/mUefiDescriptorSize;
|
||||
|
|
|
@ -815,7 +815,7 @@ SmiPFHandler (
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
if (mCpuSmmRestrictedMemoryAccess && IsSmmCommBufferForbiddenAddress (PFAddress)) {
|
||||
if (IsSmmCommBufferForbiddenAddress (PFAddress)) {
|
||||
DEBUG ((DEBUG_ERROR, "Access SMM communication forbidden address (0x%lx)!\n", PFAddress));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue