xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig
@ 2017-05-14  7:43 fu.wei
  2017-05-14  7:43 ` [PATCH v8 1/3] arm64: add "--nounzip" option support in xen_module command fu.wei
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: fu.wei @ 2017-05-14  7:43 UTC (permalink / raw)
  To: dkiper, grub-devel, arvidjaar, phcoder
  Cc: xen-devel, jcm, ian.campbell, leif.lindholm, julien.grall,
	sstabellini, linaro-uefi, Fu Wei

From: Fu Wei <fu.wei@linaro.org>

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(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v8 1/3] arm64: add "--nounzip" option support in xen_module command
  2017-05-14  7:43 [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig fu.wei
@ 2017-05-14  7:43 ` fu.wei
  2017-05-14  7:43 ` [PATCH v8 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 fu.wei
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: fu.wei @ 2017-05-14  7:43 UTC (permalink / raw)
  To: dkiper, grub-devel, arvidjaar, phcoder
  Cc: xen-devel, jcm, ian.campbell, leif.lindholm, julien.grall,
	sstabellini, linaro-uefi, Fu Wei

From: Fu Wei <fu.wei@linaro.org>

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).

Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
 grub-core/loader/arm64/xen_boot.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c
index a914eb8..2a42654 100644
--- a/grub-core/loader/arm64/xen_boot.c
+++ b/grub-core/loader/arm64/xen_boot.c
@@ -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;
-- 
2.9.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v8 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64
  2017-05-14  7:43 [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig fu.wei
  2017-05-14  7:43 ` [PATCH v8 1/3] arm64: add "--nounzip" option support in xen_module command fu.wei
