OSDN Git Service

x86: alternative.h: use asm_inline for all alternative variants
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 12 Sep 2019 22:19:26 +0000 (00:19 +0200)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Sun, 15 Sep 2019 18:14:15 +0000 (20:14 +0200)
commit40576e5e63ea5eeab814de7af83ad09dd64134ee
treeb5e487aa34bc1bbc60cfdbb26e32814dbb77a1b7
parenteb111869301e15b737315a46c913ae82bd19eb9d
x86: alternative.h: use asm_inline for all alternative variants

Most, if not all, uses of the alternative* family just provide one or
two instructions in .text, but the string literal can be quite large,
causing gcc to overestimate the size of the generated code. That in
turn affects its decisions about inlining of the function containing
the alternative() asm statement.

New enough versions of gcc allow one to overrule the estimated size by
using "asm inline" instead of just "asm". So replace asm by the helper
asm_inline, which for older gccs just expands to asm.

Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
arch/x86/include/asm/alternative.h