arm64: entry: use ldp/stp instead of push/pop when saving/restoring regs
authorWill Deacon <will.deacon@arm.com>
Mon, 29 Sep 2014 11:26:41 +0000 (12:26 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 14 Nov 2014 10:42:21 +0000 (10:42 +0000)
commit63648dd20fa0780ab6c1e923b5c276d257422cb3
tree4cf6d802916d0cbccd7409b2f1521eca6ce9f64b
parentd54e81f9af1d106e47ae8594903c43a80dae1a99
arm64: entry: use ldp/stp instead of push/pop when saving/restoring regs

The push/pop instructions can be suboptimal when saving/restoring large
amounts of data to/from the stack, for example on entry/exit from the
kernel. This is because:

  (1) They act on descending addresses (i.e. the newly decremented sp),
      which may defeat some hardware prefetchers

  (2) They introduce an implicit dependency between each instruction, as
      the sp has to be updated in order to resolve the address of the
      next access.

This patch removes the push/pop instructions from our kernel entry/exit
macros in favour of ldp/stp plus offset.

Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/entry.S