From patchwork Tue Feb 21 19:24:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9585461 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 D7B9B602A7 for ; Tue, 21 Feb 2017 19:26:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C573C283F9 for ; Tue, 21 Feb 2017 19:26:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8AA02860A; Tue, 21 Feb 2017 19:26:55 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY 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 57CB1283F9 for ; Tue, 21 Feb 2017 19:26:55 +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 1cgG3X-00037E-Mm; Tue, 21 Feb 2017 19:24:59 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cgG3W-00036x-G5 for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 19:24:58 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id E4/8C-16066-9049CA85; Tue, 21 Feb 2017 19:24:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsUyZ7p8oC7nlDU RBvu2sFh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnPTycUzBSpaL31lbmBsYGvi5GLQ0hgIpPE 2wnLWCGcb4wS92fPYIFwNjJK9O3ezARVxiixa/peoAwnB4uAqsSHHx8ZQWw2AR2Ji18esoPYI gJKEvdWTQZrYBaYySRx+s5JsAZhgRCJp62fmUFsXgEbic9bFrNBTG1hlPhy5xQjREJQ4uTMJ2 ANzAJaEjf+vQSaxAFkS0ss/8cBEuYU8JCYOWMxK4gtKqAiMeXkNjYQW0LAUOL0w22MExgFZyG ZNAvJpFkIkxYwMq9i1ChOLSpLLdI1NNFLKspMzyjJTczM0TU0MNXLTS0uTkxPzUlMKtZLzs/d xAgMXQYg2MF49rTnIUZJDiYlUd6cjDURQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4XWqBcoJFq empFWmZOcAogklLcPAoifAeqAFK8xYXJOYWZ6ZDpE4xKkqJ8/KD9AmAJDJK8+DaYJF7iVFWSp iXEegQIZ6C1KLczBJU+VeM4hyMSsK8gSBTeDLzSuCmvwJazAS0+KbHSpDFJYkIKakGRu7v9jr iKvG6EqbTC2d8CT/RskdsqfnMdaE127vTz7Pcvl7k9CzCcvfk0Ljm6P+i+wWelTzP32xx2lIo f+0K4efHLQKXXcpRepMUamy5sHHnNledfQ6+fy3UrVimb0v8kPm2VPaMjvysH4e7GwSC7mZ4J 2VlZt7tmvnl7/Ore8U2icrlH5uSqMRSnJFoqMVcVJwIAACWy2rXAgAA X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1487705095!70520662!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43352 invoked from network); 21 Feb 2017 19:24:56 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-13.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Feb 2017 19:24:56 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1LJOgMS009346 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Feb 2017 19:24:42 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v1LJOg4M023438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 Feb 2017 19:24:42 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v1LJOd5u017024; Tue, 21 Feb 2017 19:24:40 GMT Received: from olila.local.net-space.pl (/10.175.217.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Feb 2017 11:24:39 -0800 Date: Tue, 21 Feb 2017 20:24:33 +0100 From: Daniel Kiper To: xen-devel@lists.xenproject.org Message-ID: <20170221192433.GA3484@olila.local.net-space.pl> References: <1487704799-21162-1-git-send-email-daniel.kiper@oracle.com> <1487704799-21162-5-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1487704799-21162-5-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: jgross@suse.com, sstabellini@kernel.org, andrew.cooper3@citrix.com, cardoe@cardoe.com, pgnet.dev@gmail.com, ning.sun@intel.com, julien.grall@arm.com, jbeulich@suse.com, qiaowei.ren@intel.com, gang.wei@intel.com, fu.wei@linaro.org Subject: Re: [Xen-devel] [PATCH v16 4/9] x86: add multiboot2 protocol support for EFI platforms 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 On Tue, Feb 21, 2017 at 08:19:53PM +0100, Daniel Kiper wrote: > This way Xen can be loaded on EFI platforms using GRUB2 and > other boot loaders which support multiboot2 protocol. > > Signed-off-by: Daniel Kiper > --- > v16 - suggestions/fixes: > - improve comments in error handling > (suggested by Jan Beulich). Diff between v15 and v16: diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 6352142..a2177c3 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -133,16 +133,30 @@ not_multiboot: mov $(sym_phys(.Lbad_ldr_msg)),%esi # Error message jmp .Lget_vtb .Lmb2_no_st: + /* + * Here we are on EFI platform. vga_text_buffer was zapped earlier + * because there is pretty good chance that VGA is unavailable. + */ mov $(sym_phys(.Lbad_ldr_nst)),%esi # Error message jmp .Lget_vtb .Lmb2_no_ih: + /* Ditto. */ mov $(sym_phys(.Lbad_ldr_nih)),%esi # Error message jmp .Lget_vtb .Lmb2_no_bs: + /* + * Ditto. Additionally, here there is a chance that Xen was started + * via start label. Then reliable vga_text_buffer zap is impossible + * in Multiboot2 scanning loop and we have to zero %edi below. + */ mov $(sym_phys(.Lbad_ldr_nbs)),%esi # Error message xor %edi,%edi # No VGA text buffer jmp .Lsend_chr .Lmb2_efi_ia_32: + /* + * Here we are on EFI IA-32 platform. Then reliable vga_text_buffer zap is + * impossible in Multiboot2 scanning loop and we have to zero %edi below. + */ mov $(sym_phys(.Lbad_efi_msg)),%esi # Error message xor %edi,%edi # No VGA text buffer jmp .Lsend_chr @@ -393,18 +407,10 @@ __start: /* EFI IA-32 platforms are not supported. */ cmpl $MULTIBOOT2_TAG_TYPE_EFI32,MB2_tag_type(%ecx) - /* - * Here we should zap vga_text_buffer. However, we can disable - * VGA updates in simpler and more reliable way later. - */ je .Lmb2_efi_ia_32 /* Bootloader shutdown EFI x64 boot services. */ cmpl $MULTIBOOT2_TAG_TYPE_EFI64,MB2_tag_type(%ecx) - /* - * Here we should zap vga_text_buffer. However, we can disable - * VGA updates in simpler and more reliable way later. - */ je .Lmb2_no_bs /* Is it the end of Multiboot2 information? */