@@ -170,10 +170,10 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
return MM_FAULT_RETURN;
}
- /* Bus error. x86 handles HWPOISON here, we'll add this if/when
- * we support the feature in HW
+ /* Send SIGBUS to the application when it tries to access a page,
+ * which has been marked as HWPOISON.
*/
- if (fault & VM_FAULT_SIGBUS)
+ if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON))
return do_sigbus(regs, addr);
/* We don't understand the fault code, this is fatal */
The current implementation of do_page_fault does not check whether the page being accessed is marked hwpiosoned or not. Hence when an application tries to access page that is marked hwpoisoned, it results into Linux hypervisor crash and system goes into IPLing state. This patch fixes this issue by adding a check for HWPOISON flag and send SIGBUS to an application that is trying to access hwpoisoned page. Signed-off-by: Henish Patel <hpatel@linux.vnet.ibm.com> --- arch/powerpc/mm/fault.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)