@ 2017-05-14  7:43 ` fu.wei
  2017-05-14  7:43 ` [PATCH v8 3/3] arm64: update the introduction of xen boot commands in docs/grub.texi fu.wei
  2017-05-15 13:38 ` [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig Daniel Kiper
  3 siblings, 0 replies; 9+ messages in thread
From: fu.wei @ 2017-05-14  7:43 UTC (permalink / raw)
  To: dkiper, grub-devel, arvidjaar, phcoder
  Cc: xen-devel, jcm, ian.campbell, leif.lindholm, julien.grall,
	sstabellini, linaro-uefi, Fu Wei

From: Fu Wei <fu.wei@linaro.org>

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.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
 util/grub.d/20_linux_xen.in | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
index c48af94..c002fc9 100644
--- a/util/grub.d/20_linux_xen.in
+++ b/util/grub.d/20_linux_xen.in
@@ -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
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v8 3/3] arm64: update the introduction of xen boot commands in docs/grub.texi
  2017-05-14  7:43 [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig fu.wei
  2017-05-14  7:43 ` [PATCH v8 1/3] arm64: add "--nounzip" option support in xen_module command fu.wei
  2017-05-14  7:43 ` [PATCH v8 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 fu.wei
@ 2017-05-14  7:43 ` fu.wei
  2017-05-15 13:38 ` [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig Daniel Kiper
  3 siblings, 0 replies; 9+ messages in thread
From: fu.wei @ 2017-05-14  7:43 UTC (permalink / raw)
  To: dkiper, grub-devel, arvidjaar, phcoder
  Cc: xen-devel, jcm, ian.campbell, leif.lindholm, julien.grall,
	sstabellini, linaro-uefi, Fu Wei

From: Fu Wei <fu.wei@linaro.org>

delete: xen_linux, xen_initrd, xen_xsm
add: xen_module

This update bases on
    commit 0edd750e50698854068358ea53528100a9192902
    Author: Vladimir Serbinenko <phcoder@gmail.com>
    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.

Signed-off-by: Fu Wei <fu.wei@linaro.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
---
 docs/grub.texi | 38 +++++++++++++-------------------------
 1 file changed, 13 insertions(+), 25 deletions(-)

diff --git a/docs/grub.texi b/docs/grub.texi
index e935af3..a0c4b9e 100644
--- a/docs/grub.texi
+++ b/docs/grub.texi
@@ -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
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig
  2017-05-14  7:43 [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig fu.wei
                   ` (2 preceding siblings ...)
  2017-05-14  7:43 ` [PATCH v8 3/3] arm64: update the introduction of xen boot commands in docs/grub.texi fu.wei
@ 2017-05-15 13:38 ` Daniel Kiper
  2017-05-15 13:43   ` Julien Grall
  3 siblings, 1 reply; 9+ messages in thread
From: Daniel Kiper @ 2017-05-15 13:38 UTC (permalink / raw)
  To: fu.wei
  Cc: grub-devel, xen-devel, jcm, arvidjaar, phcoder, ian.campbell,
	leif.lindholm, julien.grall, sstabellini, linaro-uefi, dkiper

On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
> From: Fu Wei <fu.wei@linaro.org>
>
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig
  2017-05-15 13:38 ` [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig Daniel Kiper
@ 2017-05-15 13:43   ` Julien Grall
  2017-05-15 13:46     ` Daniel Kiper
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Grall @ 2017-05-15 13:43 UTC (permalink / raw)
  To: Daniel Kiper, fu.wei
  Cc: grub-devel, xen-devel, arvidjaar, phcoder, ian.campbell,
	leif.lindholm, sstabellini, linaro-uefi, jcm

Hi Daniel,

On 15/05/17 14:38, Daniel Kiper wrote:
> On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> 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

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig
  2017-05-15 13:43   ` Julien Grall
@ 2017-05-15 13:46     ` Daniel Kiper
  2017-05-15 22:27       ` Fu Wei
  2017-05-18 21:05       ` Daniel Kiper
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Kiper @ 2017-05-15 13:46 UTC (permalink / raw)
  To: Julien Grall
  Cc: grub-devel, xen-devel, jcm, arvidjaar, phcoder, ian.campbell,
	leif.lindholm, sstabellini, Daniel Kiper, linaro-uefi, fu.wei

Hi Julien,

On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
> Hi Daniel,
>
> On 15/05/17 14:38, Daniel Kiper wrote:
> >On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
> >>From: Fu Wei <fu.wei@linaro.org>
> >>
> >>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

Will do with this patch series.

Daniel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig
  2017-05-15 13:46     ` Daniel Kiper
@ 2017-05-15 22:27       ` Fu Wei
  2017-05-18 21:05       ` Daniel Kiper
  1 sibling, 0 replies; 9+ messages in thread
From: Fu Wei @ 2017-05-15 22:27 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: The development of GNU GRUB, xen-devel, arvidjaar,
	Vladimir Serbinenko, ian.campbell, Leif Lindholm, Julien Grall,
	Stefano Stabellini, Linaro UEFI Mailman List, Jon Masters

Hi Daniel,

On 15 May 2017 at 21:46, Daniel Kiper <dkiper@net-space.pl> wrote:
> Hi Julien,
>
> On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
>> Hi Daniel,
>>
>> On 15/05/17 14:38, Daniel Kiper wrote:
>> >On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
>> >>From: Fu Wei <fu.wei@linaro.org>
>> >>
>> >>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
>
> Will do with this patch series.
>

Great thanks ! :-)


> Daniel



-- 
Best regards,

Fu Wei
Software Engineer
Red Hat

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig
  2017-05-15 13:46     ` Daniel Kiper
  2017-05-15 22:27       ` Fu Wei
@ 2017-05-18 21:05       ` Daniel Kiper
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel Kiper @ 2017-05-18 21:05 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: grub-devel, xen-devel, jcm, arvidjaar, phcoder, ian.campbell,
	leif.lindholm, Julien Grall, sstabellini, linaro-uefi, fu.wei

On Mon, May 15, 2017 at 03:46:55PM +0200, Daniel Kiper wrote:
> Hi Julien,
>
> On Mon, May 15, 2017 at 02:43:28PM +0100, Julien Grall wrote:
> > Hi Daniel,
> >
> > On 15/05/17 14:38, Daniel Kiper wrote:
> > >On Sun, May 14, 2017 at 03:43:44PM +0800, fu.wei@linaro.org wrote:
> > >>From: Fu Wei <fu.wei@linaro.org>
> > >>
> > >>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
>
> Will do with this patch series.

Committed...

Daniel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-05-18 21:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-14  7:43 [PATCH v8 0/3] arm64,xen: add xen_boot support into grub-mkconfig fu.wei
2017-05-14  7:43 ` [PATCH v8 1/3] arm64: add "--nounzip" option support in xen_module command fu.wei
2017-05-14  7:43 ` [PATCH v8 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 fu.wei
2017-05-14  7:43 ` [PATCH v8 3/3] arm64: update the introduction of xen boot commands in docs/grub.texi fu.wei
2017-05-15 13:38 ` [PATCH v8 0/3] arm64, xen: add xen_boot support into grub-mkconfig Daniel Kiper
2017-05-15 13:43   ` Julien Grall
2017-05-15 13:46     ` Daniel Kiper
2017-05-15 22:27       ` Fu Wei
2017-05-18 21:05       ` Daniel Kiper

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).