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

Re: [PATCH 3/6] x86/efi: discard .text.header for PE binary


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Thu, 4 Jun 2026 15:53:35 +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=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=IkBbANetMCxqghNRXbWF8j+PjDLKAZbWvRSqS5GrfpU=; fh=38FPawrv/CpM0hOVM3+pacaNsP8K3Kcq1eyRmzZWXeE=; b=FqEeFb/gdzsuldwviqmjpCTENFQNOkJC3bngwGJII69tPVg77wKEnHcJ8XzUmSw/ak pvbUSmueZRutaDakiCqWoe9LP+SBQcqv2yMhcDrZhj4W4bZLPpi/RQHlpIOsSUmHtPhK NFDchcXaprqfa6NKXJ+UfJrLeiQTWXDJH87kRoaXMR+jiFguloh83ZatqxgUUD3sqAr5 hZEyCuFYQYNTNPGr8FI9tt5jSKuJwCocv/+2r0imZRnBUN5SoZ1tdSp/66nkKMOYnB0n AxoLqmYzFt5hwC+2ujDCvMpPQYOjRT0gIuSdsgdpt0hbPq8gIMqA0rQ3qUtN9HrQbjHb YEqg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1780584827; cv=none; d=google.com; s=arc-20240605; b=QDFhCY6zO8w5A80Yu7eOs9ZuHM2MwJ2Ae4rI5QIkcD16tKaFpesXoenBd2cQT8iaKO P5WZZQqlENodxlAqraE21rkXfS0e+BE5BUnYKwn4+gkKc5QUxGL756+d8KQGPUHH/a1Y wwp1z4d3LULqUlbfqL67ogTp/hj3gciMHv7h1PCpDqG3h+oHUs1pIMRbpwH0I5tSbrbp VOKIx/ReAbOwleoFggV7KVOaAO18Qv3TE7zUMlrTr28ojsgMpCtg64iA/VflXOXgjEHa wHIvsM+6Dc+UheJZmp1JNw8pnbEI+aIiVST+reslXT4mh8HnMPtKvjb4FfYVS7f+qe6O sZ0A==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 04 Jun 2026 14:54:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, 4 Jun 2026 at 15:31, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>
> On 04/06/2026 11:28 am, Frediano Ziglio wrote:
> > On Tue, 2 Jun 2026 at 13:15, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> >>> --- a/xen/arch/x86/xen.lds.S
> >>> +++ b/xen/arch/x86/xen.lds.S
> >>> @@ -57,6 +57,9 @@ SECTIONS
> >>>    __image_base__ = .;
> >>>  #else
> >>>    . = __image_base__;
> >>> +  /DISCARD/ : {
> >>> +    *(.text.header)
> >>> +  }
> >>>  #endif
> >> We already have DISCARD_SECTIONS, so I think it needs clarifying why that
> >> can't be used / extended.
> >>
> > Yes, this can be done that way. Roger, do you agree on this ?
>
> You'll need to add a general ARCH_DISCARD_SECTIONS, and have x86 fill in
> {ELF,EFI}_DISCARD_SECTIONS conditionally.
>

I think binutils simply ignore sections not present so this is not
necessary. I'll test it.

> Also you need to fold this hunk.
>
> diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst 
> b/docs/hypervisor-guide/x86/how-xen-boots.rst
> index 8b3229005cca..b6d852050a0c 100644
> --- a/docs/hypervisor-guide/x86/how-xen-boots.rst
> +++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
> @@ -82,12 +82,6 @@ When a PEI-capable toolchain is found, the objects are 
> linked together and a
>  PE32+ binary is created.  It can be run directly from the EFI shell, and has
>  ``efi_start`` as its entry symbol.
>
> -.. note::
> -
> -   xen.efi does contain all MB1/MB2/PVH tags included in the rest of the
> -   build.  However, entry via anything other than the EFI64 protocol is
> -   unsupported, and won't work.
> -
>
>  Boot
>  ----
>

Sure, thanks

>
>
> ~Andrew

Frediano



 


Rackspace

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