All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen, Zide" <zide.chen@intel.com>
To: Daniel Kiper <dkiper@net-space.pl>
Cc: "grub-devel@gnu.org" <grub-devel@gnu.org>
Subject: RE: [PATCH V4] multiboot2: Implement quirk-modules-after-kernel
Date: Thu, 16 Apr 2020 17:42:10 +0000	[thread overview]
Message-ID: <636297D5EBADD745BF4BDD83AA58243931FE1CF8@ORSMSX102.amr.corp.intel.com> (raw)
In-Reply-To: <20200416132833.icr4xqfjrrh36uhg@tomti.i.net-space.pl>


> -----Original Message-----
> From: Daniel Kiper <dkiper@net-space.pl>
> Sent: Thursday, April 16, 2020 6:29 AM
> To: Chen, Zide <zide.chen@intel.com>
> Cc: grub-devel@gnu.org
> Subject: Re: [PATCH V4] multiboot2: Implement quirk-modules-after-kernel
> 
> > Yes, a new tag would give it more flexibility for loading modules. But my main
> > concern is don't know how to push the new tag to Multiboot2 spec, and not sure
> 
> The spec is in the multiboot2 branch in the GRUB repository.
> 
> > will it take very long time, for example, months?
> 
> It depends mostly on you and a bit on workload of folks here...

I see, sorry for my naïve question:  I need to send out a new patch dedicated for the new tag change and send to
grub-devel@gnu.orgfor review, at the time it's accepted, you will merge it to multiboot2 branch? Is it correct?

> > w.r.t. to the tag, how about the following draft which was almost borrowed from
> > the relocatable header tag? It seems this better covers the case for loading multiple
> > modules.
> >
> > Modules relocatable tag
> >
> >             +------------------+
> > u16     | type = 22       |
> > u16     | flags               |
> > u32     | size = 20        |
> > u32     | min_addr      |
> 
> s/u32/u64/

Currently modules are loaded at 32bit address only. But yes, I agree that 'u64' would
make it more flexible.

> > u32     | max_addr     |
> 
> s/u32/u64/
> 
> > u32     | preference   |
> 
> Please put preference immediately behind the size.

Sure, will do.

> 
> >             +------------------+
> >
> > This tag is independent to the relocatable header tag. All of the
> > address fields in this tag are physical addresses.
> >
> > min_addr
> > Lowest possible physical address at which any modules should be
> > loaded. The bootloader cannot load any part of any modules below this
> > address.
> 
> OK.
> 
> > max_addr
> > Highest possible physical address at which loaded any modules should
> > end. The bootloader cannot load any part of any modules above this
> > address.
> 
> OK.
> 
> > preference
> > It contains load address placement suggestion for modules. Boot loader
> > should follow it. '0' means none, '1' means load image at lowest
> > possible address but not lower than min_addr and '2' means load image
> > at highest possible address but not higher than max_addr.
> 
> I am OK with that. However, I would add something saying that the
> min_addr and max_addr usage do not depend so strongly on preference
> setting. I mean if preference is 0 then the bootloader still looks
> at the min_addr and max_addr.
> 

Sure, will do. 

> Hmmm... How would you want to use that tag to force the bootloader to
> load the modules above/below the kernel?
> 
> Daniel

Either in my case, or the motivation to quirk-modules-after-kernel in Multiboot, the
problem was that it's preferred that the modules not be loaded at lower address, and
whether it's above/below the kernel is not important.

However, if the user does want to the modules to be above/below kernel, it still has
options:

Case 1: kernel relocatable tag is not present. 
Kernel will be loaded at known address, either through address tag, or ELF. 
Then user can manipulate this modules relocatable tag to put modules above or below kernel.

Case 2: kernel relocatable tag is present.
Yes, depending on the memory fragmentation situation, the kernel can't guaranteed  to 
get address that is lower or higher addresses for modules. But the user may put different
min/max_addr in this tag and the kernel relocatable tag. In this case, the only issue is
the gap between kernel load address and modules load addresses could be relative large.

-Zide



  reply	other threads:[~2020-04-16 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 21:08 [PATCH V4] multiboot2: Implement quirk-modules-after-kernel Zide Chen
2020-04-14 20:09 ` Daniel Kiper
2020-04-14 21:39   ` Chen, Zide
2020-04-16 13:28     ` Daniel Kiper
2020-04-16 17:42       ` Chen, Zide [this message]
2020-04-16 21:18         ` Chen, Zide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=636297D5EBADD745BF4BDD83AA58243931FE1CF8@ORSMSX102.amr.corp.intel.com \
    --to=zide.chen@intel.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.