Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 4356e9f8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

work around gcc bugs with 'asm goto' with outputs

We've had issues with gcc and 'asm goto' before, and we created a
'asm_volatile_goto()' macro for that in the past: see commits
3f0116c3 ("compiler/gcc4: Add quirk for 'asm goto' miscompilation
bug") and a9f18034 ("compiler/gcc4: Make quirk for
asm_volatile_goto() unconditional").

Then, much later, we ended up removing the workaround in commit
43c249ea ("compiler-gcc.h: remove ancient workaround for gcc PR
58670") because we no longer supported building the kernel with the
affected gcc versions, but we left the macro uses around.

Now, Sean Christopherson reports a new version of a very similar
problem, which is fixed by re-applying that ancient workaround.  But the
problem in question is limited to only the 'asm goto with outputs'
cases, so instead of re-introducing the old workaround as-is, let's
rename and limit the workaround to just that much less common case.

It looks like there are at least two separate issues that all hit in
this area...
parent 9ed18b0b
No related merge requests found
Showing
with 46 additions and 46 deletions
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, static __always_inline bool arch_static_branch(struct static_key *key,
bool branch) bool branch)
{ {
asm_volatile_goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" asm goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n"
"1: \n" "1: \n"
"nop \n" "nop \n"
".pushsection __jump_table, \"aw\" \n" ".pushsection __jump_table, \"aw\" \n"
...@@ -47,7 +47,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, ...@@ -47,7 +47,7 @@ static __always_inline bool arch_static_branch(struct static_key *key,
static __always_inline bool arch_static_branch_jump(struct static_key *key, static __always_inline bool arch_static_branch_jump(struct static_key *key,
bool branch) bool branch)
{ {
asm_volatile_goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" asm goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n"
"1: \n" "1: \n"
"b %l[l_yes] \n" "b %l[l_yes] \n"
".pushsection __jump_table, \"aw\" \n" ".pushsection __jump_table, \"aw\" \n"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
WASM(nop) "\n\t" WASM(nop) "\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".word 1b, %l[l_yes], %c0\n\t" ".word 1b, %l[l_yes], %c0\n\t"
...@@ -25,7 +25,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -25,7 +25,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
WASM(b) " %l[l_yes]\n\t" WASM(b) " %l[l_yes]\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".word 1b, %l[l_yes], %c0\n\t" ".word 1b, %l[l_yes], %c0\n\t"
......
...@@ -229,7 +229,7 @@ alternative_has_cap_likely(const unsigned long cpucap) ...@@ -229,7 +229,7 @@ alternative_has_cap_likely(const unsigned long cpucap)
if (!cpucap_is_possible(cpucap)) if (!cpucap_is_possible(cpucap))
return false; return false;
asm_volatile_goto( asm goto(
ALTERNATIVE_CB("b %l[l_no]", %[cpucap], alt_cb_patch_nops) ALTERNATIVE_CB("b %l[l_no]", %[cpucap], alt_cb_patch_nops)
: :
: [cpucap] "i" (cpucap) : [cpucap] "i" (cpucap)
...@@ -247,7 +247,7 @@ alternative_has_cap_unlikely(const unsigned long cpucap) ...@@ -247,7 +247,7 @@ alternative_has_cap_unlikely(const unsigned long cpucap)
if (!cpucap_is_possible(cpucap)) if (!cpucap_is_possible(cpucap))
return false; return false;
asm_volatile_goto( asm goto(
ALTERNATIVE("nop", "b %l[l_yes]", %[cpucap]) ALTERNATIVE("nop", "b %l[l_yes]", %[cpucap])
: :
: [cpucap] "i" (cpucap) : [cpucap] "i" (cpucap)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static __always_inline bool arch_static_branch(struct static_key * const key, static __always_inline bool arch_static_branch(struct static_key * const key,
const bool branch) const bool branch)
{ {
asm_volatile_goto( asm goto(
"1: nop \n\t" "1: nop \n\t"
" .pushsection __jump_table, \"aw\" \n\t" " .pushsection __jump_table, \"aw\" \n\t"
" .align 3 \n\t" " .align 3 \n\t"
...@@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, ...@@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key,
static __always_inline bool arch_static_branch_jump(struct static_key * const key, static __always_inline bool arch_static_branch_jump(struct static_key * const key,
const bool branch) const bool branch)
{ {
asm_volatile_goto( asm goto(
"1: b %l[l_yes] \n\t" "1: b %l[l_yes] \n\t"
" .pushsection __jump_table, \"aw\" \n\t" " .pushsection __jump_table, \"aw\" \n\t"
" .align 3 \n\t" " .align 3 \n\t"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, static __always_inline bool arch_static_branch(struct static_key *key,
bool branch) bool branch)
{ {
asm_volatile_goto( asm goto(
"1: nop32 \n" "1: nop32 \n"
" .pushsection __jump_table, \"aw\" \n" " .pushsection __jump_table, \"aw\" \n"
" .align 2 \n" " .align 2 \n"
...@@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, ...@@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch(struct static_key *key,
static __always_inline bool arch_static_branch_jump(struct static_key *key, static __always_inline bool arch_static_branch_jump(struct static_key *key,
bool branch) bool branch)
{ {
asm_volatile_goto( asm goto(
"1: bsr32 %l[label] \n" "1: bsr32 %l[label] \n"
" .pushsection __jump_table, \"aw\" \n" " .pushsection __jump_table, \"aw\" \n"
" .align 2 \n" " .align 2 \n"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch)
{ {
asm_volatile_goto( asm goto(
"1: nop \n\t" "1: nop \n\t"
JUMP_TABLE_ENTRY JUMP_TABLE_ENTRY
: : "i"(&((char *)key)[branch]) : : l_yes); : : "i"(&((char *)key)[branch]) : : l_yes);
...@@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, co ...@@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, co
static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch)
{ {
asm_volatile_goto( asm goto(
"1: b %l[l_yes] \n\t" "1: b %l[l_yes] \n\t"
JUMP_TABLE_ENTRY JUMP_TABLE_ENTRY
: : "i"(&((char *)key)[branch]) : : l_yes); : : "i"(&((char *)key)[branch]) : : l_yes);
......
...@@ -39,7 +39,7 @@ extern void jump_label_apply_nops(struct module *mod); ...@@ -39,7 +39,7 @@ extern void jump_label_apply_nops(struct module *mod);
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\t" B_INSN " 2f\n\t" asm goto("1:\t" B_INSN " 2f\n\t"
"2:\t.insn\n\t" "2:\t.insn\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
WORD_INSN " 1b, %l[l_yes], %0\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t"
...@@ -53,7 +53,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -53,7 +53,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\t" J_INSN " %l[l_yes]\n\t" asm goto("1:\t" J_INSN " %l[l_yes]\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
WORD_INSN " 1b, %l[l_yes], %0\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t"
".popsection\n\t" ".popsection\n\t"
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"nop\n\t" "nop\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".align %1\n\t" ".align %1\n\t"
...@@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"b,n %l[l_yes]\n\t" "b,n %l[l_yes]\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".align %1\n\t" ".align %1\n\t"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"nop # arch_static_branch\n\t" "nop # arch_static_branch\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".long 1b - ., %l[l_yes] - .\n\t" ".long 1b - ., %l[l_yes] - .\n\t"
...@@ -32,7 +32,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -32,7 +32,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"b %l[l_yes] # arch_static_branch_jump\n\t" "b %l[l_yes] # arch_static_branch_jump\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
".long 1b - ., %l[l_yes] - .\n\t" ".long 1b - ., %l[l_yes] - .\n\t"
......
...@@ -74,7 +74,7 @@ __pu_failed: \ ...@@ -74,7 +74,7 @@ __pu_failed: \
/* -mprefixed can generate offsets beyond range, fall back hack */ /* -mprefixed can generate offsets beyond range, fall back hack */
#ifdef CONFIG_PPC_KERNEL_PREFIXED #ifdef CONFIG_PPC_KERNEL_PREFIXED
#define __put_user_asm_goto(x, addr, label, op) \ #define __put_user_asm_goto(x, addr, label, op) \
asm_volatile_goto( \ asm goto( \
"1: " op " %0,0(%1) # put_user\n" \ "1: " op " %0,0(%1) # put_user\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
: \ : \
...@@ -83,7 +83,7 @@ __pu_failed: \ ...@@ -83,7 +83,7 @@ __pu_failed: \
: label) : label)
#else #else
#define __put_user_asm_goto(x, addr, label, op) \ #define __put_user_asm_goto(x, addr, label, op) \
asm_volatile_goto( \ asm goto( \
"1: " op "%U1%X1 %0,%1 # put_user\n" \ "1: " op "%U1%X1 %0,%1 # put_user\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
: \ : \
...@@ -97,7 +97,7 @@ __pu_failed: \ ...@@ -97,7 +97,7 @@ __pu_failed: \
__put_user_asm_goto(x, ptr, label, "std") __put_user_asm_goto(x, ptr, label, "std")
#else /* __powerpc64__ */ #else /* __powerpc64__ */
#define __put_user_asm2_goto(x, addr, label) \ #define __put_user_asm2_goto(x, addr, label) \
asm_volatile_goto( \ asm goto( \
"1: stw%X1 %0, %1\n" \ "1: stw%X1 %0, %1\n" \
"2: stw%X1 %L0, %L1\n" \ "2: stw%X1 %L0, %L1\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
...@@ -146,7 +146,7 @@ do { \ ...@@ -146,7 +146,7 @@ do { \
/* -mprefixed can generate offsets beyond range, fall back hack */ /* -mprefixed can generate offsets beyond range, fall back hack */
#ifdef CONFIG_PPC_KERNEL_PREFIXED #ifdef CONFIG_PPC_KERNEL_PREFIXED
#define __get_user_asm_goto(x, addr, label, op) \ #define __get_user_asm_goto(x, addr, label, op) \
asm_volatile_goto( \ asm_goto_output( \
"1: "op" %0,0(%1) # get_user\n" \ "1: "op" %0,0(%1) # get_user\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
: "=r" (x) \ : "=r" (x) \
...@@ -155,7 +155,7 @@ do { \ ...@@ -155,7 +155,7 @@ do { \
: label) : label)
#else #else
#define __get_user_asm_goto(x, addr, label, op) \ #define __get_user_asm_goto(x, addr, label, op) \
asm_volatile_goto( \ asm_goto_output( \
"1: "op"%U1%X1 %0, %1 # get_user\n" \ "1: "op"%U1%X1 %0, %1 # get_user\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
: "=r" (x) \ : "=r" (x) \
...@@ -169,7 +169,7 @@ do { \ ...@@ -169,7 +169,7 @@ do { \
__get_user_asm_goto(x, addr, label, "ld") __get_user_asm_goto(x, addr, label, "ld")
#else /* __powerpc64__ */ #else /* __powerpc64__ */
#define __get_user_asm2_goto(x, addr, label) \ #define __get_user_asm2_goto(x, addr, label) \
asm_volatile_goto( \ asm_goto_output( \
"1: lwz%X1 %0, %1\n" \ "1: lwz%X1 %0, %1\n" \
"2: lwz%X1 %L0, %L1\n" \ "2: lwz%X1 %L0, %L1\n" \
EX_TABLE(1b, %l2) \ EX_TABLE(1b, %l2) \
......
...@@ -230,7 +230,7 @@ notrace __no_kcsan void arch_local_irq_restore(unsigned long mask) ...@@ -230,7 +230,7 @@ notrace __no_kcsan void arch_local_irq_restore(unsigned long mask)
* This allows interrupts to be unmasked without hard disabling, and * This allows interrupts to be unmasked without hard disabling, and
* also without new hard interrupts coming in ahead of pending ones. * also without new hard interrupts coming in ahead of pending ones.
*/ */
asm_volatile_goto( asm goto(
"1: \n" "1: \n"
" lbz 9,%0(13) \n" " lbz 9,%0(13) \n"
" cmpwi 9,0 \n" " cmpwi 9,0 \n"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
static __always_inline unsigned int __arch_hweight32(unsigned int w) static __always_inline unsigned int __arch_hweight32(unsigned int w)
{ {
#ifdef CONFIG_RISCV_ISA_ZBB #ifdef CONFIG_RISCV_ISA_ZBB
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
...@@ -51,7 +51,7 @@ static inline unsigned int __arch_hweight8(unsigned int w) ...@@ -51,7 +51,7 @@ static inline unsigned int __arch_hweight8(unsigned int w)
static __always_inline unsigned long __arch_hweight64(__u64 w) static __always_inline unsigned long __arch_hweight64(__u64 w)
{ {
# ifdef CONFIG_RISCV_ISA_ZBB # ifdef CONFIG_RISCV_ISA_ZBB
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
......
...@@ -39,7 +39,7 @@ static __always_inline unsigned long variable__ffs(unsigned long word) ...@@ -39,7 +39,7 @@ static __always_inline unsigned long variable__ffs(unsigned long word)
{ {
int num; int num;
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
...@@ -95,7 +95,7 @@ static __always_inline unsigned long variable__fls(unsigned long word) ...@@ -95,7 +95,7 @@ static __always_inline unsigned long variable__fls(unsigned long word)
{ {
int num; int num;
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
...@@ -154,7 +154,7 @@ static __always_inline int variable_ffs(int x) ...@@ -154,7 +154,7 @@ static __always_inline int variable_ffs(int x)
if (!x) if (!x)
return 0; return 0;
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
...@@ -209,7 +209,7 @@ static __always_inline int variable_fls(unsigned int x) ...@@ -209,7 +209,7 @@ static __always_inline int variable_fls(unsigned int x)
if (!x) if (!x)
return 0; return 0;
asm_volatile_goto(ALTERNATIVE("j %l[legacy]", "nop", 0, asm goto(ALTERNATIVE("j %l[legacy]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: : : : legacy); : : : : legacy);
......
...@@ -53,7 +53,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) ...@@ -53,7 +53,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) { IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) {
unsigned long fold_temp; unsigned long fold_temp;
asm_volatile_goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0, asm goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: :
: :
......
...@@ -80,7 +80,7 @@ riscv_has_extension_likely(const unsigned long ext) ...@@ -80,7 +80,7 @@ riscv_has_extension_likely(const unsigned long ext)
"ext must be < RISCV_ISA_EXT_MAX"); "ext must be < RISCV_ISA_EXT_MAX");
if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) { if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) {
asm_volatile_goto( asm goto(
ALTERNATIVE("j %l[l_no]", "nop", 0, %[ext], 1) ALTERNATIVE("j %l[l_no]", "nop", 0, %[ext], 1)
: :
: [ext] "i" (ext) : [ext] "i" (ext)
...@@ -103,7 +103,7 @@ riscv_has_extension_unlikely(const unsigned long ext) ...@@ -103,7 +103,7 @@ riscv_has_extension_unlikely(const unsigned long ext)
"ext must be < RISCV_ISA_EXT_MAX"); "ext must be < RISCV_ISA_EXT_MAX");
if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) { if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) {
asm_volatile_goto( asm goto(
ALTERNATIVE("nop", "j %l[l_yes]", 0, %[ext], 1) ALTERNATIVE("nop", "j %l[l_yes]", 0, %[ext], 1)
: :
: [ext] "i" (ext) : [ext] "i" (ext)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
static __always_inline bool arch_static_branch(struct static_key * const key, static __always_inline bool arch_static_branch(struct static_key * const key,
const bool branch) const bool branch)
{ {
asm_volatile_goto( asm goto(
" .align 2 \n\t" " .align 2 \n\t"
" .option push \n\t" " .option push \n\t"
" .option norelax \n\t" " .option norelax \n\t"
...@@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, ...@@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key,
static __always_inline bool arch_static_branch_jump(struct static_key * const key, static __always_inline bool arch_static_branch_jump(struct static_key * const key,
const bool branch) const bool branch)
{ {
asm_volatile_goto( asm goto(
" .align 2 \n\t" " .align 2 \n\t"
" .option push \n\t" " .option push \n\t"
" .option norelax \n\t" " .option norelax \n\t"
......
...@@ -53,7 +53,7 @@ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, ...@@ -53,7 +53,7 @@ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
* support, so nop when Zbb is available and jump when Zbb is * support, so nop when Zbb is available and jump when Zbb is
* not available. * not available.
*/ */
asm_volatile_goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0, asm goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: :
: :
...@@ -170,7 +170,7 @@ do_csum_with_alignment(const unsigned char *buff, int len) ...@@ -170,7 +170,7 @@ do_csum_with_alignment(const unsigned char *buff, int len)
* support, so nop when Zbb is available and jump when Zbb is * support, so nop when Zbb is available and jump when Zbb is
* not available. * not available.
*/ */
asm_volatile_goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0, asm goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: :
: :
...@@ -178,7 +178,7 @@ do_csum_with_alignment(const unsigned char *buff, int len) ...@@ -178,7 +178,7 @@ do_csum_with_alignment(const unsigned char *buff, int len)
: no_zbb); : no_zbb);
#ifdef CONFIG_32BIT #ifdef CONFIG_32BIT
asm_volatile_goto(".option push \n\ asm_goto_output(".option push \n\
.option arch,+zbb \n\ .option arch,+zbb \n\
rori %[fold_temp], %[csum], 16 \n\ rori %[fold_temp], %[csum], 16 \n\
andi %[offset], %[offset], 1 \n\ andi %[offset], %[offset], 1 \n\
...@@ -193,7 +193,7 @@ do_csum_with_alignment(const unsigned char *buff, int len) ...@@ -193,7 +193,7 @@ do_csum_with_alignment(const unsigned char *buff, int len)
return (unsigned short)csum; return (unsigned short)csum;
#else /* !CONFIG_32BIT */ #else /* !CONFIG_32BIT */
asm_volatile_goto(".option push \n\ asm_goto_output(".option push \n\
.option arch,+zbb \n\ .option arch,+zbb \n\
rori %[fold_temp], %[csum], 32 \n\ rori %[fold_temp], %[csum], 32 \n\
add %[csum], %[fold_temp], %[csum] \n\ add %[csum], %[fold_temp], %[csum] \n\
...@@ -257,7 +257,7 @@ do_csum_no_alignment(const unsigned char *buff, int len) ...@@ -257,7 +257,7 @@ do_csum_no_alignment(const unsigned char *buff, int len)
* support, so nop when Zbb is available and jump when Zbb is * support, so nop when Zbb is available and jump when Zbb is
* not available. * not available.
*/ */
asm_volatile_goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0, asm goto(ALTERNATIVE("j %l[no_zbb]", "nop", 0,
RISCV_ISA_EXT_ZBB, 1) RISCV_ISA_EXT_ZBB, 1)
: :
: :
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
*/ */
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("0: brcl 0,%l[label]\n" asm goto("0: brcl 0,%l[label]\n"
".pushsection __jump_table,\"aw\"\n" ".pushsection __jump_table,\"aw\"\n"
".balign 8\n" ".balign 8\n"
".long 0b-.,%l[label]-.\n" ".long 0b-.,%l[label]-.\n"
...@@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("0: brcl 15,%l[label]\n" asm goto("0: brcl 15,%l[label]\n"
".pushsection __jump_table,\"aw\"\n" ".pushsection __jump_table,\"aw\"\n"
".balign 8\n" ".balign 8\n"
".long 0b-.,%l[label]-.\n" ".long 0b-.,%l[label]-.\n"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
static __always_inline bool arch_static_branch(struct static_key *key, bool branch) static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"nop\n\t" "nop\n\t"
"nop\n\t" "nop\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
...@@ -26,7 +26,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran ...@@ -26,7 +26,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
{ {
asm_volatile_goto("1:\n\t" asm goto("1:\n\t"
"b %l[l_yes]\n\t" "b %l[l_yes]\n\t"
"nop\n\t" "nop\n\t"
".pushsection __jump_table, \"aw\"\n\t" ".pushsection __jump_table, \"aw\"\n\t"
......
...@@ -75,7 +75,7 @@ extern void setup_clear_cpu_cap(unsigned int bit); ...@@ -75,7 +75,7 @@ extern void setup_clear_cpu_cap(unsigned int bit);
*/ */
static __always_inline bool _static_cpu_has(u16 bit) static __always_inline bool _static_cpu_has(u16 bit)
{ {
asm_volatile_goto("1: jmp 6f\n" asm goto("1: jmp 6f\n"
"2:\n" "2:\n"
".skip -(((5f-4f) - (2b-1b)) > 0) * " ".skip -(((5f-4f) - (2b-1b)) > 0) * "
"((5f-4f) - (2b-1b)),0x90\n" "((5f-4f) - (2b-1b)),0x90\n"
......
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