xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roman Shaposhnik <roman@zededa.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, grub-devel@gnu.org
Subject: Re: multiboot2 and module2 boot issues via GRUB2
Date: Wed, 31 Mar 2021 18:06:31 -0700	[thread overview]
Message-ID: <CAMmSBy96=FwR0zZy199e0YhFefgZj_PFOMiaB2nKjqdQvKufow@mail.gmail.com> (raw)
In-Reply-To: <23baec07-a3ae-949a-a1fb-09100efd53e5@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 2732 bytes --]

Hi Andrew!

first of all -- thanks for pointing me in the right direction. So after
reading relevant sources: comments inline.

On Tue, Mar 30, 2021 at 12:08 PM Andrew Cooper <andrew.cooper3@citrix.com>
wrote:

> On 30/03/2021 19:28, Roman Shaposhnik wrote:
> > Hi!
> >
> > seems like I've run into an issue with multiboot2 and module2
> > commands that I can't quite explain. Since it may be something
> > super simply and silly -- I wanted to reach out here before I do
> > a GRUB/Xen/LK source deepdive.
> >
> > So here's the deal: whenever I boot straight up Linux kernel
> > I can do the following sequence of commands:
> >    linux /kernel
> >    initrd foo.cpio.gz bar.cpio.gz
> > and have linux kernel effectively stack content of bar.cpio.gz
> > on top of foo.cpio.gz and present a unified initramfs that way.
> >
> > I'm trying to replicate it with Xen, but:
> >      multiboot2 /boot/xen.gz
> >      module2 /kernel
> >      module2 foo.cpio.gz
> >      module2 bar.cpio.gz
> > only seems to be picking up foo.cpio.gz
> >
> > Has anyone run into this issue before?
>
> I can explain why that happens.  Not sure if it counts as a feature, bug
> or mis-expectation, but CC'ing grub-devel for their input.
>
> The initrd command is presumably concatenating those two files together
> in memory, and presenting Linux a single initrd pointer.
>

It is indeed what seems to be happening.


> For the module2 example, you're putting 3 distinct files in memory, and
> giving Xen a list 3 modules.
>

And that is also correct -- nothing like that is possible with modules.
Kernel actually needs to be aware of them. So the question then
becomes...


> Xen is capable of taking various things via modules, such as an
> XSM/Flask policy, or microcode, so has logic to identify these if
> present and separate them from "other stuff".  However, there is a
> hardcoded expectation that the first module is the dom0 kernel, and the
> next unrecognised module, if present, is *the* initrd.

I expect that Xen isn't handing bar.cpio.gz on to dom0, but I'm not sure
> whether passing two distinct initrd-like-things to Linux is even possible.
>
> What you presumably want is some `initrd` side effect in Grub so you can
> write `module2 foo.cpio.gz bar.cpio.gz` and have it concatenate things
> together in memory and present one MB2 module, but I suspect that exact
> syntax might be ambiguous with command line handling.  I have no idea
> whether such a command currently exists.
>

...I guess there's no mechanism out-of-the box to achieve what I want?

And the obvious next question: is my EVE usecase esoteric enough that
I should just go ahead and do a custom GRUB patch or is there a more
general interest in this?

Thanks,
Roman.

[-- Attachment #2: Type: text/html, Size: 3949 bytes --]

  reply	other threads:[~2021-04-01  1:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 18:28 multiboot2 and module2 boot issues via GRUB2 Roman Shaposhnik
2021-03-30 19:08 ` Andrew Cooper
2021-04-01  1:06   ` Roman Shaposhnik [this message]
2021-04-01  7:31     ` Jan Beulich
2021-04-01  8:44       ` Roger Pau Monné
2021-04-01 19:43         ` Andrew Cooper
2021-04-06  8:19           ` Jan Beulich
2021-04-06 17:37             ` Roman Shaposhnik
2021-04-06 17:51             ` Andrew Cooper
2021-04-06 18:03               ` Roman Shaposhnik
2021-04-06 18:41                 ` Andrew Cooper
2021-04-07 20:50           ` Glenn Washburn
2021-04-08 16:48           ` Daniel Kiper
2021-03-30 19:35 ` Elliott Mitchell

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='CAMmSBy96=FwR0zZy199e0YhFefgZj_PFOMiaB2nKjqdQvKufow@mail.gmail.com' \
    --to=roman@zededa.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=grub-devel@gnu.org \
    --cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).