[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V4] multiboot2: Implement quirk-modules-after-kernel

From: Daniel Kiper
Subject: Re: [PATCH V4] multiboot2: Implement quirk-modules-after-kernel
Date: Tue, 14 Apr 2020 22:09:28 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi Zide,

On Tue, Apr 07, 2020 at 02:08:59PM -0700, Zide Chen wrote:
> In contrast to Mulitboot, in Mulitboot2, there is currently no way to
> control where to load the modules to. This could be a problem, e.g., the
> OS loaded by Multiboot2 needs to reserve low address for some particular
> purposes and not for loading modules.
> This patch implements the quirk quirk-modules-after-kernel to load modules
> to address after the kernel for Multiboot2 by reusing the implementation
> for Multiboot:
> - remove "ifndef GRUB_USE_MULTIBOOT2" that is handling this quirk.
> - define separate variables for both Multiboot and Multiboot2, e.g.,
>   grub_multiboot_quirks, highest_load, etc.
> - in grub_multiboot2_load(): calculate the highest load address of raw
>   image and assign it to grub_multiboot2_highest_load.
> - the existing code in multiboot_elfxx.c is able to calculate the
>   highest_load for Mutiboot2 already.
> Currently, lowest address for Multiboot2 modules allocation was 0x0.
> With this patch, the lowest module load address is set to 1MB even if this
> quirk is not enabled.
> Tested on KBL NUC loading ACRN Hypervisor.

OK, I understand the need but I do not like the solution. I would prefer
if you extend Multiboot2 protocol specification [1] with an additional
tag. I think that it should allow a user to specify above/below the
kernel (just a 32-bit bitfield) and specific address in the memory
(64-bit). Specific address should have a preference. So, the new tag
should have at least two members. If you decide to go that way I would
like to see updates to the Multiboot2 specification first. If we are OK
with the proposed changes then you can go and write the code for GRUB.
Is it OK for you?

Last but not least, this change is not GRUB 2.06 release material.
However, I am happy to get it after the release.

If you have any questions just drop me a line.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]