ArmPkg: ArmMmuLib: Add ARM32 Memory Attribute Update Failure Logging

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 ARM32 SetMemoryAttributes.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
This commit is contained in:
Oliver Smith-Denny 2024-07-19 12:37:36 -07:00 committed by mergify[bot]
parent 37287bf9ad
commit 74833ca459
1 changed files with 15 additions and 0 deletions

View File

@ -377,6 +377,13 @@ SetMemoryAttributes (
BOOLEAN FlushTlbs;
if (BaseAddress > (UINT64)MAX_ADDRESS) {
DEBUG ((
DEBUG_ERROR,
"%a BaseAddress: 0x%llx is greater than MAX_ADDRESS: 0x%llx, fail to apply attributes!\n",
__func__,
BaseAddress,
(UINT64)MAX_ADDRESS
));
return EFI_UNSUPPORTED;
}
@ -437,6 +444,14 @@ SetMemoryAttributes (
}
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"%a failed to update attributes with status %r for BaseAddress 0x%llx of length 0x%llx\n",
__func__,
Status,
BaseAddress,
ChunkLength
));
break;
}