From patchwork Tue May 2 07:06:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fu Wei Fu X-Patchwork-Id: 98401 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1740438qgf; Tue, 2 May 2017 00:07:06 -0700 (PDT) X-Received: by 10.36.233.66 with SMTP id f63mr1696406ith.46.1493708826165; Tue, 02 May 2017 00:07:06 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e196si16427066ioe.75.2017.05.02.00.07.05; Tue, 02 May 2017 00:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id A640960F09; Tue, 2 May 2017 07:07:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id AE09F60D4E; Tue, 2 May 2017 07:07:02 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 70AD560CCA; Tue, 2 May 2017 07:07:00 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.linaro.org (Postfix) with ESMTPS id B83C660CCA for ; Tue, 2 May 2017 07:06:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89B512DBB85; Tue, 2 May 2017 07:06:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89B512DBB85 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 89B512DBB85 Received: from Rei-Ayanami.localdomain.com (ovpn-8-44.pek2.redhat.com [10.72.8.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id B57E57D979; Tue, 2 May 2017 07:06:39 +0000 (UTC) From: fu.wei@linaro.org To: dkiper@net-space.pl, grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Tue, 2 May 2017 15:06:25 +0800 Message-Id: <20170502070627.11389-2-fu.wei@linaro.org> In-Reply-To: <20170502070627.11389-1-fu.wei@linaro.org> References: <20170502070627.11389-1-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 02 May 2017 07:06:46 +0000 (UTC) Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, jcm@redhat.com, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org Subject: [Linaro-uefi] [PATCH v7 1/3] arm64: add "--nounzip" option support in xen_module command X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" From: Fu Wei 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 --- 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 #include #include +#include #include #include #include @@ -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; From patchwork Tue May 2 07:06:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fu Wei Fu X-Patchwork-Id: 98402 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1740558qgf; Tue, 2 May 2017 00:07:26 -0700 (PDT) X-Received: by 10.36.33.144 with SMTP id e138mr1565031ita.9.1493708846852; Tue, 02 May 2017 00:07:26 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u7si16324434iou.248.2017.05.02.00.07.26; Tue, 02 May 2017 00:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 62ADF60D7E; Tue, 2 May 2017 07:07:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E7A6E60EDE; Tue, 2 May 2017 07:07:08 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 061F960D86; Tue, 2 May 2017 07:07:01 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.linaro.org (Postfix) with ESMTPS id 1F04560EA1 for ; Tue, 2 May 2017 07:06:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03FF9C49A5; Tue, 2 May 2017 07:06:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 03FF9C49A5 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 03FF9C49A5 Received: from Rei-Ayanami.localdomain.com (ovpn-8-44.pek2.redhat.com [10.72.8.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BD7A7D940; Tue, 2 May 2017 07:06:45 +0000 (UTC) From: fu.wei@linaro.org To: dkiper@net-space.pl, grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Tue, 2 May 2017 15:06:26 +0800 Message-Id: <20170502070627.11389-3-fu.wei@linaro.org> In-Reply-To: <20170502070627.11389-1-fu.wei@linaro.org> References: <20170502070627.11389-1-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 02 May 2017 07:06:53 +0000 (UTC) Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, jcm@redhat.com, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org Subject: [Linaro-uefi] [PATCH v7 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" From: Fu Wei 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 --- 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 From patchwork Tue May 2 07:06:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fu Wei Fu X-Patchwork-Id: 98403 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1740609qgf; Tue, 2 May 2017 00:07:36 -0700 (PDT) X-Received: by 10.107.34.21 with SMTP id i21mr27048102ioi.52.1493708856904; Tue, 02 May 2017 00:07:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 91si15665621iol.60.2017.05.02.00.07.36; Tue, 02 May 2017 00:07:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7310D60F09; Tue, 2 May 2017 07:07:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2450560EA1; Tue, 2 May 2017 07:07:10 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C245760D4E; Tue, 2 May 2017 07:07:01 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.linaro.org (Postfix) with ESMTPS id 42F4760D4E for ; Tue, 2 May 2017 07:06:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 33FC3DFB64; Tue, 2 May 2017 07:06:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 33FC3DFB64 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 33FC3DFB64 Received: from Rei-Ayanami.localdomain.com (ovpn-8-44.pek2.redhat.com [10.72.8.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E3327EF43; Tue, 2 May 2017 07:06:53 +0000 (UTC) From: fu.wei@linaro.org To: dkiper@net-space.pl, grub-devel@gnu.org, arvidjaar@gmail.com, phcoder@gmail.com Date: Tue, 2 May 2017 15:06:27 +0800 Message-Id: <20170502070627.11389-4-fu.wei@linaro.org> In-Reply-To: <20170502070627.11389-1-fu.wei@linaro.org> References: <20170502070627.11389-1-fu.wei@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 02 May 2017 07:06:58 +0000 (UTC) Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, jcm@redhat.com, julien.grall@arm.com, sstabellini@kernel.org, linaro-uefi@lists.linaro.org Subject: [Linaro-uefi] [PATCH v7 3/3] arm64: update the introduction of xen boot commands in docs/grub.texi X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" From: Fu Wei delete: xen_linux, xen_initrd, xen_xsm add: xen_module This update bases on commit 0edd750e50698854068358ea53528100a9192902 Author: Vladimir Serbinenko 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 Reviewed-by: Julien Grall --- 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