From 983394959f5edff6b39bcd10317badaaf33efa99 Mon Sep 17 00:00:00 2001 From: Noam Camus Date: Tue, 13 Jun 2017 17:03:45 +0300 Subject: ARC: [plat-eznps] Handle user memory error same in simulation and silicon On ARC700 (and nSIM), user mode memory error triggers an L2 interrupt which is handled gracefully by kernel (or it tries to despite this being imprecise, and error could get charged to kernel itself). The offending task is killed and kernel moves on. NPS hardware however raises a Machine Check exception for same error which is NOT recoverable by kernel. This patch aligns kernel handling for nSIM case, to same as hardware by overriding the default user space bus error handler. Signed-off-by: Noam Camus Signed-off-by: Elad Kanfi [vgupta: rewrote changelog] Signed-off-by: Vineet Gupta --- arch/arc/plat-eznps/mtm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/arc/plat-eznps/mtm.c') diff --git a/arch/arc/plat-eznps/mtm.c b/arch/arc/plat-eznps/mtm.c index e0cb36b03d2e..dcbf8f6ebf74 100644 --- a/arch/arc/plat-eznps/mtm.c +++ b/arch/arc/plat-eznps/mtm.c @@ -25,6 +25,15 @@ #define MT_CTRL_ST_CNT 0xF #define NPS_NUM_HW_THREADS 0x10 +#ifdef CONFIG_EZNPS_MEM_ERROR_ALIGN +int do_memory_error(unsigned long address, struct pt_regs *regs) +{ + die("Invalid Mem Access", regs, address); + + return 1; +} +#endif + static void mtm_init_nat(int cpu) { struct nps_host_reg_mtm_cfg mtm_cfg; -- cgit v1.2.3-59-g8ed1b