Commit 1a2c73f4 authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Thomas Bogendoerfer

MIPS: Workaround clang inline compat branch issue

Clang is unable to handle the situation that a chunk of inline
assembly ends with a compat branch instruction and then compiler
generates another control transfer instruction immediately after
this compat branch. The later instruction will end up in forbidden
slot and cause exception.

Workaround by add a option to control the use of compact branch.
Currently it's selected by CC_IS_CLANG and hopefully we can change
it to a version check in future if clang manages to fix it.

Fix boot on boston board.

Link: https://github.com/llvm/llvm-project/issues/61045Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Acked-by: default avatarNathan Chancellor <nathan@kernel.org>
Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 70f864d1
...@@ -3200,6 +3200,10 @@ config CC_HAS_MNO_BRANCH_LIKELY ...@@ -3200,6 +3200,10 @@ config CC_HAS_MNO_BRANCH_LIKELY
def_bool y def_bool y
depends on $(cc-option,-mno-branch-likely) depends on $(cc-option,-mno-branch-likely)
# https://github.com/llvm/llvm-project/issues/61045
config CC_HAS_BROKEN_INLINE_COMPAT_BRANCH
def_bool y if CC_IS_CLANG
menu "Power management options" menu "Power management options"
config ARCH_HIBERNATION_POSSIBLE config ARCH_HIBERNATION_POSSIBLE
......
...@@ -336,7 +336,7 @@ symbol = value ...@@ -336,7 +336,7 @@ symbol = value
*/ */
#ifdef CONFIG_WAR_R10000_LLSC #ifdef CONFIG_WAR_R10000_LLSC
# define SC_BEQZ beqzl # define SC_BEQZ beqzl
#elif MIPS_ISA_REV >= 6 #elif !defined(CONFIG_CC_HAS_BROKEN_INLINE_COMPAT_BRANCH) && MIPS_ISA_REV >= 6
# define SC_BEQZ beqzc # define SC_BEQZ beqzc
#else #else
# define SC_BEQZ beqz # define SC_BEQZ beqz
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment