Small allocations move the region's *first pointer. The comment
says that this happens for allocations under 64K. The code says
it's for allocations under 32K. Commit 45bf8b3a7549 changed the
code intentionally: make the comment match.
Fixes: 45bf8b3a7549 (" * grub-core/kern/mm.c (grub_real_mallo
When iterating through the singly linked list of free blocks,
grub_real_malloc uses p and q for the current and previous blocks
respectively. This isn't super clear, so swap to using prev and cur.
This makes another quirk more obvious. The comment at the top of
grub_real_malloc might lead you to b
This is a sketch of much more detailed descriptions of how grub mm
works. I expect we'll want to bikeshed it a bit so I will roll up
change requests into subsequent series I send that touch mm.
Signed-off-by: Daniel Axtens
---
docs/grub-dev.texi | 405
grub_free () posesses a surprising number of quirks, and also
uses single-letter variable names confusingly to iterate through
the free list.
Document what's going on.
Use prev and cur to iterate over the free list.
Signed-off-by: Daniel Axtens
---
grub-core/kern/mm.c | 63
grub_mm_init_region does some things that seem magical, especially
around region merging. Make it a bit clearer.
Signed-off-by: Daniel Axtens
---
grub-core/kern/mm.c | 30 +-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/grub-core/kern/mm.c b/grub-core
Daniel K asked me to document some of the grub mm code as part of my
work on grub mm arising from my work on secure boot. Hopefully this
suffices.
I'd appreciate checks for technical correctness! I have found a number
of mistakes during the writing process arising from my own
misunderstandings, an
I spent more than a trivial quantity of time figuring out pre_size and
whether a memory region's size contains the header cell or not.
Document the meanings of all the properties. Hopefully now no-one else
has to figure it out!
Signed-off-by: Daniel Axtens
---
This version: thanks to Glenn Was
Hi Nikita,
Great thanks for updating V3, I have tried them on RISC-V Hardware
(Starfive StarLight/VisionFive, and Allwinner D1 Nezha), they are
working well, boot into Fedora.
My repo is here :
https://github.com/tekkamanninja/grub/tree/riscv_devel_Nikita_V3
For whole patchset:
Tested-by: Fu Wei
Daniel Kiper writes:
> CC-ing Daren, Patrick and Vladimir...
>
> When I started looking at this issue I realized we have bigger problem
> here than lack of _GL_ATTRIBUTE_CONST definition. In general all _GL_*
> constants land in config-util.h.in and finally in config-util.h. It
> does not make a