]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc: Make load/store emulation use larger memory accesses
authorPaul Mackerras <paulus@ozlabs.org>
Wed, 30 Aug 2017 04:12:32 +0000 (14:12 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 1 Sep 2017 06:39:51 +0000 (16:39 +1000)
commite0a0986b446553c6a69fe1bb36250224646b264f
tree82281da0dc02c254e403cda101615aaf249834a6
parent958465ee5407dc1b25ba6eb33f0e8bb6179960ee
powerpc: Make load/store emulation use larger memory accesses

At the moment, emulation of loads and stores of up to 8 bytes to
unaligned addresses on a little-endian system uses a sequence of
single-byte loads or stores to memory.  This is rather inefficient,
and the code is hard to follow because it has many ifdefs.
In addition, the Power ISA has requirements on how unaligned accesses
are performed, which are not met by doing all accesses as
sequences of single-byte accesses.

Emulation of VSX loads and stores uses __copy_{to,from}_user,
which means the emulation code has no control on the size of
accesses.

To simplify this, we add new copy_mem_in() and copy_mem_out()
functions for accessing memory.  These use a sequence of the largest
possible aligned accesses, up to 8 bytes (or 4 on 32-bit systems),
to copy memory between a local buffer and user memory.  We then
rewrite {read,write}_mem_unaligned and the VSX load/store
emulation using these new functions.

These new functions also simplify the code in do_fp_load() and
do_fp_store() for the unaligned cases.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/lib/sstep.c