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

Re: [PATCH v3 2/5] xen/x86: manually build xen.mb.efi binary


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
  • Date: Tue, 18 May 2021 19:46:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.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=OknAS0Vku0/6NWsRPI/c0PQqhkBgugDVL1iba7WFc74=; b=UC7jVtZl64T4tjAko0GVk8Nrik93JEtzypy2mgZ7+suQ52REH+lTjm8VrI2Le9vKv2TnK0a1rCdWi49cnsjTG2bAIz3KRQtRNgkS2YWBsJLs8G137AS5FlnKxQKZszv0PqfjQdaVPxPmj78pchCZeMsueVwJ7SQ0pzNrXBFxrpZNF0sJ8X8OJidul5VV7myeSa2dAGYb03tUa6CZ2W/YTQWgMS/e+UqTynL6L8lhXYEGdLyBqL+V6MIXMNq6ijb3BXkSi+Yati7Bv4Dgz5tJJxWSy5bmUo1UvmaYLvzAoup1H7XvJM4W3S3uz/muzUi6Mw1DUD9hlvy6BwnTOG3L6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHyUTXKj+QHcDpUTvANI9v6SpQyem0xaWF71+jn/pXxYi82Aj+O9ONIDqn/iGslwPTnU4cmQ23k+8qLkpc64wKGkR0gaKE8I0kBr4qmIyjbop7AyuDwRmbqbHHusnfyH4t0iKC9q9bNtdhmbx+RnqPEbUnsD8REAy0YXTqzC3JmC4fSyAf80lgvUHzCOpePwK/Btg4epB7dumwEwj76BuVgrQzuXEw+2/qfzJOSlaYu4BdTzGUPtB+gIHNJOQ+JdUbyffPrrbIzkJnVCJcQmn46WLN+U1xox4Aug7EpeumpLxziFb0KpvGJZldK7Uq/JF3Knc8EnKQ/sVzlaLqOP7Q==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=oracle.com;
  • Cc: Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 18 May 2021 17:47:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, May 17, 2021 at 03:24:28PM +0200, Jan Beulich wrote:
> On 17.05.2021 15:20, Daniel Kiper wrote:
> > On Mon, May 17, 2021 at 08:48:32AM +0200, Jan Beulich wrote:
> >> On 07.05.2021 22:26, Bob Eshleman wrote:
> >>> What is your intuition WRT the idea that instead of trying add a PE/COFF 
> >>> hdr
> >>> in front of Xen's mb2 bin, we instead go the route of introducing valid 
> >>> mb2
> >>> entry points into xen.efi?
> >>
> >> At the first glance I think this is going to be less intrusive, and hence
> >> to be preferred. But of course I haven't experimented in any way ...
> >
> > When I worked on this a few years ago I tried that way. Sadly I failed
> > because I was not able to produce "linear" PE image using binutils
> > exiting that days.
>
> What is a "linear" PE image?

The problem with Multiboot family protocols is that all code and data
sections have to be glued together in the image and as such loaded into
the memory (IIRC BSS is an exception but it has to live behind the
image). So, you cannot use PE image which has different representation
in file and memory. IIRC by default at least code and data sections in
xen.efi have different sizes in PE file and in memory. I tried to fix
that using linker script and objcopy but it did not work. Sadly I do
not remember the details but there is pretty good chance you can find
relevant emails in Xen-devel archive with me explaining what kind of
problems I met.

> > Maybe
> > newer binutils are more flexible and will be able to produce a PE image
> > with properties required by Multiboot2 protocol.
>
> Isn't all you need the MB2 header within the first so many bytes of the
> (disk) image? Or was it the image as loaded into memory? Both should be
> possible to arrange for.

IIRC Multiboot2 protocol requires the header in first 32 kiB of an image.
So, this is not a problem.

Daniel



 


Rackspace

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