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

Re: [PATCH 00/21] x86: Trenchboot Secure Launch DRTM (Xen)



On Thu, Apr 24, 2025 at 07:51:21PM +0100, Andrew Cooper wrote:
> On 24/04/2025 7:47 pm, Sergii Dmytruk wrote:
> >> Alignment that large is unexpected, and I suspect we want to fix it.  Is
> >> it pre-existing, or something introduced by your series?
> >>
> >> ~Andrew
> > Pre-existing one.  I can see `-N` is already passed to `ld`:
> >
> > -N, --omagic     Do not page align data, do not make text readonly
> >
> > Specifying `--section-alignment 512 --file-alignment 512 --nmagic`
> > didn't reduce the alignment.  Statistics so far:
> >
> >   Give 0x1000 offset:
> >   GNU ld (GNU Binutils for Debian) 2.31.1
> >   GNU ld version 2.38-27.fc37
> >
> >   Give 0x440 offset:
> >   GNU ld (GNU Binutils for Debian) 2.40
> >   GNU ld (GNU Binutils for Debian) 2.41
> >
> > Maybe that's not something configurable and just needs a newer version.
>
> Ah - that's something that was changed literally yesterday:
>
> https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=d444763f8ca556d0a67a4b933be303d346baef02
>
> in order to fix some problems we've had trying to get xen.efi happy to
> be NX_COMPAT.
>
> We couldn't identify any good reason why -N was in use.
>
> ~Andrew

The fewer cryptic flags the better, but adding either of those flags or
removing -N doesn't affect the file offset.  EFI_LDFLAGS even includes
--file-alignment=0x20, it just gets ignored and that could be
target-specific behaviour in older versions of ld.  This commit by Jan
Beulich might be the one fixing it:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bc5baa9f13ffb3fd4c39f1a779062bfb3a980cea



 


Rackspace

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