Skip to content

Commit

Permalink
pe: Enhance debug report for update_mem_attrs
Browse files Browse the repository at this point in the history
When memory attributes cannot be updated due to misalignment with 4K or
when the size is 0, the debug printout lacks sufficient clarity to
indicate the issue. To enhance troubleshooting, it is crucial to
generate an error log that explicitly states the failure to execute the
expected action. This error log will be visible even when the debug
level log is not enabled, thereby significantly reducing debugging time.

Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
  • Loading branch information
jongwu committed Jul 31, 2023
1 parent dbbe3c8 commit 1f03e43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ update_mem_attrs(uintptr_t addr, uint64_t size,
&before, efi_status);

if (!IS_PAGE_ALIGNED(physaddr) || !IS_PAGE_ALIGNED(size) || size == 0) {
dprint(L"%a called on 0x%llx-0x%llx (size 0x%llx) +%a%a%a -%a%a%a\n",
perror(L"%a: Failed to update memory attrs on 0x%llx-0x%llx (size 0x%llx) +%a%a%a -%a%a%a as address or size does not align with 4K or size equals 0\n",
__func__, (unsigned long long)physaddr,
(unsigned long long)(physaddr + size - 1),
(unsigned long long)size,
Expand Down

0 comments on commit 1f03e43

Please sign in to comment.