]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64: Copy as much as possible in __copy_tofrom_user
authorPaul Mackerras <paulus@ozlabs.org>
Fri, 3 Aug 2018 10:13:06 +0000 (20:13 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 Aug 2018 14:32:36 +0000 (00:32 +1000)
commit93ba2852577f6fda3501c3871e815c97704a5418
tree708ee74f55b7f9bd29285eb58f0444c5300a5836
parente0bb29d1523e26757d08af92ec1f5ef0bc96abc1
powerpc/64: Copy as much as possible in __copy_tofrom_user

In __copy_tofrom_user, if we encounter an exception on a store, we
stop copying and return the number of bytes not copied.  However,
if the store is wider than one byte and is to an unaligned address,
it is possible that the store operand overlaps a page boundary
and the exception occurred on the latter part of the store operand,
meaning that it would be possible to copy a few more bytes.  Since
copy_to_user is generally expected to copy as much as possible,
it would be better to copy those extra few bytes.  This adds code
to do that.  Since this edge case is not performance-critical,
the code has been written to be compact rather than as fast as
possible.

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