]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Avoid link stack corruption in MMU on syscall entry path
authorMichael Neuling <mikey@neuling.org>
Wed, 27 Feb 2013 10:45:52 +0000 (10:45 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 5 Mar 2013 05:56:28 +0000 (16:56 +1100)
commitb14f24b0f53d25f22a84da84b7229870dca0523a
tree773110aa64ab8777c7ca4ba56a5556a6262de7d1
parent8789062e5d504f2bb40d380dbb88ce775477ef86
powerpc: Avoid link stack corruption in MMU on syscall entry path

Currently we use the link register to branch up high in the early MMU on
syscall entry path.  Unfortunately, this trashes the link stack as the
address we are going to is not associated with the earlier mflr.

This patch simply converts us to used the count register (volatile over
syscalls anyway) instead.  This is much better at predicting in this
scenario and doesn't trash link stack causing a bunch of additional
branch mispredicts later.  Benchmarking this on POWER8 saves a bunch of
cycles on Anton's null syscall benchmark here:
   http://ozlabs.org/~anton/junkcode/null_syscall.c

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/exceptions-64s.S