From: Nicholas Piggin <npiggin@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y
Date: Mon, 8 Oct 2018 17:04:35 +1000 [thread overview]
Message-ID: <20181008170435.0ef2d573@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <e4bfa53ea8c777105359e1770df906909dde2c57.camel@kernel.crashing.org>
On Mon, 08 Oct 2018 15:08:31 +1100
Benjamin Herrenschmidt <benh@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@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. */
>
>
next prev parent reply other threads:[~2018-10-08 7:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 4:08 [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y Benjamin Herrenschmidt
2018-10-08 7:04 ` Nicholas Piggin [this message]
2018-10-08 9:53 ` Benjamin Herrenschmidt
2018-10-09 10:37 ` Michael Ellerman
2018-10-09 12:27 ` Benjamin Herrenschmidt
2018-12-23 13:28 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181008170435.0ef2d573@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).