Revision d6bd8194e2867e85ac2de63486d3b83ccfae4e62 authored by Michael Ellerman on 26 June 2017, 01:30:57 UTC, committed by Michael Ellerman on 26 June 2017, 13:25:08 UTC
Larry Finger reported that his Powerbook G4 was no longer booting with v4.12-rc,
userspace was up but giving weird errors such as:

  udevd[64]: starting version 175
  udevd[64]: Unable to receive ctrl message: Bad address.
  modprobe: chdir(4.12-rc1): No such file or directory

He bisected the problem to commit 3448890c32c3 ("powerpc: get rid of zeroing,
switch to RAW_COPY_USER").

Al identified that the problem is actually a miscompilation by GCC 4.6.3, which
is exposed by the above commit.

Al also pointed out that inlining copy_to/from_user() is probably of little or
no benefit, which is correct. Using Anton's copy_to_user benchmark, with a
pathological single byte copy, we see a small increase in performance
by *removing* inlining:

  Before (inlined):
  # time ./copy_to_user -w -l 1 -i 10000000	( x 3 )
  real	0m22.063s
  real	0m22.059s
  real	0m22.076s

  After:
  # time ./copy_to_user -w -l 1 -i 10000000	( x 3 )
  real	0m21.325s
  real	0m21.299s
  real	0m21.364s

So as a small performance improvement and to avoid the miscompilation, drop
inlining copy_to/from_user() on 32-bit.

Fixes: 3448890c32c3 ("powerpc: get rid of zeroing, switch to RAW_COPY_USER")
Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 797625d
History
File Mode Size
hisilicon
sti
tegra
Kconfig -rw-r--r-- 3.1 KB
Makefile -rw-r--r-- 778 bytes
core.c -rw-r--r-- 11.6 KB
reset-a10sr.c -rw-r--r-- 3.7 KB
reset-ath79.c -rw-r--r-- 3.7 KB
reset-berlin.c -rw-r--r-- 2.5 KB
reset-imx7.c -rw-r--r-- 4.7 KB
reset-lpc18xx.c -rw-r--r-- 5.9 KB
reset-meson.c -rw-r--r-- 4.4 KB
reset-oxnas.c -rw-r--r-- 3.2 KB
reset-pistachio.c -rw-r--r-- 3.4 KB
reset-socfpga.c -rw-r--r-- 4.0 KB
reset-stm32.c -rw-r--r-- 2.6 KB
reset-sunxi.c -rw-r--r-- 4.3 KB
reset-ti-syscon.c -rw-r--r-- 7.1 KB
reset-uniphier.c -rw-r--r-- 12.5 KB
reset-zx2967.c -rw-r--r-- 2.3 KB
reset-zynq.c -rw-r--r-- 3.6 KB

back to top