Skip to contentSkip to conversation

arm64,xen: add xen_boot support into grub-mkconfig

PATCH In review [email protected] 3 participants 9 messages May 14, 2017 – May 18, 2017

lore
Share & tools
lore
#0 lore raw

v8 cover arm64,xen: add xen_boot support into grub-mkconfig

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

ChangeLog:
v8: http://lists.gnu.org/archive/html/grub-devel/2017-05/
Delete the redundant "#include <grub/env.h>" in patch 0001. Use $grub_file instead of "feature_xen_boot" mechanism to determine which xen boot commands we should use.

v7: http://lists.gnu.org/archive/html/grub-devel/2017-05/msg00000.html
Delete patch 0001(v6) which is wrong.
Improve the commit message of 0002(v6).
Use "machine" variable instead of "feature_xen_boot" mechanism to determine which xen boot commands we should use.
Update the introduction of xen_module commands in docs/grub.texi, emphasize xen_hypervisor and xen_module are only for AArch64.

v6: http://lists.gnu.org/archive/html/grub-devel/2016-07/msg00034.html
Fix Coding style of util/grub.d/20_linux_xen.in, use soft tab.

v5: http://lists.gnu.org/archive/html/grub-devel/2016-07/msg00008.html
Update the introduction of xen_module commands in docs/grub.texi, according to the suggestion from Julien Grall

v4: http://lists.gnu.org/archive/html/grub-devel/2016-05/
according to the XSM loading mechanism of Xen(upstreamed), update the introduction of xen_module commands in docs/grub.texi

v3: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00314.html
reorder the patches
update the introduction of xen_module commands in docs/grub.texi

v2: http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00282.html
add "--nounzip" option support in xen_module
use "feature_xen_boot" instead of "grub_xen_boot" update the introduction of xen boot commands in docs/grub.texi

v1 :first upstream patchset:

    http://lists.gnu.org/archive/html/grub-devel/2016-02/msg00264.html
Fu Wei (3):
  arm64: add "--nounzip" option support in xen_module command
  * util/grub.d/20_linux_xen.in: Add xen_boot command support for
    aarch64

arm64: update the introduction of xen boot commands in docs/grub.texi

 docs/grub.texi                    | 38 +++++++++++++-------------------------
 grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++
 util/grub.d/20_linux_xen.in       | 14 +++++++++++---
 3 files changed, 40 insertions(+), 28 deletions(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH v8 1/3 arm64: add "--nounzip" option support in xen_module command

From: Fu Wei <[email protected]>

This patch adds "--nounzip" option support in order to
be compatible with the module command of multiboot on other architecture, by this way we can simplify grub-mkconfig support code.

This patch also allow us to use zip compressed module(like Linux kernel for Dom0).

---
 grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
grub-core/loader/arm64/xen_boot.c +16 -0
index a914eb8..2a42654 100644
@@ -379,6 +379,20 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
 
   struct xen_boot_binary *module = NULL;
   grub_file_t file = 0;
+  int nounzip = 0;
+
+  if (!argc)
+    {
+      grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
+      goto fail;
+    }
+
+  if (grub_strcmp (argv[0], "--nounzip") == 0)
+    {
+      argv++;
+      argc--;
+      nounzip = 1;
+    }
 
   if (!argc)
     {
@@ -403,6 +417,8 @@ grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)),
 
   grub_dprintf ("xen_loader", "Init module and node info\n");
 
+  if (nounzip)
+    grub_file_filter_disable_compression ();
   file = grub_file_open (argv[0]);
   if (!file)
     goto fail;
Signature · 7 lines
2.9.3


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

PATCH v8 2/3 * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64

In reply to [email protected]

From: Fu Wei <[email protected]>

This patch adds the support of xen_boot command for aarch64:
xen_hypervisor
xen_module
These two commands are only for aarch64, since it has its own protocol and commands to boot xen hypervisor and Dom0, but not multiboot.

For other architectures, they are still using multiboot and module commands.

---
 util/grub.d/20_linux_xen.in | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
util/grub.d/20_linux_xen.in +11 -3
index c48af94..c002fc9 100644
@@ -122,16 +122,16 @@ linux_entry ()
         else
             xen_rm_opts="no-real-mode edd=off"
         fi
-	multiboot	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
+	${xen_loader}	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
 	echo	'$(echo "$lmessage" | grub_quote)'
-	module	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
+	${module_loader}	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
 EOF
   if test -n "${initrd}" ; then
     # TRANSLATORS: ramdisk isn't identifier. Should be translated.
     message="$(gettext_printf "Loading initial ramdisk ...")"
     sed "s/^/$submenu_indentation/" << EOF
 	echo	'$(echo "$message" | grub_quote)'
-	module	--nounzip   ${rel_dirname}/${initrd}
+	${module_loader}	--nounzip   ${rel_dirname}/${initrd}
 EOF
   fi
   sed "s/^/$submenu_indentation/" << EOF
@@ -206,6 +206,14 @@ while [ "x${xen_list}" != "x" ] ; do
     if [ "x$is_top_level" != xtrue ]; then
 	echo "	submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
     fi
+    $grub_file --is-arm64-efi $current_xen
+    if [ $? -ne 0 ]; then
+	xen_loader="multiboot"
+	module_loader="module"
+    else
+	xen_loader="xen_hypervisor"
+	module_loader="xen_module"
+    fi
     while [ "x$list" != "x" ] ; do
 	linux=`version_find_latest $list`
 	gettext_printf "Found linux image: %s\n" "$linux" >&2
Signature · 1 line
2.9.3
#3 lore raw

PATCH v8 3/3 arm64: update the introduction of xen boot commands in docs/grub.texi

