powerpc: Fix DAR reporting when alignment handler faults
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Aug 2017 10:49:57 +0000 (20:49 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 31 Aug 2017 12:06:57 +0000 (22:06 +1000)
commitf9effe925039cf54489b5c04e0d40073bb3a123d
tree3a07b7409a0ddf52974060b76712d713b19d0092
parentafb5519fdb346201728040cab4e08ce53e7ff4fd
powerpc: Fix DAR reporting when alignment handler faults

Anton noticed that if we fault part way through emulating an unaligned
instruction, we don't update the DAR to reflect that.

The DAR value is eventually reported back to userspace as the address
in the SEGV signal, and if userspace is using that value to demand
fault then it can be confused by us not setting the value correctly.

This patch is ugly as hell, but is intended to be the minimal fix and
back ports easily.

Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/kernel/align.c