grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3] multiboot2: Implement the new module load and preferences


From: Łukasz Hawryłko
Subject: Re: [PATCH v3] multiboot2: Implement the new module load and preferences tag
Date: Mon, 06 Dec 2021 20:08:58 +0100
User-agent: Evolution 3.42.1-1

Hi Daniel

On Thu, 2021-09-09 at 18:40 +0200, Daniel Kiper wrote:
> > --- a/grub-core/loader/multiboot.c      Thu Jul 15 17:35:28 2021
> > +0200
> > +++ b/grub-core/loader/multiboot.c      Mon Aug 16 12:02:52 2021
> > +0200
> > @@ -363,12 +363,15 @@
> >                  int argc, char *argv[])
> >  {
> >    grub_file_t file = 0;
> > -  grub_ssize_t size;
> > +  grub_size_t size;
> 
> Why do you change this? If you need that change it requires an
> explanation and probably begs for separate patch.

This variable is initialised later by grub_file_size() that returns
uint64_t. Functions, where the variable is passed, also expect unsigned
value. I don't see any reason to keep it as signed and casts to
unsigned when it is used.

If you prefer to have this change is separate patch, I will do it.

> >  grub-core/loader/multiboot_mbi2.c
> > --- a/grub-core/loader/multiboot_mbi2.c Thu Jul 15 17:35:28 2021
> > +0200
> > +++ b/grub-core/loader/multiboot_mbi2.c Mon Aug 16 12:02:52 2021
> > +0200
> > @@ -75,6 +75,7 @@
> >  static void *elf_sections;
> >  static int keep_bs = 0;
> >  static grub_uint32_t load_base_addr;
> > +struct module_load_preferences grub_multiboot2_mlp;
> > 
> >  void
> >  grub_multiboot2_add_elfsyms (grub_size_t num, grub_size_t entsize,
> > @@ -114,6 +115,7 @@
> >    struct multiboot_header_tag *tag;
> >    struct multiboot_header_tag_address *addr_tag = NULL;
> >    struct multiboot_header_tag_relocatable *rel_tag;
> > +  struct multiboot_header_tag_module_load_preferences
> > *mod_load_tag;
> >    int entry_specified = 0, efi_entry_specified = 0;
> >    grub_addr_t entry = 0, efi_entry = 0;
> >    grub_uint32_t console_required = 0;
> > @@ -123,6 +125,7 @@
> > 
> >    mld.mbi_ver = 2;
> >    mld.relocatable = 0;
> > +  grub_multiboot2_mlp.relocatable = 0;
> 
> I would prefer if you use mld for this. Of course you have to rename
> members then, e.g. mld.mod_relocatable.

MLD is not a good place for this as it is not exposed to
grub_cmd_module(). It is allocated on stack inside
grub_multiboot2_load() and used only when processing multiboot2
command. I need a place where values obtained by parsing multiboot2
kernel header will be available during multiboot2 modules load.

Lukasz




reply via email to

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