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

Re: [PATCH v2 2/4] x86/efi: discard multiboot support for PE binary


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Fri, 12 Jun 2026 08:55:33 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4WAhgM/bwj4Gunw+2eRNScB2cGhm25KSvmpb0zLwcjU=; fh=s2+nLqHBycqOi7ZA4ENoQVOPj02eSuGNAm2O5IHcq8w=; b=OJbswmarfAZCH8PLCTUaTzaAPgrTZzlrmPKbjte7t+gPbIY3hAgjlb2eIJsuQu2bzI bqXMFWAGagUIVdVaL8BtHizDsAPjP5W0ZHB5iOKtY8BMBhc22rDsQ+s26+ZMZ1PeJfTj FcR42URVHGW8T5hFTcFtEU7hBKz+hYmfvZ7IsmZ+nxtr373tKCgTS4T/yr7AX1VwRLh1 gDt1ieexeQvod7ynOWccnnZmgkeKLTw/OmQGzQS9yrxrS/fZ4BgmY3pyajyie+UuUm8z wQnR1Yps1RVAZn8hbThRrhCD0ObAs0ruZoMauul0qF6LQR3p83PDANcTMibvJyKwnPka 7S2g==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1781250946; cv=none; d=google.com; s=arc-20240605; b=hxWa6fIhUR1sJUPWl3sX5tAFRKO/OgxpnAXgV35ws31YBzx/SZZ01X2/VXlGlSbzfL MTXS30nwSpFsOoaEbXfw3rI2J5v8DlV2kxsRj+jFZxxweeK6b2IjaNoRbghqHOaRrDvZ 2O2286p0GQTwyDcjDw9ayPd11LflOazxJ32CEqUfECPTUqq/pVn8vw2iLnRaLegFhV8R rAaHv3EZ5nuEDpmhi3NUUIXbWHrCm5HpitrcGX6A8WAtm6kECDMQ8YpxIqkOXgnyxL/y CgNmKmZtmguY8WNYhtr95nw1y4DD5doN+GC98+Ogz5Quxeo//udXKbsxYrhxC5r9xfOL Mtpw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Frediano Ziglio <frediano.ziglio@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 12 Jun 2026 07:55:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, 12 Jun 2026 at 08:21, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 12.06.2026 01:31, Teddy Astie wrote:
> > Le 11/06/2026 à 17:33, Frediano Ziglio a écrit :
> >> From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> >>
> >> The multiboot headers (.text.header section) are not consumed in the PE
> >> binary, hence discard them in the linker script when doing a PE build.
> >>
> >> The multiboot and PVH entry points are not used in the PE binary, hence
> >> discard them in the linker script when doing a PE build.
> >>
> >
> > nit: it looks like both paragraph state the same thing
> >

This should be enough:

Multiboot and PVH booting are not supported for PE, hence
discards them in the linker script when doing a PE build.

> >> That removes some relocations that otherwise appear due to the usage of the
> >> start and __efi64_mb2_start symbols in the multiboot2 header.
> >>
> >> Section discarding is not done updating DISCARD_SECTIONS definition as the
> >> change is specific for x86.
> >>
> >> No functional change intended.
> >>
> >
> > Given that this now prevents booting using multiboot2 when using the PE
> > build, this is a functional change, even though it's strongly
> > discouraged (not officially supported).
> >
> > I would add a changelog entry to actually state this change (eventually
> > reminding that this was not actually supported anyway).
>
> Did that actually work though? If not, I wouldn't see a need for a ChangeLog
> entry.
>
> Jan

No, multiboot for PE never worked. I agree it's not needed.

Some more long explanations are in place. Multiboot headers and code
was always included in the PE file. Not as ever used but because the
code was common with ELF. Multiboot specifications include support for
a.out and ELF (and potentially some binary loading) and all boot
loaders (as far as I know) followed those specifications. Here at
XenServer we attempted to extend multiboot2 to support PE however at
the end we ditched for another solution (extending
xen_hypervisor/xen_module in grub) as more clean and simple. The
multiboot2 code was never attempted to be upstream in grub (so it was
only an internal PoC) while we intend to upstream the
xen_hypervisor/xen_module solution.

Frediano



 


Rackspace

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