From: Bartosz Szczepanek <bsz@amazon.de>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: <nh-open-source@amazon.com>, Bartosz Szczepanek <bsz@amazon.de>,
<linux-efi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] efi: Improve logging around memmap init
Date: Wed, 23 Apr 2025 09:05:16 +0000 [thread overview]
Message-ID: <20250423090517.47049-1-bsz@amazon.de> (raw)
Be more informative if memremap fails, and print out physical address
together with size. This change intends to make investigations of such
early failures slightly easier.
Signed-off-by: Bartosz Szczepanek <bsz@amazon.de>
---
drivers/firmware/efi/memmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
index 34109fd86c55..f1c04d7cfd71 100644
--- a/drivers/firmware/efi/memmap.c
+++ b/drivers/firmware/efi/memmap.c
@@ -31,31 +31,32 @@
* Returns: zero on success, a negative error code on failure.
*/
int __init __efi_memmap_init(struct efi_memory_map_data *data)
{
struct efi_memory_map map;
phys_addr_t phys_map;
phys_map = data->phys_map;
if (data->flags & EFI_MEMMAP_LATE)
map.map = memremap(phys_map, data->size, MEMREMAP_WB);
else
map.map = early_memremap(phys_map, data->size);
if (!map.map) {
- pr_err("Could not map the memory map!\n");
+ pr_err("Could not map the memory map! phys_map=%pa, size=0x%lx\n",
+ &phys_map, data->size);
return -ENOMEM;
}
map.phys_map = data->phys_map;
map.nr_map = data->size / data->desc_size;
map.map_end = map.map + data->size;
map.desc_version = data->desc_version;
map.desc_size = data->desc_size;
map.flags = data->flags;
set_bit(EFI_MEMMAP, &efi.flags);
efi.memmap = map;
--
2.47.1
next reply other threads:[~2025-04-23 9:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-23 9:05 Bartosz Szczepanek [this message]
2025-05-09 9:07 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250423090517.47049-1-bsz@amazon.de \
--to=bsz@amazon.de \
--cc=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nh-open-source@amazon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®