diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c index 97cd71f2ee..0cf4ad5217 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include "../AdvancedLoggerCommon.h" @@ -114,12 +114,16 @@ AdvancedLoggerGetLoggerInfo ( // If this is the first time for MM core to get here, the memory attributes of this module // may not be fully set yet. Thus set the memory for global variables attributes to RW first. Address = ALIGN_VALUE ((EFI_PHYSICAL_ADDRESS)(UINTN)&mInitialized - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE); - Status = ArmSetMemoryRegionNoExec (Address, EFI_PAGE_SIZE); - Status = ArmClearMemoryRegionReadOnly (Address, EFI_PAGE_SIZE); + Status = MmuSetAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); + Status = MmuClearAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_RO); + ASSERT_EFI_ERROR (Status); Address = ALIGN_VALUE ((EFI_PHYSICAL_ADDRESS)(UINTN)&mLoggerInfo - EFI_PAGE_SIZE + 1, EFI_PAGE_SIZE); - Status = ArmSetMemoryRegionNoExec (Address, EFI_PAGE_SIZE); - Status = ArmClearMemoryRegionReadOnly (Address, EFI_PAGE_SIZE); + Status = MmuSetAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_XP); + ASSERT_EFI_ERROR (Status); + Status = MmuClearAttributes (Address, EFI_PAGE_SIZE, EFI_MEMORY_RO); + ASSERT_EFI_ERROR (Status); mInitialized = TRUE; // Only allow initialization once mLoggerInfo = (ADVANCED_LOGGER_INFO *)(VOID *)FixedPcdGet64 (PcdAdvancedLoggerBase); diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf index b4f06d49d3..7bf5cdb9dd 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.inf @@ -36,7 +36,7 @@ BaseMemoryLib DebugLib SynchronizationLib - ArmMmuLib + MmuLib [Guids] gAdvancedLoggerHobGuid