Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread David Woodhouse
On Wed, 2017-08-02 at 09:16 -0600, Jan Beulich wrote: > > Well, I've seen breakage in all sorts of places I wouldn't have expected > anyone to fine a need to fiddle with. This is the nature of 'value subtract', I suppose.  How about something like this? Somewhat complicated by the fact that

Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread Jan Beulich
>>> David Woodhouse 08/02/17 4:45 PM >>> >On Wed, 2017-08-02 at 07:58 -0600, Jan Beulich wrote: >> > > > David Woodhouse 08/02/17 2:11 PM >>> >> > This change is sufficient (we believe) to make EFI builds of Xen >> > actually boot again on current EDK2,

Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread David Woodhouse
On Wed, 2017-08-02 at 07:58 -0600, Jan Beulich wrote: > > > > David Woodhouse 08/02/17 2:11 PM >>> > > This change is sufficient (we believe) to make EFI builds of Xen > > actually boot again on current EDK2, is it not? > > It is safe / sufficient only with the specific

Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread Jan Beulich
>>> David Woodhouse 08/02/17 2:11 PM >>> >On Wed, 2017-08-02 at 05:56 -0600, Jan Beulich wrote: >> > > > David Woodhouse 08/02/17 1:30 PM >>> >> > --- a/xen/arch/x86/efi/efi-boot.h >> > +++ b/xen/arch/x86/efi/efi-boot.h >> > @@ -87,7 +87,8 @@ static void

Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread David Woodhouse
On Wed, 2017-08-02 at 05:56 -0600, Jan Beulich wrote: > > > > > > > > > > > > > David Woodhouse 08/02/17 1:30 PM >>> > > --- a/xen/arch/x86/efi/efi-boot.h > > +++ b/xen/arch/x86/efi/efi-boot.h > > @@ -87,7 +87,8 @@ static void __init efi_arch_relocate_image(unsigned long

Re: [Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread Jan Beulich
>>> David Woodhouse 08/02/17 1:30 PM >>> >--- a/xen/arch/x86/efi/efi-boot.h >+++ b/xen/arch/x86/efi/efi-boot.h >@@ -87,7 +87,8 @@ static void __init efi_arch_relocate_image(unsigned long >delta) >case PE_BASE_RELOC_DIR64: >if ( in_page_tables(addr) ) >blexit(L"Unexpected

[Xen-devel] [PATCH] x86/efi: Do not write relocations in efi_arch_relocate_image() first pass

2017-08-02 Thread David Woodhouse
The function is invoked with delta=0 before ExitBootServices() is called, as a dummy run purely to validate that all the relocations can be handled. This allows us to exit gracefully with an error message. However, we have relocations in read-only sections such as .rodata and .init.te(xt). Recent