]> 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)
commitc16b0e178ddb4b8e106746e3206b2c5429ccfbcd
tree773110aa64ab8777c7ca4ba56a5556a6262de7d1
parent6fd59398ac3c255b68f69cf509b0109869a616de
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