From patchwork Sat Jul 8 21:53:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiper X-Patchwork-Id: 9831555 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 4B1B6602BD for ; Sat, 8 Jul 2017 21:56:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DB0027C2D for ; Sat, 8 Jul 2017 21:56:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3281F27F85; Sat, 8 Jul 2017 21:56:37 +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 D617C27C2D for ; Sat, 8 Jul 2017 21:56:36 +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 1dTxfm-0004AD-EN; Sat, 08 Jul 2017 21:53:54 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTxfk-00049c-Tq for xen-devel@lists.xenproject.org; Sat, 08 Jul 2017 21:53:53 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 9C/5C-02022-07451695; Sat, 08 Jul 2017 21:53:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeJIrShJLcpLzFFi42LpnVTnqpsfkhh pMGe/qsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmtE87wpLwX7himMXH7E3MO7l62Lk4hASaGeS 2P/zGzuE85lR4syZ0ywQzgZGif0d/5khnAmMEn/btwFlODnYBHQkLn55yA5iiwgoSdxbNZkJx GYW8JB4/2UWWFxYwFfi9vZ9jCA2i4CqxMPrz8HivALuEl1r34HNkRBQlOh+NoENxOYE6m1o/w VmCwHVPH56hhmixliib1YfywRGvgWMDKsY1YtTi8pSi3Qt9ZKKMtMzSnITM3N0DQ1M9XJTi4s T01NzEpOK9ZLzczcxAkOFAQh2MK5tdT7EKMnBpCTKK9abECnEl5SfUpmRWJwRX1Sak1p8iFGG g0NJgrctODFSSLAoNT21Ii0zBxi0MGkJDh4lEV6rr0CtvMUFibnFmekQqVOMuhyvJvz/xiTEk peflyolzqsBMkMApCijNA9uBCyCLjHKSgnzMgIdJcRTkFqUm1mCKv+KUZyDUUmYtzUIaApPZl 4J3KZXQEcwAR3BVgd2REkiQkqqgTH86wuvC1dvsvrLBvPynnSf8WG/0ur89f7xobmd0/j/t2r JbA55/z/h1Poo9xKrOwtLnqufaBSV/9MtZcLZuCGxv715kmKl3MJTEyPL+4J0Hzw3cCphfuq7 /4NEu8BDs3PuM+atPe4t5zTFVujixSWeXhOfbG7Pc3uxc9qHbwzv5Ss+NoVnblFiKc5INNRiL ipOBAAxg5LAmwIAAA== X-Env-Sender: daniel.kiper@oracle.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1499550829!82225525!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28765 invoked from network); 8 Jul 2017 21:53:51 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-11.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Jul 2017 21:53:51 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v68LrlTZ014921 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Jul 2017 21:53:47 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v68LrkY1003408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 8 Jul 2017 21:53:46 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v68LrkGn019900; Sat, 8 Jul 2017 21:53:46 GMT Received: from olila.local.net-space.pl (/10.175.230.11) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 08 Jul 2017 14:53:45 -0700 From: Daniel Kiper To: xen-devel@lists.xenproject.org Date: Sat, 8 Jul 2017 23:53:19 +0200 Message-Id: <1499550803-25664-5-git-send-email-daniel.kiper@oracle.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1499550803-25664-1-git-send-email-daniel.kiper@oracle.com> References: <1499550803-25664-1-git-send-email-daniel.kiper@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: andrew.cooper3@citrix.com, jbeulich@suse.com Subject: [Xen-devel] [PATCH RFC 4/7] xen/x86: Add some addresses to the Multiboot2 header 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP In comparison to ELF the PE format is not supported by the Multiboot2 protocol. So, if we wish to load xen.efi using this protocol we have to add MULTIBOOT2_HEADER_TAG_ADDRESS and MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS tags into Multiboot2 header. Additionally, put MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS and MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS_EFI64 tags close to each other. Signed-off-by: Daniel Kiper --- xen/arch/x86/boot/head.S | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S index 0c603a5..90db661 100644 --- a/xen/arch/x86/boot/head.S +++ b/xen/arch/x86/boot/head.S @@ -237,6 +237,13 @@ multiboot2_header_start: /* Align modules at page boundry. */ mb2ht_init MB2_HT(MODULE_ALIGN), MB2_HT(REQUIRED) + /* The address tag. */ + mb2ht_init MB2_HT(ADDRESS), MB2_HT(REQUIRED), \ + sym_offs(multiboot2_header_start), /* header_addr */ \ + sym_offs(start), /* load_addr */ \ + sym_offs(__bss_start), /* load_end_addr */ \ + sym_offs(__2M_rwdata_end) /* bss_end_addr */ + /* Load address preference. */ mb2ht_init MB2_HT(RELOCATABLE), MB2_HT(OPTIONAL), \ sym_offs(start), /* Min load address. */ \ @@ -244,6 +251,14 @@ multiboot2_header_start: 0x200000, /* Load address alignment (2 MiB). */ \ MULTIBOOT2_LOAD_PREFERENCE_HIGH + /* Multiboot2 entry point. */ + mb2ht_init MB2_HT(ENTRY_ADDRESS), MB2_HT(REQUIRED), \ + sym_offs(__start) + + /* EFI64 Multiboot2 entry point. */ + mb2ht_init MB2_HT(ENTRY_ADDRESS_EFI64), MB2_HT(OPTIONAL), \ + sym_offs(__efi64_mb2_start) + /* Console flags tag. */ mb2ht_init MB2_HT(CONSOLE_FLAGS), MB2_HT(OPTIONAL), \ MULTIBOOT2_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED @@ -257,10 +272,6 @@ multiboot2_header_start: /* Request that ExitBootServices() not be called. */ mb2ht_init MB2_HT(EFI_BS), MB2_HT(OPTIONAL) - /* EFI64 Multiboot2 entry point. */ - mb2ht_init MB2_HT(ENTRY_ADDRESS_EFI64), MB2_HT(OPTIONAL), \ - sym_offs(__efi64_mb2_start) - /* Multiboot2 header end tag. */ mb2ht_init MB2_HT(END), MB2_HT(REQUIRED) .Lmultiboot2_header_end: