From 06141ff541bb708833d67e202aa4b19b9cab1d94 Mon Sep 17 00:00:00 2001 From: Chris Fernald Date: Wed, 7 Feb 2024 03:41:46 -0800 Subject: [PATCH] Switch MmCoreArm advanced logger to use updated MMU functions --- .../MmCoreArm/AdvancedLoggerLib.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c index 97cd71f2ee..f46574806d 100644 --- a/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c +++ b/AdvLoggerPkg/Library/AdvancedLoggerLib/MmCoreArm/AdvancedLoggerLib.c @@ -114,12 +114,20 @@ 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 = ArmSetMemoryAttributes ( + Address, + EFI_PAGE_SIZE, + EFI_MEMORY_XP, + EFI_MEMORY_ACCESS_MASK + ); 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 = ArmSetMemoryAttributes ( + Address, + EFI_PAGE_SIZE, + EFI_MEMORY_XP, + EFI_MEMORY_ACCESS_MASK + ); mInitialized = TRUE; // Only allow initialization once mLoggerInfo = (ADVANCED_LOGGER_INFO *)(VOID *)FixedPcdGet64 (PcdAdvancedLoggerBase);