summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/rheap.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@ozlabs.org>2017-08-30 14:12:32 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2017-09-01 16:39:51 +1000
commite0a0986b446553c6a69fe1bb36250224646b264f (patch)
tree82281da0dc02c254e403cda101615aaf249834a6 /arch/powerpc/lib/rheap.c
parent958465ee5407dc1b25ba6eb33f0e8bb6179960ee (diff)
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>
Diffstat (limited to 'arch/powerpc/lib/rheap.c')
0 files changed, 0 insertions, 0 deletions