diff options
| author | Peter Jones <pjones@redhat.com> | 2023-09-05 16:25:05 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2023-12-05 13:20:00 -0500 |
| commit | 6f0c8d2c920c82359f231205b26eb4ddd3718e1d (patch) | |
| tree | 417cae150af8f70c3856011a582ffc0cd6a1e271 | |
| parent | 0226b56513b2b8bd5fd281bce77c40c9bf07c66d (diff) | |
| download | efi-boot-shim-6f0c8d2c920c82359f231205b26eb4ddd3718e1d.tar.gz efi-boot-shim-6f0c8d2c920c82359f231205b26eb4ddd3718e1d.zip | |
Print errors when setting/clearing memory attrs
When working on issues with the memory attributes API, shim does not
currently display any errors which are returned from the API itself.
This adds those error messages.
Resolves #575
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | pe.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -498,10 +498,20 @@ update_mem_attrs(uintptr_t addr, uint64_t size, uefi_clear_attrs = shim_mem_attrs_to_uefi_mem_attrs (clear_attrs); dprint("translating clear_attrs from 0x%lx to 0x%lx\n", clear_attrs, uefi_clear_attrs); efi_status = EFI_SUCCESS; - if (uefi_set_attrs) + if (uefi_set_attrs) { efi_status = proto->SetMemoryAttributes(proto, physaddr, size, uefi_set_attrs); - if (!EFI_ERROR(efi_status) && uefi_clear_attrs) + if (EFI_ERROR(efi_status)) { + dprint(L"Failed to set memory attrs:0x%0x physaddr:0x%llx size:0x%0lx status:%r\n", + uefi_set_attrs, physaddr, size, efi_status); + } + } + if (!EFI_ERROR(efi_status) && uefi_clear_attrs) { efi_status = proto->ClearMemoryAttributes(proto, physaddr, size, uefi_clear_attrs); + if (EFI_ERROR(efi_status)) { + dprint(L"Failed to clear memory attrs:0x%0x physaddr:0x%llx size:0x%0lx status:%r\n", + uefi_clear_attrs, physaddr, size, efi_status); + } + } ret = efi_status; efi_status = get_mem_attrs (addr, size, &after); |
