[PATCH 3/6] mm: grub_real_malloc: make small allocs comment match code

2021-11-24 Thread Daniel Axtens
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

[PATCH 2/6] mm: clarify grub_real_malloc

2021-11-24 Thread Daniel Axtens
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

[PATCH 6/6] [RFC] docs: document mm

2021-11-24 Thread Daniel Axtens
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

[PATCH 4/6] mm: document grub_free

2021-11-24 Thread Daniel Axtens
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

[PATCH 5/6] mm: document grub_mm_init_region

2021-11-24 Thread Daniel Axtens
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

[PATCH 0/6] Document mm

2021-11-24 Thread Daniel Axtens
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

[PATCH 1/6] mm: document grub internal memory management structures

2021-11-24 Thread Daniel Axtens
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

Re: [PATCH v3 0/7] Add LoadFile2 and riscv Linux loader

2021-11-24 Thread Fu Wei
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

Re: [PATCH] Drop gnulib fix-base64.patch

2021-11-24 Thread Robbie Harwood
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