arch/arm64/include/asm/jump_label.h: use asm_volatile_goto
Subsystems (2)
PATCH 1/1 arch/arm64/include/asm/jump_label.h: use asm_volatile_goto
All other uses of "asm goto" go through asm_volatile_goto (including the arm version of the same file). For consistency, use it here as well.
--- arch/arm64/include/asm/jump_label.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/include/asm/jump_label.h +2 -2
@@ -28,7 +28,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto("1: nop\n\t" +asm_volatile_goto ("1: nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"
@@ -42,7 +42,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) { - asm goto("1: b %l[l_yes]\n\t" +asm_volatile_goto ("1: b %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"
Signature · 1 line
2.17.1
Quoted 4 lines · Miguel Ojeda
All other uses of "asm goto" go through
asm_volatile_goto(including the arm version of the same file). For consistency, use it here as well.
Quoted 8 lines
Cc Nick Desaulniers <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Signed-off-by Miguel Ojeda <[email protected]>--- arch/arm64/include/asm/jump_label.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, I'll pick this up as a fix.
Will
Quoted 25 lines
arch/arm64/include/asm/jump_label.h +2
-2@@ -28,7 +28,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto("1: nop\n\t" +asm_volatile_goto ("1: nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"@@ -42,7 +42,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) { - asm goto("1: b %l[l_yes]\n\t" +asm_volatile_goto ("1: b %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"Signature · 1 line
2.17.1
Nick Desaulniers
Reviewed-byQuoted 34 lines · Will Deacon
Quoted 4 lines · Miguel Ojeda
All other uses of "asm goto" go through
asm_volatile_goto(including the arm version of the same file). For consistency, use it here as well.Quoted 8 lines
Cc Nick Desaulniers <[email protected]>Cc Catalin Marinas <[email protected]>Cc Will Deacon <[email protected]>Cc linux-arm-kernel at lists.infradead.orgSigned-off-by Miguel Ojeda <[email protected]>--- arch/arm64/include/asm/jump_label.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Thanks, I'll pick this up as a fix.
Will
Quoted 15 lines
arch/arm64/include/asm/jump_label.h +1
-1@@ -28,7 +28,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto("1: nop\n\t" +asm_volatile_goto ("1: nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t"@@ -42,7 +42,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
Quoted 10 lines
Quoted 10 lines
arch/arm64/include/asm/jump_label.h +1
-2static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { - asm goto("1: b %l[l_yes]\n\t" +asm_volatile_goto ("1: b %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align 3\n\t" ".quad 1b, %l[l_yes], %c0\n\t" --2.17.1
Yes, this should help avoid a known miscompile in gcc < 4.8.2 (at least for x86_64; not sure how backend specific the asm goto implementation is in gcc, but this shouldn't hurt).
https://lkml.org/lkml/2018/9/7/1628
Signature · 2 lines
Thanks, ~Nick Desaulniers