From: arraybolt3@gmail.com
To: grub-devel@gnu.org, xen-devel@lists.xenproject.org
Cc: Aaron Rainbolt <arraybolt3@gmail.com>
Subject: [PATCH v5 0/3] kern/xen: Add Xen command line parsing
Date: Wed, 13 Aug 2025 20:36:42 -0500 [thread overview]
Message-ID: <20250814013645.2488043-1-arraybolt3@gmail.com> (raw)
From: Aaron Rainbolt <arraybolt3@gmail.com>
The purpose of this patch is to allow the Xen hypervisor to pass extra
data to GRUB in the form of a kernel command line, allowing the host to
customize the boot process of the guest. The command line from Xen is
parsed, and any variables within that start with the string
`xen_grub_env_` are exposed as environment variables. The grub.cfg
script can then use those environment variables as it sees fit.
The main reason for doing this is to allow implementing boot modes in
Qubes OS while also using in-VM kernels. For more context on Qubes boot
modes, see [1]. In order for this to work with in-VM kernels, it is
necessary for dom0 to pass kernel parameters to the guest without
modifying the guest's grub.cfg manually. This patch allows this to be
done, by allowing dom0 to pass kernel parameters to GRUB, which then
provides them to grub.cfg as an environment variable. The grub.cfg
script within the VM can then append those parameters to the kernel
command line.
All of the changes from version 4 of the patch are simply refinements
after review from Daniel Kiper. The patch's functionality is unchanged.
Since there are substantial changes since version 4, I've re-run the
entire battery of tests that were used against the v4 patch. All tests
pass. As previously, the tests were done by booting a patched GRUB in
Xen with various different parameters passed to it via the Xen-provided
kernel command line. The effects of these parameters on the
bootloader's environment were then tested, and then an Arch Linux image
was booted to ensure that boot still worked.
[1] https://github.com/QubesOS/qubes-linux-pvgrub2/pull/16
Aaron Rainbolt (3):
include/xen: Rename MAX_GUEST_CMDLINE to GRUB_XEN_MAX_GUEST_CMDLINE
include/xen: Add warning comment for cmd_line
kern/xen: Add Xen command line parsing
docs/grub.texi | 52 +++++
grub-core/Makefile.core.def | 2 +
grub-core/kern/i386/xen/pvh.c | 4 +
grub-core/kern/xen/cmdline.c | 361 ++++++++++++++++++++++++++++++++++
grub-core/kern/xen/init.c | 2 +
include/grub/xen.h | 2 +
include/xen/xen.h | 9 +-
7 files changed, 430 insertions(+), 2 deletions(-)
create mode 100644 grub-core/kern/xen/cmdline.c
--
2.50.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
WARNING: multiple messages have this Message-ID (diff)
From: arraybolt3@gmail.com
To: grub-devel@gnu.org, xen-devel@lists.xenproject.org
Cc: Aaron Rainbolt <arraybolt3@gmail.com>
Subject: [PATCH v5 0/3] kern/xen: Add Xen command line parsing
Date: Wed, 13 Aug 2025 20:36:42 -0500 [thread overview]
Message-ID: <20250814013645.2488043-1-arraybolt3@gmail.com> (raw)
From: Aaron Rainbolt <arraybolt3@gmail.com>
The purpose of this patch is to allow the Xen hypervisor to pass extra
data to GRUB in the form of a kernel command line, allowing the host to
customize the boot process of the guest. The command line from Xen is
parsed, and any variables within that start with the string
`xen_grub_env_` are exposed as environment variables. The grub.cfg
script can then use those environment variables as it sees fit.
The main reason for doing this is to allow implementing boot modes in
Qubes OS while also using in-VM kernels. For more context on Qubes boot
modes, see [1]. In order for this to work with in-VM kernels, it is
necessary for dom0 to pass kernel parameters to the guest without
modifying the guest's grub.cfg manually. This patch allows this to be
done, by allowing dom0 to pass kernel parameters to GRUB, which then
provides them to grub.cfg as an environment variable. The grub.cfg
script within the VM can then append those parameters to the kernel
command line.
All of the changes from version 4 of the patch are simply refinements
after review from Daniel Kiper. The patch's functionality is unchanged.
Since there are substantial changes since version 4, I've re-run the
entire battery of tests that were used against the v4 patch. All tests
pass. As previously, the tests were done by booting a patched GRUB in
Xen with various different parameters passed to it via the Xen-provided
kernel command line. The effects of these parameters on the
bootloader's environment were then tested, and then an Arch Linux image
was booted to ensure that boot still worked.
[1] https://github.com/QubesOS/qubes-linux-pvgrub2/pull/16
Aaron Rainbolt (3):
include/xen: Rename MAX_GUEST_CMDLINE to GRUB_XEN_MAX_GUEST_CMDLINE
include/xen: Add warning comment for cmd_line
kern/xen: Add Xen command line parsing
docs/grub.texi | 52 +++++
grub-core/Makefile.core.def | 2 +
grub-core/kern/i386/xen/pvh.c | 4 +
grub-core/kern/xen/cmdline.c | 361 ++++++++++++++++++++++++++++++++++
grub-core/kern/xen/init.c | 2 +
include/grub/xen.h | 2 +
include/xen/xen.h | 9 +-
7 files changed, 430 insertions(+), 2 deletions(-)
create mode 100644 grub-core/kern/xen/cmdline.c
--
2.50.1
next reply other threads:[~2025-08-14 1:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 1:36 arraybolt3 [this message]
2025-08-14 1:36 ` [PATCH v5 0/3] kern/xen: Add Xen command line parsing arraybolt3
2025-08-14 1:36 ` [PATCH v5 1/3] include/xen: Rename MAX_GUEST_CMDLINE to GRUB_XEN_MAX_GUEST_CMDLINE arraybolt3
2025-08-14 1:36 ` arraybolt3
2025-08-14 1:36 ` [PATCH v5 2/3] include/xen: Add warning comment for cmd_line arraybolt3
2025-08-14 1:36 ` arraybolt3
2025-08-18 15:19 ` Daniel Kiper
2025-08-18 15:19 ` Daniel Kiper
2025-08-14 1:36 ` [PATCH v5 3/3] kern/xen: Add Xen command line parsing arraybolt3
2025-08-14 1:36 ` arraybolt3
2025-08-18 15:52 ` Daniel Kiper
2025-08-18 15:52 ` Daniel Kiper
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=20250814013645.2488043-1-arraybolt3@gmail.com \
--to=arraybolt3@gmail.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 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.