xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
	george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, tim@xen.org, julien.grall@arm.com,
	jbeulich@suse.com, tamas.k.lengyel@gmail.com
Subject: [PATCH v2 5/8] xen/x86: add some addresses to the Multiboot2 header
Date: Tue, 19 Jun 2018 16:35:43 +0200	[thread overview]
Message-ID: <1529418946-30114-6-git-send-email-daniel.kiper@oracle.com> (raw)
In-Reply-To: <1529418946-30114-1-git-send-email-daniel.kiper@oracle.com>

In comparison to ELF the PE format is not supported by the Multiboot2
protocol. So, if we wish to load xen.mb.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 to make the header more readable.

The Multiboot2 protocol spec can be found at
  https://www.gnu.org/software/grub/manual/multiboot2/

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
v2 - suggestions/fixes:
   - add the pointer to the Multiboot2 protocol spec to the commit message
     (suggested by Konrad Rzeszutek Wilk),
   - improve commit message
     (suggested by Konrad Rzeszutek Wilk).
---
 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 3ed43d9..582dc51 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -245,6 +245,13 @@ multiboot2_header:
         /* 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), /* 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. */ \
@@ -252,6 +259,14 @@ multiboot2_header:
                    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
@@ -265,10 +280,6 @@ multiboot2_header:
         /* 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:
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-06-19 14:36 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 14:35 [PATCH v2 0/8] Change xen.efi build and add SHIM_LOCK verification into efi_multiboot2() Daniel Kiper
2018-06-19 14:35 ` [PATCH v2 1/8] xen: calculate XEN_BUILD_TIME using XEN_BUILD_DATE value Daniel Kiper
2018-06-25 13:48   ` Jan Beulich
2018-07-04 12:06     ` Daniel Kiper
2018-07-04 13:58       ` Ian Jackson
2018-07-04 14:39         ` Daniel Kiper
2018-07-04 15:41           ` Ian Jackson
2018-07-04 15:51             ` Roger Pau Monné
2018-07-04 16:07             ` Daniel Kiper
2018-07-04 16:30               ` Ian Jackson
2018-07-04 16:55                 ` Daniel Kiper
2018-06-19 14:35 ` [PATCH v2 2/8] xen: introduce XEN_COMPILE_POSIX_TIME Daniel Kiper
2018-06-25 13:54   ` Jan Beulich
2018-06-25 14:00     ` Andrew Cooper
2018-07-04 12:19       ` Daniel Kiper
2018-06-19 14:35 ` [PATCH v2 3/8] xen/x86: manually build xen.mb.efi binary Daniel Kiper
2018-06-25 15:36   ` Jan Beulich
2018-07-04 14:01     ` Daniel Kiper
2018-07-04 15:27       ` Jan Beulich
2018-07-04 16:35         ` Daniel Kiper
2018-07-05  8:18           ` Jan Beulich
2018-07-06 14:02             ` Daniel Kiper
2018-07-06 15:08               ` Jan Beulich
2018-07-10 10:48                 ` Daniel Kiper
2018-07-10 13:54                   ` Jan Beulich
2018-07-11 11:41                     ` Daniel Kiper
     [not found]                       ` <5B45ECF8020000FA04BD1FEB@prv1-mh.provo.novell.com>
2018-07-11 12:26                         ` Jan Beulich
2018-07-12 10:52                           ` Daniel Kiper
     [not found]                             ` <5B4733110200007F03CC3F14@prv1-mh.provo.novell.com>
2018-07-12 11:50                               ` Jan Beulich
2018-06-19 14:35 ` [PATCH v2 4/8] xen/x86: add some addresses to the Multiboot header Daniel Kiper
2018-06-28 13:41   ` Jan Beulich
2018-06-19 14:35 ` Daniel Kiper [this message]
2018-06-28 13:42   ` [PATCH v2 5/8] xen/x86: add some addresses to the Multiboot2 header Jan Beulich
2018-06-19 14:35 ` [PATCH v2 6/8] efi: split out efi_shim_lock() Daniel Kiper
2018-06-28 13:43   ` Jan Beulich
2018-06-19 14:35 ` [PATCH v2 7/8] xen/x86/efi: Verify dom0 kernel with SHIM_LOCK protocol in efi_multiboot2() Daniel Kiper
2018-06-28 13:48   ` Jan Beulich
2018-06-19 14:35 ` [PATCH v2 8/8] efi: drop original xen.efi code and build mechanism Daniel Kiper
2018-06-28 13:51   ` Jan Beulich
2018-07-04 14:25     ` Daniel Kiper
2018-07-04 15:34       ` Jan Beulich
2018-07-04 16:48         ` Daniel Kiper
2018-07-05  8:35           ` Jan Beulich
2018-07-06 14:46             ` Daniel Kiper
2018-07-06 15:16               ` Jan Beulich
2018-07-10 11:35                 ` Daniel Kiper
2018-07-10 14:05                   ` Jan Beulich
2018-07-11 11:57                     ` Daniel Kiper
     [not found]                       ` <5B45F0CD0200007F03CB4495@prv1-mh.provo.novell.com>
2018-07-11 12:33                         ` Jan Beulich
2018-07-12 10:57                           ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529418946-30114-6-git-send-email-daniel.kiper@oracle.com \
    --to=daniel.kiper@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tamas.k.lengyel@gmail.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).