This is a repost of a series that I posted back in 2016 but which was never applied. It aims to make the exception handling code in __copy_tofrom_user_base clearer and easier to verify, and strengthens the selftests for the user copy code to test all the paths and to test the exception handling. Finally it then fixes a deficiency in that when copying to userspace we don't always copy quite as many bytes as we could.
I have rebased this series on top of the powerpc next branch as of today. Paul. arch/powerpc/lib/copyuser_64.S | 585 +++++++++------------ arch/powerpc/lib/copyuser_power7.S | 21 +- arch/powerpc/lib/memcpy_64.S | 9 +- arch/powerpc/lib/memcpy_power7.S | 22 +- .../testing/selftests/powerpc/copyloops/.gitignore | 17 +- tools/testing/selftests/powerpc/copyloops/Makefile | 44 +- .../selftests/powerpc/copyloops/asm/ppc_asm.h | 44 +- .../powerpc/copyloops/copy_tofrom_user_reference.S | 24 + .../selftests/powerpc/copyloops/exc_validate.c | 124 +++++ tools/testing/selftests/powerpc/copyloops/stubs.S | 19 + 10 files changed, 516 insertions(+), 393 deletions(-)