Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-19 Thread Ard Biesheuvel
_ > From: Jake Garver > Sent: Wednesday, December 13, 2023 2:47 PM > To: Pedro Falcato ; Ard Biesheuvel > Cc: devel@edk2.groups.io ; rebe...@bsdio.com > ; gaolim...@byosoft.com.cn ; > bob.c.f...@intel.com ; yuwei.c...@intel.com > > Subject: Re: [edk2-devel] [PATCH

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-19 Thread Jake Garver via groups.io
c: devel@edk2.groups.io ; rebe...@bsdio.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP Fantastic! When we hit this in GCC 12.3 toolchain, the ADR was indeed at a 0xffc page offset.

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-13 Thread Jake Garver via groups.io
devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP External email: Use caution opening links or attachments On Wed, Dec 13, 2023 at 5:31 PM Ard Biesheuvel wrote: > > On Wed, 13 Dec 2023 at 15:58, Jake Garver wrote: > > > > Totally understand and agree, Ar

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-13 Thread Pedro Falcato
On Wed, Dec 13, 2023 at 5:31 PM Ard Biesheuvel wrote: > > On Wed, 13 Dec 2023 at 15:58, Jake Garver wrote: > > > > Totally understand and agree, Ard. > > > > In the meantime, I've now experienced the issue with Ubuntu22's GCC 12.3. > > Originally, we didn't see the issue on this toolchain, but

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-13 Thread Ard Biesheuvel
On Wed, 13 Dec 2023 at 15:58, Jake Garver wrote: > > Totally understand and agree, Ard. > > In the meantime, I've now experienced the issue with Ubuntu22's GCC 12.3. > Originally, we didn't see the issue on this toolchain, but a developer ran > into when preparing a change. Even more concernin

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-13 Thread Jake Garver via groups.io
__ From: Ard Biesheuvel Sent: Tuesday, December 12, 2023 4:22 AM To: Jake Garver Cc: Pedro Falcato ; devel@edk2.groups.io ; rebe...@bsdio.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Ch

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-12 Thread Ard Biesheuvel
On Wed, 6 Dec 2023 at 17:51, Jake Garver wrote: > > Thanks, Pedro and Ard, > > An update on this issue: > > It seems to be very specific to Ubuntu20's 10.5 build of GCC. > I could not reproduce it using a crosstool-ng build of 10.5, even after > trying to configure it identically to Ubuntu20's.

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-12-06 Thread Jake Garver via groups.io
From: Pedro Falcato Sent: Thursday, November 2, 2023 8:47 AM To: Jake Garver Cc: Ard Biesheuvel ; devel@edk2.groups.io ; rebe...@bsdio.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converti

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-11-02 Thread Pedro Falcato
On Thu, Nov 2, 2023 at 11:47 AM Jake Garver wrote: > > Ard, Pedro, > > How would you like to proceed here? > > Do nothing. Treat it as a toolchain bug and not attempt a work-around. > Practically speaking, this means the Ubuntu20 container at > https://github.com/tianocore/containers cannot be

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-11-02 Thread Jake Garver via groups.io
o.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP Ard, Pedro, > Could you try adding -Wl,--no-relax to the DLINK_FLAGS for your build and see > if it makes a difference? With &quo

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Jake Garver via groups.io
___ From: Ard Biesheuvel Sent: Friday, October 27, 2023 10:43 AM To: Pedro Falcato Cc: devel@edk2.groups.io ; Jake Garver ; rebe...@bsdio.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Chang

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Ard Biesheuvel
On Fri, 27 Oct 2023 at 16:26, Pedro Falcato wrote: > > On Fri, Oct 27, 2023 at 3:13 PM Ard Biesheuvel wrote: > > > > On Fri, 27 Oct 2023 at 16:09, Jake Garver via groups.io > > wrote: > > > > > > Hi Ard: > > > > > > > Can you double check the object file? I suspect this is a linker > > > > rela

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Pedro Falcato
On Fri, Oct 27, 2023 at 3:13 PM Ard Biesheuvel wrote: > > On Fri, 27 Oct 2023 at 16:09, Jake Garver via groups.io > wrote: > > > > Hi Ard: > > > > > Can you double check the object file? I suspect this is a linker > > > relaxation not a compiler issue. > > > > With LTO in play, is there a way to

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Ard Biesheuvel
On Fri, 27 Oct 2023 at 16:09, Jake Garver via groups.io wrote: > > Hi Ard: > > > Can you double check the object file? I suspect this is a linker relaxation > > not a compiler issue. > > With LTO in play, is there a way to check the object file? It's not in > aarch64 assembly. > Perhaps not.

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Pedro Falcato
On Fri, Oct 27, 2023 at 3:09 PM Jake Garver via groups.io wrote: > > Hi Ard: > > > Can you double check the object file? I suspect this is a linker relaxation > > not a compiler issue. > > With LTO in play, is there a way to check the object file? It's not in > aarch64 assembly. Unless you pas

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Pedro Falcato
On Fri, Oct 27, 2023 at 2:47 PM Ard Biesheuvel wrote: > > Hello all, > > Apologies for the late response. > > On Fri, 27 Oct 2023 at 14:44, Jake Garver via groups.io > wrote: > > > > Thanks for your response, Pedro. > > > > I chased this as a toolchain bug originally, but concluded that the ADR

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Jake Garver via groups.io
October 27, 2023 9:46 AM To: devel@edk2.groups.io ; Jake Garver Cc: Pedro Falcato ; rebe...@bsdio.com ; gaolim...@byosoft.com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com ; ardb+tianoc...@kernel.org Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADR

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Ard Biesheuvel
9402bfb    ldr   x27, [sp, #80] > 31f8:   a8c77bfd    ldp   x29, x30, [sp], #112 > 31fc:   d65f03c0    ret > 3200:   14000400    b 4200 > 3204:   d503201f    nop > 3208:   f946cc00    ldr   x0, [x0, #3480] > 320c:   1780    b 300c > > Jake > ___

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-27 Thread Jake Garver via groups.io
com.cn ; bob.c.f...@intel.com ; yuwei.c...@intel.com ; ardb+tianoc...@kernel.org Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP External email: Use caution opening links or attachments On Thu, Oct 26, 2023 at 4:32 PM Jake Garver via groups.io wr

Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-26 Thread Pedro Falcato
On Thu, Oct 26, 2023 at 4:32 PM Jake Garver via groups.io wrote: > > In the R_AARCH64_ADR_GOT_PAGE case on AARCH64, be sure to change the > opcode to ADRP. Prior to this change, we updated the address, but not > the opcode. > > This resolves an issue experienced when building a StandaloneMm image

[edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP

2023-10-26 Thread Jake Garver via groups.io
In the R_AARCH64_ADR_GOT_PAGE case on AARCH64, be sure to change the opcode to ADRP. Prior to this change, we updated the address, but not the opcode. This resolves an issue experienced when building a StandaloneMm image with stack protection enabled on GCC 10.5. This scenario generates an ADR w