]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: fix bugs in pa_memcpy
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 14 Apr 2017 18:15:20 +0000 (14:15 -0400)
committerHelge Deller <deller@gmx.de>
Sat, 15 Apr 2017 15:24:05 +0000 (17:24 +0200)
commit370c76d7696c3d37012a773267077c97d148288b
treea8680bebdd618adcf49b0f481f0896157a3cecb5
parentd4158fe8255c9461b746befdaca9042b35946842
parisc: fix bugs in pa_memcpy

The patch d603d4b0459d26dde94a33b95d711a851172bbbb ("parisc: Fix access
fault handling in pa_memcpy()") reimplements the pa_memcpy function.
Unfortunatelly, it makes the kernel unbootable. The crash happens in the
function ide_complete_cmd where memcpy is called with the same source
and destination address.

This patch fixes a few bugs in pa_memcpy:

* When jumping to .Lcopy_loop_16 for the first time, don't skip the
  instruction "ldi 31,t0" (this bug made the kernel unbootable)
* Use the COND macro when comparing length, so that the comparison is
  64-bit (a theoretical issue, in case the length is greater than
  0xffffffff)
* Don't use the COND macro after the "extru" instruction (the PA-RISC
  specification says that the upper 32-bits of extru result are undefined,
  although they are set to zero in practice)
* Fix exception addresses in .Lcopy16_fault and .Lcopy8_fault
* Rename .Lcopy_loop_4 to .Lcopy_loop_8 (so that it is consistent with
  .Lcopy8_fault)

Cc: <stable@vger.kernel.org> # v4.9+
Fixes: d603d4b0459d ("parisc: Fix access fault handling in pa_memcpy()")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/lib/lusercopy.S