[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/5] xen/x86: add some addresses to the Multiboot2 header


  • To: Bobby Eshleman <bobbyeshleman@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 23 Feb 2021 10:04:56 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b08gw1GSwvJDwx5bQPJTl/PIeuA89t3a/v8ZhfhOjow=; b=jWx8IFLC+szq8Cmn6a5OEy/koO0G1+hrFr4aPHC5WNlINKcoVwQ0irKyUxNdNy9nKCnphAi0BGLlvRuSYNTX7GYIb2UsU60s/UIlkkZPPpEiYCSrk4gKmNJBjsqDE63JmVWgao2ivxLjWQamkMzmGQp/sxNZeaISonWrx0JdTChwk10vk6sUDE0JxXjUPX1Jbi/1F72AROiV/W7hBp1Y6mpo2rhJ3nMOSucLLvQHhHp3k5lvbJnXCuaK1gd3/v78lXgkMu1bvkQldkli97RBh+b2IMDtiorN1Gi0mP8DzY2kSPGmjscLY0Q529PlgSrIgF7nhyGYAU6eRJ6toh4aOw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZ78wjoxlwjq4LVSgD3JDXqLM6Vh9+Ix3GF1Ozue7iYjZqUmLHAR1aO8vRLvG17cT32Vj2F0mCcVKpvKyDv3r5aNEEx+tnIdW5XgnAPLo77rWCE4BFgS2TL0J+52VydapOZsE5NeUYnk7H4vVYuxE+wAoDmgH8ZFfQ8hW3ko0HCH8gq/q9J5EjyaESTZQIAIgL2i9CNPhNzCOnAejxiarHBlnX4/UcZjIl+QUnb9qfblD5Z9EPWt3PwT4hjwtNYAzQ9FvLWyXuLbWMkP9I21pG2sTcqp8c4riSkAr+g9PFmDrv4JmCIWS1Ctt7uHrBJalJ8cRZw5dJM4PtvhO/DEXA==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Daniel Kiper <daniel.kiper@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 23 Feb 2021 09:05:09 +0000
  • Ironport-sdr: M/I3PTqTXbnsMlA8ezvsCFtjpmQH85JW5dnmNQgkH6rTlMCB3qNQF3IcNp6QNqyQRERTAQieM9 h0+s9ik0kTbyk+OumtIsgQv/alufkHp4UL974mxwpPHnPrr7wEgt8tJ69ONZmCjcyd8z2nTZdV 0Or5PM3pvluROWX0jeaMWsy+kXT2ZEyD0rbhKdvubGt51U1HJhN0xJ4SImGtSPlAfcd0IDFuVI haP3ohV2KzL9YwotInHdTdea6y0wkQcQelxkMaiTwr0rCw1+rnm8HzoSlqrflX+kmWtslrYhxs 42g=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jan 21, 2021 at 04:51:43PM -0800, Bobby Eshleman wrote:
> From: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Signed-off-by: Bobby Eshleman <bobbyeshleman@xxxxxxxxx>
> ---
>  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 189d91a872..f2edd182a5 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -94,6 +94,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 */

Shouldn't this only be present when a PE binary is built?

You seem to unconditionally add this to the header, even when the
resulting binary will be in ELF format?

According to the spec: "This information does not need to be provided
if the kernel image is in ELF format", and hence Xen shouldn't require
the loader to understand this tag unless it's strictly required, as
the presence of the tag forces the bootloader to use the presented
information in order to load the kernel, regardless of the underlying
binary format.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.