[PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y
Nicholas Piggin
npiggin at gmail.com
Mon Oct 8 18:04:35 AEDT 2018
On Mon, 08 Oct 2018 15:08:31 +1100
Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
> HMIs will crash the kernel due to
>
> BRANCH_LINK_TO_FAR(hmi_exception_realmode)
>
> Calling into the OPD instead of the actual code.
>
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> ---
>
> This hack fixes it for me, but it's not great. Nick, any better idea ?
Is it a hack because the ifdef gunk, or because there's something
deeper wrong with using the .sym?
I guess all those handlers that load label address by hand could have
the bug silently creep in. Can we have them use the DOTSYM() macro?
Thanks,
Nick
>
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index ea04dfb..752709cc8 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -1119,7 +1119,11 @@ TRAMP_REAL_BEGIN(hmi_exception_early)
> EXCEPTION_PROLOG_COMMON_2(PACA_EXGEN)
> EXCEPTION_PROLOG_COMMON_3(0xe60)
> addi r3,r1,STACK_FRAME_OVERHEAD
> +#ifdef PPC64_ELF_ABI_v1
> + BRANCH_LINK_TO_FAR(.hmi_exception_realmode) /* Function call ABI */
> +#else
> BRANCH_LINK_TO_FAR(hmi_exception_realmode) /* Function call ABI */
> +#endif
> cmpdi cr0,r3,0
>
> /* Windup the stack. */
>
>
More information about the Linuxppc-dev
mailing list