Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650133

[PATCH 10/10] ARC: [plat-eznps] Handle memory error as an exception

From Noam Camus <noamca@mellanox.com>
Newsgroups linux.kernel
Subject [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an exception
Date 2017-05-25 04:40 +0200
Message-ID <tKQQW-2dF-27@gated-at.bofh.it> (permalink)
References <tKQQV-2dF-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Noam Camus <noamca@mellanox.com>

This commit adds the configuration CONFIG_EZNPS_MEM_ERROR.
If set, it will cause the kernel to handle user memory error
as a machine check exception.
It is required in order to align the NPS simulator memory
error handling to the one of the NPS400 real chip behavior.

Signed-off-by: Elad Kanfi <eladkan@mellanox.com>
Signed-off-by: Noam Camus <noamca@mellanox.com>
---
 arch/arc/kernel/entry-compact.S |   11 +++++++++++
 arch/arc/plat-eznps/Kconfig     |   11 +++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arc/kernel/entry-compact.S b/arch/arc/kernel/entry-compact.S
index f285dbb..d152d36 100644
--- a/arch/arc/kernel/entry-compact.S
+++ b/arch/arc/kernel/entry-compact.S
@@ -203,6 +203,17 @@ END(handle_interrupt_level2)
 ; ---------------------------------------------
 ENTRY(mem_service)
 
+#if defined(CONFIG_EZNPS_MEM_ERROR)
+        ; SW workaround to cover up on a difference between
+        ; NPS real chip and simulator behaviors.
+        ; NPS real chip will activate a machine check exception
+        ; in case of memory error, while the simulator will
+        ; trigger a level 2 interrupt. Therefor this code section
+        ; should be reached only in simulation mode.
+        ; DEAD END: display Regs and HALT
+
+	j EV_MachineCheck
+#endif
 	INTERRUPT_PROLOGUE 2
 
 	mov r0, ilink2
diff --git a/arch/arc/plat-eznps/Kconfig b/arch/arc/plat-eznps/Kconfig
index feaa471..c5f946c 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
+       bool "ARC-EZchip Memory error as an exception"
+       depends on ARC_PLAT_EZNPS
+       default n
+       help
+         On the real chip of the NPS, user memory errors are handled
+         as a machine check exception, whereas on simulator platform
+         for NPS, it handled as an interrupt level 2 (like legacy arc
+         real chip architecture).This configuration will cause the kernel
+         to handle memory error as a machine check exception.
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] ARC plat-eznps upstream cont. Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
  [PATCH 02/10] ARC: send ipi to all cpus sharing task mm in case of page fault Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
    Re: [PATCH 02/10] ARC: send ipi to all cpus sharing task mm in case  of page fault Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 13:40 +0200
  [PATCH 08/10] ARC: [plat-eznps] spinlock aware for MTM Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
  [PATCH 06/10] ARC: [plat-eznps] Fix TLB Errata Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
    Re: [PATCH 06/10] ARC: [plat-eznps] Fix TLB Errata Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 13:10 +0200
      RE: [PATCH 06/10] ARC: [plat-eznps] Fix TLB Errata Noam Camus <noamca@mellanox.com> - 2017-05-25 13:20 +0200
      Re: [PATCH 06/10] ARC: [plat-eznps] Fix TLB Errata Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2017-06-01 23:20 +0200
  [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an exception Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
    Re: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 13:20 +0200
      RE: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Noam Camus <noamca@mellanox.com> - 2017-05-25 13:30 +0200
        Re: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 13:40 +0200
          RE: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Noam Camus <noamca@mellanox.com> - 2017-05-25 14:10 +0200
            Re: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 14:10 +0200
          Re: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an  exception Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2017-06-07 00:00 +0200
  [PATCH 04/10] ARC: typos fix in kernel/entry-compact.S Noam Camus <noamca@mellanox.com> - 2017-05-25 04:40 +0200
    Re: [PATCH 04/10] ARC: typos fix in kernel/entry-compact.S Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2017-05-25 13:10 +0200

csiph-web