In reply to [email protected]

From: Fu Wei <[email protected]>

delete: xen_linux, xen_initrd, xen_xsm
add: xen_module

This update bases on
commit 0edd750e50698854068358ea53528100a9192902
Author: Vladimir Serbinenko <[email protected]>
Date: Fri Jan 22 10:18:47 2016 +0100

xen_boot: Remove obsolete module type distinctions.

Also bases on the module loading mechanism of Xen code:
488c2a8 docs/arm64: clarify the documention for loading XSM support 67831c4 docs/arm64: update the documentation for loading XSM support ca32012 xen/arm64: check XSM Magic from the second unknown module.

---
 docs/grub.texi | 38 +++++++++++++-------------------------
 1 file changed, 13 insertions(+), 25 deletions(-)
docs/grub.texi +13 -25
index e935af3..a0c4b9e 100644
@@ -3873,11 +3873,9 @@ you forget a command, you can run the command @command{help}
 @comment * vbeinfo::                     List available video modes
 * verify_detached::             Verify detached digital signature
 * videoinfo::                   List available video modes
-@comment * xen_*::              Xen boot commands
-* xen_hypervisor::              Load xen hypervisor binary
-* xen_linux::                   Load dom0 kernel for xen hypervisor
-* xen_initrd::                  Load dom0 initrd for dom0 kernel
-* xen_xsm::                     Load xen security module for xen hypervisor
+@comment * xen_*::              Xen boot commands for AArch64
+* xen_hypervisor::              Load xen hypervisor binary (only on AArch64)
+* xen_module::                  Load xen modules for xen hypervisor (only on AArch64)
 @end menu
 
 
@@ -5153,32 +5151,22 @@ List available video modes. If resolution is given, show only matching modes.
 Load a Xen hypervisor binary from @var{file}. The rest of the line is passed
 verbatim as the @dfn{kernel command-line}. Any other binaries must be
 reloaded after using this command.
+This command is only available on AArch64 systems.
 @end deffn
 
-@node xen_linux
-@subsection xen_linux
+@node xen_module
+@subsection xen_module
 
-@deffn Command xen_linux file [arguments]
-Load a dom0 kernel image for xen hypervisor at the booting process of xen.
+@deffn Command xen_module [--nounzip] file [arguments]
+Load a module for xen hypervisor at the booting process of xen.
 The rest of the line is passed verbatim as the module command line.
+Modules should be loaded in the following order:
+ - dom0 kernel image
+ - dom0 ramdisk if present
+ - XSM policy if present
+This command is only available on AArch64 systems.
 @end deffn
 
-@node xen_initrd
-@subsection xen_initrd
-
-@deffn Command xen_initrd file
-Load a initrd image for dom0 kernel at the booting process of xen.
-@end deffn
-
-@node xen_xsm
-@subsection xen_xsm
-
-@deffn Command xen_xsm file
-Load a xen security module for xen hypervisor at the booting process of xen.
-See @uref{http://wiki.xen.org/wiki/XSM} for more detail.
-@end deffn
-
-
 @node Networking commands
 @section The list of networking commands
 
Signature · 1 line
2.9.3
#4 lore raw

Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig

In reply to [email protected]
Quoted 6 lines · On Sun, May 14, 2017 at 03:43:44PM +0800, [email protected] wrote:

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.

Daniel

#5 lore raw

Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig

Hi Daniel,

Quoted 10 lines · Daniel Kiper
Quoted 6 lines · On Sun, May 14, 2017 at 03:43:44PM +0800, [email protected] wrote:

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.

Thank you!

Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.

Cheers,

[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html

Signature · 1 line
Julien Grall
#6 lore raw

Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig

Hi Julien,

Quoted 14 lines · Julien Grall

Hi Daniel,

Quoted 10 lines · Daniel Kiper
Quoted 6 lines · On Sun, May 14, 2017 at 03:43:44PM +0800, [email protected] wrote:

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.

Quoted 8 lines

Thank you!

Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.

Cheers,

[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html

Will do with this patch series.

Daniel

author
#7 lore raw

Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig

Hi Daniel,

Quoted 19 lines · Daniel Kiper

Hi Julien,

Quoted 16 lines · Julien Grall

Hi Daniel,

Quoted 10 lines · Daniel Kiper
Quoted 6 lines · On Sun, May 14, 2017 at 03:43:44PM +0800, [email protected] wrote:

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.

Thank you!

Quoted 9 lines
Quoted 6 lines

Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.

Cheers,

[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html

Will do with this patch series.

Great thanks ! :-)

Quoted 1 line

Daniel

Signature · 5 lines
Best regards,

Fu Wei
Software Engineer
Red Hat
#8 lore raw

Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig

In reply to Daniel Kiper
Quoted 19 lines · Daniel Kiper

Hi Julien,

Quoted 16 lines · Julien Grall

Hi Daniel,

Quoted 10 lines · Daniel Kiper
Quoted 6 lines · On Sun, May 14, 2017 at 03:43:44PM +0800, [email protected] wrote:

From: Fu Wei <[email protected]>

This patchset add xen_boot support into grub-mkconfig for generating xen boot entrances automatically

Also update the docs/grub.texi for new xen_boot commands.

LGTM, if there are no objections I will commit it at the end of this week or the beginning of next one.

Thank you!

Quoted 8 lines
Quoted 6 lines

Can you also please commit patch [1] which has been sitting on the grub ML for more than a year? This is preventing to boot Xen ARM with GRUB.

Cheers,

[1] https://lists.gnu.org/archive/html/grub-devel/2016-02/msg00205.html

Will do with this patch series.

Committed...

Daniel