Re: [PATCH v2] util/grub.d/linux: Improve initramfs detection

2022-04-07 Thread Oskari Pirhonen
On Thu, Apr 07, 2022 at 05:44:18PM +0200, Daniel Kiper wrote: > On Sun, Mar 27, 2022 at 10:41:31PM -0500, Oskari Pirhonen wrote: > > Add detection for initramfs of the form *.img.old. For example, Gentoo's > > sys-kernel/genkernel installs it as initramfs-*.img and moves any > > existing one to ini

Re: [PATCH v2] util/grub.d/linux: Improve initramfs detection

2022-04-07 Thread Daniel Kiper
On Sun, Mar 27, 2022 at 10:41:31PM -0500, Oskari Pirhonen wrote: > Add detection for initramfs of the form *.img.old. For example, Gentoo's > sys-kernel/genkernel installs it as initramfs-*.img and moves any > existing one to initramfs-*.img.old. You are mentioning initramfs* files but the patch a

Re: [PATCH 1/1] jpeg: Fix possible invalid loop boundary condition

2022-04-07 Thread Daniel Kiper
On Tue, Apr 05, 2022 at 06:25:52PM +, Darren Kenny wrote: > The value of next_marker is adjusted based on the a word sized value > read from data->file. > > The updated next_marker value should reference a location in the file > just beyond the huffman table, and as such should not have a value

Re: [PATCH v2 00/15] Dynamic allocation of memory regions and IBM vTPM v2

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:25PM +1100, Daniel Axtens wrote: > Hi all, > > This is, at long last, an updated version of my series extending Patrick's > dynamic memory regions to ieee1275. > > Noteworthy changes: > > - reworked debug prints as grub_dprintfs. Folded the ieee1275 ones into the >

[PATCH RFC 3/3] efi: explicitly set memory attributes for memory

2022-04-07 Thread Baskov Evgeniy
UEFI specification does not guarantee that memory used for trampoline by GRUB would be executable. Some stricter implementations set NX flag for most regions. Explicitly mark memory range where trampoline would be allocated as writable and executable using DXE services on x86-efi variations. Avoi

[PATCH RFC 0/3] EFI memory attributes

2022-04-07 Thread Baskov Evgeniy
UEFI specification does not guarantee that all memory would be executable and there exist some UEFI implementations imposing stricter memory management policies and restricting execution of memory where trampoline code generated by relocator is placed. That causes page fault during boot. Explicit

[PATCH RFC 2/3] relocator: allocate trampoline in lower 640k

2022-04-07 Thread Baskov Evgeniy
For simplification, allocate trampoline in lower memory for every x86 variation. This would help setting right attributes for memory in UEFI environments that restricts execution of some memory regions. Signed-off-by: Baskov Evgeniy diff --git a/grub-core/lib/i386/relocator.c b/grub-core/lib/i3

[PATCH RFC 1/3] efi: provide definitions of DXE services table

2022-04-07 Thread Baskov Evgeniy
DXE services can be used to change memory attributes on systems where EFI use stricter policies about memory access rights and sets NX flag on some pages required by grub to executable. Signed-off-by: Baskov Evgeniy diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c index 40434ee9d

Re: [PATCH v2 09/15] efi: mm: Pass up errors from `add_memory_regions ()`

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:34PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > The function `add_memory_regions ()` is currently only called on system > initialization to allocate a fixed amount of pages. As such, it didn't > need to return any errors: in case it failed, we cannot p

Re: [PATCH v2 08/15] efi: mm: Extract function to add memory regions

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:33PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > In preparation of support for runtime-allocating additional memory > region, this patch extracts the function to retrieve the EFI memory map > and add a subset of it to GRUB's own memory regions. > > Sign

Re: [PATCH v2 06/15] mm: Allow dynamically requesting additional memory regions

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:31PM +1100, Daniel Axtens wrote: > From: Patrick Steinhardt > > Currently, all platforms will set up their heap on initialization of the > platform code. While this works mostly fine, it poses some limitations > on memory management on us. Most notably, allocating big

Re: [PATCH v2 04/15] mm: debug support for region operations

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:29PM +1100, Daniel Axtens wrote: > This is handy for debugging. Enable with `set debug=regions`. > > Signed-off-by: Daniel Axtens Reviewed-by: Daniel Kiper Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://li

Re: [PATCH v2 03/15] mm: when adding a region, merge with region after as well as before

2022-04-07 Thread Daniel Kiper
On Mon, Mar 28, 2022 at 05:22:28PM +1100, Daniel Axtens wrote: > On x86_64-efi (at least) regions seem to be added from top down. The mm > code will merge a new region with an existing region that comes > immediately before the new region. This allows larger allocations to be > satisfied that would