OpenCloudOS-Kernel/arch
Masahiro Yamada 851140ab0d ARM: 8908/1: add __always_inline to functions called from __get_user_check()
KernelCI reports that bcm2835_defconfig is no longer booting since
commit ac7c3e4ff4 ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly") (https://lkml.org/lkml/2019/9/26/825).

I also received a regression report from Nicolas Saenz Julienne
(https://lkml.org/lkml/2019/9/27/263).

This problem has cropped up on bcm2835_defconfig because it enables
CONFIG_CC_OPTIMIZE_FOR_SIZE. The compiler tends to prefer not inlining
functions with -Os. I was able to reproduce it with other boards and
defconfig files by manually enabling CONFIG_CC_OPTIMIZE_FOR_SIZE.

The __get_user_check() specifically uses r0, r1, r2 registers.
So, uaccess_save_and_enable() and uaccess_restore() must be inlined.
Otherwise, those register assignments would be entirely dropped,
according to my analysis of the disassembly.

Prior to commit 9012d01166 ("compiler: allow all arches to enable
CONFIG_OPTIMIZE_INLINING"), the 'inline' marker was always enough for
inlining functions, except on x86.

Since that commit, all architectures can enable CONFIG_OPTIMIZE_INLINING.
So, __always_inline is now the only guaranteed way of forcible inlining.

I added __always_inline to 4 functions in the call-graph from the
__get_user_check() macro.

Fixes: 9012d01166 ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING")
Reported-by: "kernelci.org bot" <bot@kernelci.org>
Reported-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2019-10-10 22:23:19 +01:00
..
alpha Merge branch 'akpm' (patches from Andrew) 2019-07-17 08:58:04 -07:00
arc Wimplicit-fallthrough patches for 5.3-rc7 2019-08-29 09:28:25 -07:00
arm ARM: 8908/1: add __always_inline to functions called from __get_user_check() 2019-10-10 22:23:19 +01:00
arm64 Second Round of Renesas ARM Based SoC Fixes for v5.3 2019-09-05 17:56:30 +02:00
c6x Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-07-10 21:42:03 -07:00
csky treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers 2019-07-25 11:05:10 +02:00
h8300 h8300 update for 5.3 2019-07-17 09:36:38 -07:00
hexagon hexagon: switch to generic version of pte allocation 2019-07-21 09:53:00 -07:00
ia64 Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
m68k arch: mark syscall number 435 reserved for clone3 2019-07-15 00:39:33 +02:00
microblaze clone3-v5.3 2019-07-11 10:09:44 -07:00
mips Wimplicit-fallthrough patches for 5.3-rc6 2019-08-22 11:26:10 -07:00
nds32 nds32: Mark expected switch fall-throughs 2019-08-29 11:06:56 -05:00
nios2 nios2 update for v5.3-rc1 2019-07-12 15:38:05 -07:00
openrisc dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
parisc parisc: fix compilation errrors 2019-08-24 19:48:42 -07:00
powerpc powerpc fixes for 5.3 #5 2019-09-06 08:54:45 -07:00
riscv riscv: modify the Image header to improve compatibility with the ARM64 header 2019-09-13 19:03:52 -07:00
s390 KVM: s390: Fixes for 5.3 2019-09-14 09:25:30 +02:00
sh sh: kernel: hw_breakpoint: Fix missing break in switch statement 2019-08-11 16:15:16 -05:00
sparc ipc: fix sparc64 ipc() wrapper 2019-09-07 21:42:25 +02:00
um um: fix time travel mode 2019-08-23 00:39:53 +02:00
unicore32 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
x86 KVM: x86/mmu: Reintroduce fast invalidate/zap for flushing memslot 2019-09-14 09:25:11 +02:00
xtensa xtensa: add missing isync to the cpu_reset TLB code 2019-08-12 15:05:48 -07:00
.gitignore
Kconfig Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-07-20 10:33:44 -07:00