diff options
author | Noam Camus <noamca@mellanox.com> | 2017-06-13 16:03:45 +0200 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2017-08-29 00:17:36 +0200 |
commit | 983394959f5edff6b39bcd10317badaaf33efa99 (patch) | |
tree | 40493ca158134c5f1a553e9f1985dd64e69b3b60 /arch/arc/plat-eznps | |
parent | ARC: [plat-eznps] use schd.wft instruction instead of sleep at idle task (diff) | |
download | linux-983394959f5edff6b39bcd10317badaaf33efa99.tar.xz linux-983394959f5edff6b39bcd10317badaaf33efa99.zip |
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 <noamca@mellanox.com>
Signed-off-by: Elad Kanfi <eladkan@mellanox.com>
[vgupta: rewrote changelog]
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/plat-eznps')
-rw-r--r-- | arch/arc/plat-eznps/Kconfig | 11 | ||||
-rw-r--r-- | arch/arc/plat-eznps/mtm.c | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arc/plat-eznps/Kconfig b/arch/arc/plat-eznps/Kconfig index feaa47141cdb..b36afb1feaba 100644 --- a/arch/arc/plat-eznps/Kconfig +++ b/arch/arc/plat-eznps/Kconfig @@ -32,3 +32,14 @@ config EZNPS_MTM_EXT any of them seem like CPU from Linux point of view. All threads within same core share the execution unit of the core and HW scheduler round robin between them. + +config EZNPS_MEM_ERROR_ALIGN + bool "ARC-EZchip Memory error as an exception" + depends on EZNPS_MTM_EXT + default n + help + On the real chip of the NPS, user memory errors are handled + as a machine check exception, which is fatal, whereas on + simulator platform for NPS, is handled as a Level 2 interrupt + (just a stock ARC700) which is recoverable. This option makes + simulator behave like hardware. 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; |