riscv: handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of panicking
[platform/kernel/linux-starfive.git] / arch / riscv / mm / fault.c
index 6115d75..90d4ba3 100644 (file)
@@ -72,7 +72,7 @@ static inline void mm_fault_error(struct pt_regs *regs, unsigned long addr, vm_f
                }
                pagefault_out_of_memory();
                return;
-       } else if (fault & VM_FAULT_SIGBUS) {
+       } else if (fault & (VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE)) {
                /* Kernel mode? Handle exceptions or die */
                if (!user_mode(regs)) {
                        no_context(regs, addr);