Skip to content

Commit

Permalink
Don't Set Access Attributes of Runtime MMIO Ranges (#51)
Browse files Browse the repository at this point in the history
## Description

Passing in access attributes to SetMemorySpaceAttributes() will cause
the existing attributes to be overwritten. The MMIO region should have
the appropriate attributes applied during memory protection
initialization and the attributes of the memory space descriptor are
inaccurate. Don't pass in any CPU arch attributes so SetMemorySpaceAttributes()
doesn't subsequently call gCpu->SetMemoryAttributes().

## Breaking change?

No

## How This Was Tested

- Booting to the OS and running the paging audit app on Q35

## Integration Instructions

N/A
  • Loading branch information
TaylorBeebe authored and kenlautner committed Dec 19, 2023
1 parent 460dfc1 commit d3d29f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PrmPkg/PrmConfigDxe/PrmConfigDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ SetRuntimeMemoryRangeAttributes (
Status = gDS->SetMemorySpaceAttributes (
RuntimeMmioRanges->Range[Index].PhysicalBaseAddress,
(UINT64)RuntimeMmioRanges->Range[Index].Length,
Descriptor.Attributes | EFI_MEMORY_RUNTIME
// MU_CHANGE START: The memory space descriptor access attributes are not accurate. Don't pass
// in access attributes so SetMemorySpaceAttributes() doesn't update them.
// Descriptor.Attributes | EFI_MEMORY_RUNTIME
EFI_MEMORY_RUNTIME
// MU_CHANGE END
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
Expand Down

0 comments on commit d3d29f2

Please sign in to comment.