Re: [PATCH v4 18/27] xen: Adapt assembly for PIE support

From: Thomas Garnier
Date: Fri Jun 01 2018 - 11:53:38 EST


On Fri, Jun 1, 2018 at 8:40 AM Boris Ostrovsky
<boris.ostrovsky@xxxxxxxxxx> wrote:
>
> On 05/29/2018 06:15 PM, Thomas Garnier wrote:
> > diff --git a/arch/x86/xen/xen-pvh.S b/arch/x86/xen/xen-pvh.S
> > index ca2d3b2bf2af..82ba89ba8bb3 100644
> > --- a/arch/x86/xen/xen-pvh.S
> > +++ b/arch/x86/xen/xen-pvh.S
> > @@ -114,8 +114,8 @@ ENTRY(pvh_start_xen)
> > call xen_prepare_pvh
> >
> > /* startup_64 expects boot_params in %rsi. */
> > - mov $_pa(pvh_bootparams), %rsi
> > - mov $_pa(startup_64), %rax
> > + movabs $_pa(pvh_bootparams), %rsi
> > + movabs $_pa(startup_64), %rax
> > jmp *%rax
> >
> > #else /* CONFIG_X86_64 */
> > @@ -161,10 +161,15 @@ END(pvh_start_xen)
> >
> > .section ".init.data","aw"
> > .balign 8
> > + /*
> > + * Use a quad for _pa(gdt_start) because PIE does not understand a
> > + * long is enough. The resulting value will still be in the lower long
> > + * part.
> > + */
> > gdt:
> > .word gdt_end - gdt_start
> > - .long _pa(gdt_start)
> > - .word 0
> > + .quad _pa(gdt_start)
>
>
> With this becoming .quad 32-bit compilation fails:
>
> /data/root/linux/arch/x86/xen/xen-pvh.S: Assembler messages:
> /data/root/linux/arch/x86/xen/xen-pvh.S:147: Error: cannot represent
> relocation type BFD_RELOC_64

Thanks, I will look to fix this in the next patch set and run a full
32-bit build.

>
>
> -boris
>
>
> > + .balign 8
> > gdt_start:
> > .quad 0x0000000000000000 /* NULL descriptor */
> > #ifdef CONFIG_X86_64
>


--
Thomas