From patchwork Tue May 9 09:39:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: fu.wei@linaro.org X-Patchwork-Id: 9717463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 015B760365 for ; Tue, 9 May 2017 09:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2A2B269DA for ; Tue, 9 May 2017 09:41:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7870283E8; Tue, 9 May 2017 09:41:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6998126E46 for ; Tue, 9 May 2017 09:41:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d81c0-00015o-W4; Tue, 09 May 2017 09:39:20 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d81bz-00015S-RI for xen-devel@lists.xensource.com; Tue, 09 May 2017 09:39:20 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 02/DB-03620-74E81195; Tue, 09 May 2017 09:39:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRWlGSWpSXmKPExsVyMfSaqa5bn2C kwbxzihb3prxnd2D02N63iz2AMYo1My8pvyKBNWPxkmMsBc9UK34e3cbawPhDtouRi0NIYCqj xKxv05i6GDk5WATOM0t83p4CYksIbGOVWHM5DcLOk/ixZQkbhJ0jsWXmJjCbV0BQ4uTMJywgt pCAp8T8P+dYQWxOgUCJS+e2sUAseMMosaG1nREkwSagILHpxyxGiGUqEu1/F7JDDAqQuHDzHt BQDg5hgRSJ/8s5QUwRAXOJKecDQMYwCzQwS0xcdZUZpJxZQFOidftvdghbW2LZwtfMExgFZyE 5aRaSsllIyhYwMq9iVC9OLSpLLdI110sqykzPKMlNzMzRNTQw08tNLS5OTE/NSUwq1kvOz93E CAxaBiDYwTjzsv8hRkkOJiVRXp9igUghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKEry3egQjhQSLU tNTK9Iyc4DxA5OW4OBREuHl7QVK8xYXJOYWZ6ZDpE4xGnO8uPz+PRPHk5U/3jMJseTl56VKif OKgJQKgJRmlObBDYLF9SVGWSlhXkag04R4ClKLcjNLUOVfMYpzMCoJ83qCTOHJzCuB2/cK6BQ moFMCGQRATilJREhJNTDa9/x7FOu+cV9dyXo/XmEe5T1tB55XX+u5PztS+FmLVswhzWcXv/L2 if3Z4bnm05O5/VPr+c4cPm4hO1n9/H2xLVMy1/wpvlKmOfPgZbt1qQ/evSs3VuP0vf2vVr/hZ ACPku6T4iU7BOfkH3aJdw2wPfupyeAcX3SzgJfNB/s1alMK6060n32hxFKckWioxVxUnAgAk7 UtuOYCAAA= X-Env-Sender: fu.wei@linaro.org X-Msg-Ref: server-11.tower-27.messagelabs.com!1494322757!70527302!1 X-Originating-IP: [209.85.214.53] X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 55987 invoked from network); 9 May 2017 09:39:18 -0000 Received: from mail-it0-f53.google.com (HELO mail-it0-f53.google.com) (209.85.214.53) by server-11.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 9 May 2017 09:39:18 -0000 Received: by mail-it0-f53.google.com with SMTP id o5so1851290ith.1 for ; Tue, 09 May 2017 02:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UoyuFtyqwKw+CNUzfVNODxDZsXRjK7zitc2KSnNR04I=; b=HrZuBbizoLlWFqJdMD/yFLf1bU7r2+eglF8F6glXuhqB7Y3tmeXtAuxn2qValR1u+7 vA/5DjeyD3mwJ6qt/l8Jr1l2DEhy8IF9PG1zN+KGzTUsfkrF5auHyKWBP6zyavia3eEN ZkV5LQw1z73nr7JBU1lTlLAOWHYZYV+9mjfoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UoyuFtyqwKw+CNUzfVNODxDZsXRjK7zitc2KSnNR04I=; b=EWOAx6cTIptV9Zcpto2Rb8SChxr9MASBHyiRwTKuZ/Xzd2v25QClvxSv+78FrjMyNV KB4MGoOOfce6tRCvQrdWrZXSAPB6EqT+u2Hj6xm3PF0qKkRqw3O9SVfID/vQIfD3MqyR NlJOyMNTg29I0nnmTZMSuQ1FPQBLfq/Zh/Ygh1IsbyOwcJSJMYUNRbEMNLa4cqN41Kfo 49j0uLoNntZ/JH6XSxKUmD0F1q5pa3Quz81ZpL7mEPUKA3mKQQ3UkN1UPDUPSUMe7R3z FB4ICyCCpLLqOchzfdouX4kUOvZisH8YjHZBtASPLoELrjdRNPAE9z+ep0TtUlsa12tp zgBQ== X-Gm-Message-State: AODbwcC9ilX4Qy9p1g1ucEyXB7WjvTAAsq8EQxapXa59FucYwr85oWEu hUfPyUFXSE6eI2bg6J9clDGUROnKYOyM X-Received: by 10.36.23.6 with SMTP id 6mr349616ith.40.1494322757243; Tue, 09 May 2017 02:39:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.154.71 with HTTP; Tue, 9 May 2017 02:39:16 -0700 (PDT) In-Reply-To: References: <20170502070627.11389-1-fu.wei@linaro.org> <20170502070627.11389-3-fu.wei@linaro.org> From: Fu Wei Date: Tue, 9 May 2017 17:39:16 +0800 Message-ID: To: "Vladimir 'phcoder' Serbinenko" Cc: The development of GNU GRUB , xen-devel@lists.xensource.com, arvidjaar@gmail.com, Jon Masters , ian.campbell@docker.com, Leif Lindholm , Julien Grall , Stefano Stabellini , Linaro UEFI Mailman List , Daniel Kiper Subject: Re: [Xen-devel] [PATCH v7 2/3] * util/grub.d/20_linux_xen.in: Add xen_boot command support for aarch64 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Vladimir On 9 May 2017 at 17:02, Fu Wei wrote: > Hi Vladimir > > On 9 May 2017 at 14:59, Vladimir 'phcoder' Serbinenko wrote: >> >> >> Le Tue, May 2, 2017 à 9:06 AM, a écrit : >>> >>> 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 >> >> 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? - 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 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)'