[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/19] [not for merge] ieee1275 debugging info
From: |
Daniel Axtens |
Subject: |
[PATCH 18/19] [not for merge] ieee1275 debugging info |
Date: |
Tue, 12 Oct 2021 18:30:07 +1100 |
This is also handy for debugging.
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
grub-core/kern/ieee1275/init.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c
index 0fb7bae280df..f70cb134178b 100644
--- a/grub-core/kern/ieee1275/init.c
+++ b/grub-core/kern/ieee1275/init.c
@@ -243,6 +243,7 @@ regions_claim (grub_uint64_t addr, grub_uint64_t len,
grub_memory_type_t type,
*/
if (rmo_top > RUNTIME_MIN_SPACE)
{
+ grub_printf ("was %llx - %llx, ", addr, addr + len);
linux_rmo_save = grub_min (0x30000000, rmo_top) - RUNTIME_MIN_SPACE;
if ((addr < linux_rmo_save) && ((addr + len) > linux_rmo_save))
len = linux_rmo_save - addr;
@@ -253,6 +254,7 @@ regions_claim (grub_uint64_t addr, grub_uint64_t len,
grub_memory_type_t type,
addr = 0x30000000;
len -= RUNTIME_MIN_SPACE;
}
+ grub_printf ("now %llx - %llx (vs %x)\n", addr, addr + len,
linux_rmo_save);
}
if (flags & GRUB_MM_ADD_REGION_CONSECUTIVE)
@@ -315,7 +317,12 @@ static grub_err_t grub_ieee1275_mm_add_region (grub_size_t
size, unsigned int fl
/* Ensure we leave enough space to boot
(be careful of underflow here) */
if (free_memory <= RUNTIME_MIN_SPACE)
- return GRUB_ERR_OUT_OF_MEMORY;
+ {
+ grub_printf ("Giving up, already at/over limit\n");
+ return GRUB_ERR_OUT_OF_MEMORY;
+ }
+
+ grub_printf ("ieee1275: free = 0x%x, allocated = 0x%x\n", free_memory,
allocated_memory);
if (size > free_memory - RUNTIME_MIN_SPACE)
return GRUB_ERR_OUT_OF_MEMORY;
@@ -324,8 +331,10 @@ static grub_err_t grub_ieee1275_mm_add_region (grub_size_t
size, unsigned int fl
total = grub_max(ALIGN_UP(size, 1024 * 1024) + 1024 * 1024, 32 * 1024
* 1024);
total = grub_min(free_memory - RUNTIME_MIN_SPACE, total);
}
+ grub_printf ("ieee1275: looking for %x bytes of memory (%x
requested)\n", total, size);
grub_machine_mmap_iterate (region_claim, &total);
+ grub_printf ("ieee1275: get memory from fw %s\n", total == 0 ?
"succeeded" : "failed");
}
else
grub_machine_mmap_iterate (heap_init, &total);
--
2.30.2
- Re: [PATCH 12/19] efi: mm: Pass up errors from `add_memory_regions ()`, (continued)
- [PATCH 09/19] mm: Allow dynamically requesting additional memory regions, Daniel Axtens, 2021/10/12
- [PATCH 11/19] efi: mm: Extract function to add memory regions, Daniel Axtens, 2021/10/12
- [PATCH 13/19] efi: mm: Implement runtime addition of pages, Daniel Axtens, 2021/10/12
- [PATCH 15/19] ieee1275: drop len -= 1 quirk in heap_init, Daniel Axtens, 2021/10/12
- [PATCH 14/19] ieee1275: request memory with ibm, client-architecture-support, Daniel Axtens, 2021/10/12
- [PATCH 17/19] [not for merge] print more debug info in mm, Daniel Axtens, 2021/10/12
- [PATCH 16/19] ieee1275: support runtime memory claiming, Daniel Axtens, 2021/10/12
- [PATCH 18/19] [not for merge] ieee1275 debugging info,
Daniel Axtens <=
- [PATCH 19/19] RFC: Ignore REGION_CONSECUTIVE, Daniel Axtens, 2021/10/12