From e10de1cb0345e54c0b4d83f5979a76111d10d6c7 Mon Sep 17 00:00:00 2001 From: Oliver Smith-Denny Date: Fri, 19 Jul 2024 12:40:18 -0700 Subject: [PATCH] ArmPkg: ArmMmuLib: Add AARCH64 Memory Attribute Update Failure Log This adds logging in failure cases of SetMemoryAttributes. This is useful generally as if an attribute update fails, code will typically break, but is added in particular to make debugging incorrect bootloader usage of the Memory Attribute Protocol. This patch updates the AARCH64 UpdateRegionMapping. Signed-off-by: Oliver Smith-Denny --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c index 6a1f3f9477..b83373d4b5 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c @@ -382,6 +382,13 @@ UpdateRegionMapping ( UINTN T0SZ; if (((RegionStart | RegionLength) & EFI_PAGE_MASK) != 0) { + DEBUG (( + DEBUG_ERROR, + "%a RegionStart: 0x%llx or RegionLength: 0x%llx are not page aligned!\n", + __func__, + RegionStart, + RegionLength + )); return EFI_INVALID_PARAMETER; }