• Paul Mackerras's avatar
    powerpc/64: Copy as much as possible in __copy_tofrom_user · f8db2007
    Paul Mackerras authored
    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: default avatarPaul Mackerras <paulus@ozlabs.org>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    f8db2007
copyuser_64.S 11.1 KB