Thread (4 messages) flat view 4 messages, 3 authors, 2017-03-08

Re: [kernel] powerpc/powernv: Fix clobbered MSR

From: Michael Ellerman <hidden>
Date: 2017-03-08 07:25:56

On Thu, 2017-03-02 at 06:41:24 UTC, Alexey Kardashevskiy wrote:
If CONFIG_DEBUG_INFO_SPLIT is not set but CONFIG_DEBUG_INFO is,
the kernel makefile just adds "-g" and the scripts/gcc-goto.sh test for
the "asm goto ("" :::: entry)" support succedes and adds
-DCC_HAVE_ASM_GOTO to KBUILD_CFLAGS/KBUILD_AFLAGS. This effectively
makes OPAL_BRANCH() a noop (or something similar).

With CONFIG_DEBUG_INFO_SPLIT=y, the makefile adds "-gsplit-dwarf" which
somehow makes the scripts/gcc-goto.sh test fail and not have
CC_HAVE_ASM_GOTO defined so the alternative OPAL_BRANCH() is used
and this particular chunk clobbers r12 where the parenting code -
OPAL_CALL() - stores MSR; as the result, the kernel oops'es right after
early_setup() because of broken MSR.

This replaces r12 with r11 which is overwritten right after
OPAL_BRANCH(opal_tracepoint_entry) anyway.

I used gcc 5.4.1 20161205 built from sha1 ffadbf3ae29.

Fixes: ab9bad0ead9a ("powerpc/powernv: Remove separate entry for OPAL real mode calls")
Suggested-by: Paul Mackerras <redacted>
Signed-off-by: Alexey Kardashevskiy <redacted>
Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/2a9c4f40ab2c281f95d41577ff0f7f

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help