summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2014-09-24 16:59:58 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2014-10-02 17:15:17 +1000
commit9d57472f61acd7c3a33ebf5a79361e316d8ffbef (patch)
treedc1beb2245168ed89a1943536354de8eb179c61a /arch/powerpc
parent3913fdd7a23d9d8480ce3a6ca9cdf78bf0dec5a0 (diff)
powerpc: Fill in si_addr_lsb siginfo field
Fill in the si_addr_lsb siginfo field so the hwpoison code can pass to userspace the length of memory that has been corrupted. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/mm/fault.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 588b6ccc056..24b3f4949df 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -33,6 +33,7 @@
#include <linux/magic.h>
#include <linux/ratelimit.h>
#include <linux/context_tracking.h>
+#include <linux/hugetlb.h>
#include <asm/firmware.h>
#include <asm/page.h>
@@ -118,6 +119,7 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
unsigned int fault)
{
siginfo_t info;
+ unsigned int lsb = 0;
up_read(&current->mm->mmap_sem);
@@ -135,7 +137,13 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
current->comm, current->pid, address);
info.si_code = BUS_MCEERR_AR;
}
+
+ if (fault & VM_FAULT_HWPOISON_LARGE)
+ lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault));
+ if (fault & VM_FAULT_HWPOISON)
+ lsb = PAGE_SHIFT;
#endif
+ info.si_addr_lsb = lsb;
force_sig_info(SIGBUS, &info, current);
return MM_FAULT_RETURN;
}