powerpc: Restore registers on error exit from csum_partial_copy_generic()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 1 Oct 2013 07:11:35 +0000 (17:11 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 17:51:21 +0000 (10:51 -0700)
commit0b36b7f617524596dc8900c1f8c3ab051c6b9dc5
treeebe7c2d1c2efaf5d962065cdd650b69ceca00f6b
parent58b9385170d93957a0518d4ee9c4b1c5068bc7ef
powerpc: Restore registers on error exit from csum_partial_copy_generic()

commit 8f21bd0090052e740944f9397e2be5ac7957ded7 upstream.

The csum_partial_copy_generic() function saves the PowerPC non-volatile
r14, r15, and r16 registers for the main checksum-and-copy loop.
Unfortunately, it fails to restore them upon error exit from this loop,
which results in silent corruption of these registers in the presumably
rare event of an access exception within that loop.

This commit therefore restores these register on error exit from the loop.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[bwh: Backported to 3.2: register name macros use lower-case 'r']
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/lib/checksum_64.S