linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] MIPS: Override barrier_before_unreachable() to fix microMIPS
@ 2018-04-17 10:11 James Hogan
  2018-04-17 10:11 ` [PATCH v3 1/3] alpha: Use OPTIMIZE_INLINING instead of asm/compiler.h James Hogan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: James Hogan @ 2018-04-17 10:11 UTC (permalink / raw)
  To: linux-mips, Arnd Bergmann, Richard Henderson, Ivan Kokshaysky,
	Matt Turner, linux-alpha
  Cc: linux-arch, linux-kernel, James Hogan, Ralf Baechle, Paul Burton,
	Matthew Fortune, Robert Suchanek

This series overrides barrier_before_unreachable() for MIPS to add an
.insn assembler directive.

Due to the subsequent __builtin_unreachable(), the assembler can't tell
that a label on the empty inline asm is code rather than data, so any
microMIPS branches targetting it (which sadly can't be removed) raise
errors due to the mismatching ISA mode, Adding the .insn in patch 3
tells the assembler that it should be treated as code.

To do this we add a new standard asm/compiler.h for architecture
overrides in patch 2. There are a few existing asm/compiler.h files
already existing, most of which are fairly simple and don't include
anything else (arm, arm64, mips). Unfortunately the alpha one includes
linux/compiler.h though, so it can undefine some inline macros. On
Arnd's suggestion this is converted to use OPTIMIZE_INLINING instead in
patch 1. A build of alpha's defconfig on GCC 7.3 before and after this
series results in the following size differences, which appear harmless
to me:

$ ./scripts/bloat-o-meter vmlinux.1 vmlinux.2
add/remove: 1/1 grow/shrink: 3/0 up/down: 264/-348 (-84)
Function                                     old     new   delta
cap_bprm_set_creds                          1496    1664    +168
cap_issubset                                   -      68     +68
flex_array_put                               328     344     +16
cap_capset                                   488     500     +12
nonroot_raised_pE.constprop                  348       -    -348
Total: Before=5823709, After=5823625, chg -0.00%

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Matthew Fortune <matthew.fortune@mips.com>
Cc: Robert Suchanek <robert.suchanek@mips.com>
Cc: linux-alpha@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-arch@vger.kernel.org

James Hogan (1):
  alpha: Use OPTIMIZE_INLINING instead of asm/compiler.h

Paul Burton (2):
  compiler.h: Allow arch-specific overrides
  MIPS: Workaround GCC __builtin_unreachable reordering bug

 arch/alpha/Kconfig                 |  6 ++++++
 arch/alpha/include/asm/compiler.h  | 11 -----------
 arch/arc/include/asm/Kbuild        |  1 +
 arch/c6x/include/asm/Kbuild        |  1 +
 arch/h8300/include/asm/Kbuild      |  1 +
 arch/hexagon/include/asm/Kbuild    |  1 +
 arch/ia64/include/asm/Kbuild       |  1 +
 arch/m68k/include/asm/Kbuild       |  1 +
 arch/microblaze/include/asm/Kbuild |  1 +
 arch/mips/include/asm/compiler.h   | 23 +++++++++++++++++++++++
 arch/nds32/include/asm/Kbuild      |  1 +
 arch/nios2/include/asm/Kbuild      |  1 +
 arch/openrisc/include/asm/Kbuild   |  1 +
 arch/parisc/include/asm/Kbuild     |  1 +
 arch/powerpc/include/asm/Kbuild    |  1 +
 arch/riscv/include/asm/Kbuild      |  1 +
 arch/s390/include/asm/Kbuild       |  1 +
 arch/sh/include/asm/Kbuild         |  1 +
 arch/sparc/include/asm/Kbuild      |  1 +
 arch/um/include/asm/Kbuild         |  1 +
 arch/unicore32/include/asm/Kbuild  |  1 +
 arch/x86/include/asm/Kbuild        |  1 +
 arch/xtensa/include/asm/Kbuild     |  1 +
 include/asm-generic/compiler.h     |  8 ++++++++
 include/linux/compiler-gcc.h       |  2 ++
 include/linux/compiler_types.h     |  3 +++
 26 files changed, 62 insertions(+), 11 deletions(-)
 create mode 100644 include/asm-generic/compiler.h

base-commit: b284d4d5a6785f8cd07eda2646a95782373cd01e
-- 
git-series 0.9.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-07 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 10:11 [PATCH v3 0/3] MIPS: Override barrier_before_unreachable() to fix microMIPS James Hogan
2018-04-17 10:11 ` [PATCH v3 1/3] alpha: Use OPTIMIZE_INLINING instead of asm/compiler.h James Hogan
2018-05-06 19:33   ` Matt Turner
2018-05-07  8:42     ` James Hogan
2018-05-07 16:03       ` Matt Turner
2018-04-17 10:11 ` [PATCH v3 2/3] compiler.h: Allow arch-specific overrides James Hogan
2018-04-17 19:19   ` kbuild test robot
2018-04-17 21:04     ` James Hogan
2018-04-17 10:11 ` [PATCH v3 3/3] MIPS: Workaround GCC __builtin_unreachable reordering bug James Hogan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).