diff mbox

powerpc: Fix do_page_fault to check for HWPOISON flag.

Message ID 20140923054236.18176.50982.stgit@localhost.localdomain (mailing list archive)
State Superseded
Headers show

Commit Message

Henish Patel Sept. 23, 2014, 5:42 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51ab9e7..5e9b4fd 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -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 */