powerpc/32: Fix again csum_partial_copy_generic()

Commit 7aef4136566b0 ("powerpc32: rewrite csum_partial_copy_generic()
based on copy_tofrom_user()") introduced a bug when destination address
is odd and len is lower than cacheline size.

In that case the resulting csum value doesn't have to be rotated one
byte because the cache-aligned copy part is skipped so no alignment
is performed.

Fixes: 7aef4136566b0 ("powerpc32: rewrite csum_partial_copy_generic() based on copy_tofrom_user()")
Cc: stable@vger.kernel.org # v4.6+
Reported-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Tested-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Christophe Leroy and committed by
Michael Ellerman
8540571e caa58f80

+4 -3
+4 -3
arch/powerpc/lib/checksum_32.S
··· 127 stw r7,12(r1) 128 stw r8,8(r1) 129 130 - rlwinm r0,r4,3,0x8 131 - rlwnm r6,r6,r0,0,31 /* odd destination address: rotate one byte */ 132 - cmplwi cr7,r0,0 /* is destination address even ? */ 133 addic r12,r6,0 134 addi r6,r4,-4 135 neg r0,r4 136 addi r4,r3,-4 137 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */ 138 beq 58f 139 140 cmplw 0,r5,r0 /* is this more than total to do? */ 141 blt 63f /* if not much to do */ 142 andi. r8,r0,3 /* get it word-aligned first */ 143 mtctr r8 144 beq+ 61f
··· 127 stw r7,12(r1) 128 stw r8,8(r1) 129 130 addic r12,r6,0 131 addi r6,r4,-4 132 neg r0,r4 133 addi r4,r3,-4 134 andi. r0,r0,CACHELINE_MASK /* # bytes to start of cache line */ 135 + crset 4*cr7+eq 136 beq 58f 137 138 cmplw 0,r5,r0 /* is this more than total to do? */ 139 blt 63f /* if not much to do */ 140 + rlwinm r7,r6,3,0x8 141 + rlwnm r12,r12,r7,0,31 /* odd destination address: rotate one byte */ 142 + cmplwi cr7,r7,0 /* is destination address even ? */ 143 andi. r8,r0,3 /* get it word-aligned first */ 144 mtctr r8 145 beq+ 61f