Subject: Re: [v2] ppc64/book3s: fix branching to out of line handlers in relocation kernel

From: Michael Ellerman <[email-masked]>
Date: Wed, 30 Mar 2016 22:17:23 +1100

On Wed, 2016-03-30 at 13:14 +0530, Hari Bathini wrote:
> 
> Alternatively, how about moving the OOLs handlers that can't be branched with
> LOAD_HANDLER under __end_interrupts. This way we won't be copying more than a
> few absolutely needed handlers.
> 
> STD_RELON_EXCEPTION_HV_OOL(0xe40, emulation_assist)
> .
> .
> STD_RELON_EXCEPTION_HV_OOL(0xf80, hv_facility_unavailable)
> 
> 
> We can leave __end_handlers marker to indicate code that should be part 
> of the first 64K of kernel image.

That might work. But I suspect you will run into issues with ".org backwards",
ie. running out of space in head_64.S

But try it and let me know if it works.

I think we also need to write a script or little C program which looks at the
vmlinux and checks that nothing below __end_whatever does a direct branch. So
that we don't break it again in future.

cheers