OSDN Git Service

ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Aug 2021 07:30:18 +0000 (08:30 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Aug 2021 10:39:25 +0000 (11:39 +0100)
commit2423de2e6f4d8676b6f6e43dee437461023ca6a1
tree06f5aa0dc1bb84599a5ed11a505c901a1ca3ad39
parentb30d0289de72c62516df03fdad8d53f552c69839
ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault

On machines such as ARMv5 that trap unaligned accesses, these
two functions can be slow when each access needs to be emulated,
or they might not work at all.

Change them so that each loop is only used when both the src
and dst pointers are naturally aligned.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
mm/maccess.c