From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grup-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
ChangeLog: v7: http://lists.gnu.org/archive/html/grub-devel/2017-05/ 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 | 17 +++++++++++++++++ util/grub.d/20_linux_xen.in | 13 ++++++++++--- 3 files changed, 40 insertions(+), 28 deletions(-)
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 "vmlinuz*" for Dom0).
Signed-off-by: Fu Wei fu.wei@linaro.org --- grub-core/loader/arm64/xen_boot.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..0878364 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -20,6 +20,7 @@ #include <grub/charset.h> #include <grub/command.h> #include <grub/err.h> +#include <grub/env.h> #include <grub/file.h> #include <grub/fdt.h> #include <grub/list.h> @@ -379,6 +380,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 +418,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;
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 "vmlinuz*" for Dom0).
Signed-off-by: Fu Wei fu.wei@linaro.org
grub-core/loader/arm64/xen_boot.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..0878364 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -20,6 +20,7 @@ #include <grub/charset.h> #include <grub/command.h> #include <grub/err.h> +#include <grub/env.h>
This looks like spurious hunk.
#include <grub/file.h> #include <grub/fdt.h> #include <grub/list.h> @@ -379,6 +380,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 +418,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
Hi Vladimir,
On 9 May 2017 at 14:56, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 "vmlinuz*" for Dom0).
Signed-off-by: Fu Wei fu.wei@linaro.org
grub-core/loader/arm64/xen_boot.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index a914eb8..0878364 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -20,6 +20,7 @@ #include <grub/charset.h> #include <grub/command.h> #include <grub/err.h> +#include <grub/env.h>
This looks like spurious hunk.
Yes, we don't need this headfile to build xen_boot. will delete it Thanks,
#include <grub/file.h> #include <grub/fdt.h> #include <grub/list.h> @@ -379,6 +380,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 +418,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
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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 + if [ "x$machine" != xaarch64 ]; 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
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
~Andrew
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Hi Stefano,
On 4 May 2017 at 04:53, Stefano Stabellini sstabellini@kernel.org wrote:
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Exactly, great thanks for your explanation! :-)
On 05/05/17 09:57, Fu Wei wrote:
Hi Stefano,
On 4 May 2017 at 04:53, Stefano Stabellini sstabellini@kernel.org wrote:
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Exactly, great thanks for your explanation! :-)
So it really is an entirely custom Xen booting protocol.
It is unfortunate that this wasn't reviewed sensibly at the time (and implemented in a project-neutral way), but it looks like the time to fix that properly has long since passed.
~Andrew
Hi Andrew,
On 5 May 2017 at 17:01, Andrew Cooper andrew.cooper3@citrix.com wrote:
On 05/05/17 09:57, Fu Wei wrote:
Hi Stefano,
On 4 May 2017 at 04:53, Stefano Stabellini sstabellini@kernel.org wrote:
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Exactly, great thanks for your explanation! :-)
So it really is an entirely custom Xen booting protocol.
Yes, it is.
It is unfortunate that this wasn't reviewed sensibly at the time (and implemented in a project-neutral way), but it looks like the time to fix that properly has long since passed.
I guess the reason Xen use an entirely custom(lightweight) booting protocol on aarch64 is that the multiboot maybe a little "heavy" for aarch64.
~Andrew
Hi Andrew,
On 05/05/17 10:01, Andrew Cooper wrote:
On 05/05/17 09:57, Fu Wei wrote:
Hi Stefano,
On 4 May 2017 at 04:53, Stefano Stabellini sstabellini@kernel.org wrote:
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Exactly, great thanks for your explanation! :-)
So it really is an entirely custom Xen booting protocol.
Not really, Xen is using the Linux boot protocol. It does not allow to pass multiple modules. The multiboot used by x86 does not support ARM (see [1]) and hence not supported by any bootloaders existing on ARM.
The "multiboot for ARM" has been designed to be generic enough to be used by anyone (see [2]). And the original intention was to use "module" in grub.cfg. I don't know why we did this change.
It is unfortunate that this wasn't reviewed sensibly at the time (and implemented in a project-neutral way), but it looks like the time to fix that properly has long since passed.
The bindings are project neutral. Only the commands in grub are not neutral, I cannot find why it is not.
Cheers,
[1] https://www.gnu.org/software/grub/manual/multiboot/multiboot.html [2] https://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Multiboot
Hi Julien,
On 5 May 2017 at 18:11, Julien Grall julien.grall@arm.com wrote:
Hi Andrew,
On 05/05/17 10:01, Andrew Cooper wrote:
On 05/05/17 09:57, Fu Wei wrote:
Hi Stefano,
On 4 May 2017 at 04:53, Stefano Stabellini sstabellini@kernel.org wrote:
On Wed, 3 May 2017, Andrew Cooper wrote:
On 02/05/17 08:06, fu.wei@linaro.org wrote:
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
Sorry if I am jumping in late and asking awkward questions, but what is special about Xen/aarch64 here? Why is it using a non-standard entry mechanism?
Multiboot is not available on ARM. The boot protocol we have on ARM is FDT based:
http://xenbits.xen.org/gitweb/?p=xen.git%3Ba=blob%3Bf=docs/misc/arm/device-t...
We often refer to it as "multiboot for arm" but in fact it is not related to the x86 multiboot in any way.
In Grub, the two protocols (multiboot and docs/misc/arm/device-tree/booting.txt) are kept clearly distinct (55A687E5.4070106@gmail.com). Hence, the need for this patch.
Exactly, great thanks for your explanation! :-)
So it really is an entirely custom Xen booting protocol.
Not really, Xen is using the Linux boot protocol. It does not allow to pass multiple modules. The multiboot used by x86 does not support ARM (see [1]) and hence not supported by any bootloaders existing on ARM.
The "multiboot for ARM" has been designed to be generic enough to be used by anyone (see [2]). And the original intention was to use "module" in grub.cfg. I don't know why we did this change.
yes, in the early patchset, I used multiboot and module command name, But since the protocol we are using is not a real multiboot, so I followed the suggestion (using xen_hypervisor and xen_module) to do this change.
We don't want to confuse people. "module" is a command in the real multiboot module. if we don't use the real multiboot protocol, we avoid re-using its commands.
It is unfortunate that this wasn't reviewed sensibly at the time (and implemented in a project-neutral way), but it looks like the time to fix that properly has long since passed.
The bindings are project neutral. Only the commands in grub are not neutral, I cannot find why it is not.
Cheers,
[1] https://www.gnu.org/software/grub/manual/multiboot/multiboot.html [2] https://wiki.xen.org/wiki/Xen_ARM_with_Virtualization_Extensions/Multiboot
-- Julien Grall
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
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
Hi Vladimir
On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead?
Thanks!
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
Hi Vladimir
On 9 May 2017 at 17:02, Fu Wei fu.wei@linaro.org wrote:
Hi Vladimir
On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead?
Dose this patch make sense to you?
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..0c26cbb 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -122,16 +122,23 @@ linux_entry () else xen_rm_opts="no-real-mode edd=off" fi - multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} ${xen_rm_opts} + if [ "x$grub_cpu" != xarm64 ]; then + xen_loader="multiboot" + module_loader="module" + else + xen_loader="xen_hypervisor" + module_loader="xen_module" + fi + ${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
Thanks!
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
-- Best regards,
Fu Wei Software Engineer Red Hat
On Tue, May 9, 2017, 11:02 Fu Wei fu.wei@linaro.org wrote:
Hi Vladimir
On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do
this
on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead?
Yes, you can. Another possibility, probably better, is to check actual file type, see grub-file
Thanks!
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
-- Best regards,
Fu Wei Software Engineer Red Hat
Hi Vladimir,
On 11 May 2017 at 06:01, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
On Tue, May 9, 2017, 11:02 Fu Wei fu.wei@linaro.org wrote:
Hi Vladimir
On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead?
Yes, you can. Another possibility, probably better, is to check actual file type, see grub-file
Very good idea, will do in my v8 patchset, will send v8 in a day.
Thanks!
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
-- Best regards,
Fu Wei Software Engineer Red Hat
Hi Vladimir,
On 11 May 2017 at 22:25, Fu Wei fu.wei@linaro.org wrote:
Hi Vladimir,
On 11 May 2017 at 06:01, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
On Tue, May 9, 2017, 11:02 Fu Wei fu.wei@linaro.org wrote:
Hi Vladimir
On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko phcoder@gmail.com wrote:
Le Tue, May 2, 2017 à 9:06 AM, fu.wei@linaro.org a écrit :
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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index c48af94..9777719 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,13 @@ 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
- if [ "x$machine" != xaarch64 ]; then
Machine of grub-mkconfig doesn't necessarily match the kernel. Think of chroot or of having 32-bit userspace with 64-bit kernel. Better to do this on runtime. I know, it's not very nice but the whole grub-mkconfig is trouble that needs redesign that I'm working on.
So if we need to do this at run time(in grub shell), can I use "grub_cpu" variable instead?
Yes, you can. Another possibility, probably better, is to check actual file type, see grub-file
Very good idea, will do in my v8 patchset, will send v8 in a day.
I have posted v8 patchset which is using “$grub_file”, please help me to review it :-)
Great thanks!
Thanks!
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
-- Best regards,
Fu Wei Software Engineer Red Hat
-- Best regards,
Fu Wei Software Engineer Red Hat
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%7D for more detail. -@end deffn - - @node Networking commands @section The list of networking commands
Sorry for the typo
On 2 May 2017 at 15:06, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grup-mkconfig for
^ grub2-mkconfig Also in the subject.
generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
ChangeLog: v7: http://lists.gnu.org/archive/html/grub-devel/2017-05/ 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 | 17 +++++++++++++++++ util/grub.d/20_linux_xen.in | 13 ++++++++++--- 3 files changed, 40 insertions(+), 28 deletions(-)
-- 2.9.3
Hey,
On Tue, May 02, 2017 at 03:06:24PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grup-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
Slowly recovering after long weekend in Poland. I will take a look at this probably next week.
Daniel
Hi Daniel,
On 5 May 2017 at 00:00, Daniel Kiper dkiper@net-space.pl wrote:
Hey,
On Tue, May 02, 2017 at 03:06:24PM +0800, fu.wei@linaro.org wrote:
From: Fu Wei fu.wei@linaro.org
This patchset add xen_boot support into grup-mkconfig for generating xen boot entrances automatically
Also update the docs/grub.texi for new xen_boot commands.
Slowly recovering after long weekend in Poland. I will take a look at this probably next week.
OK, thanks, sorry for delay, I should post it long time ago. Looking forward to your feedback!
Daniel