linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: noamca@mellanox.com (Noam Camus)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception
Date: Sun, 28 May 2017 09:52:08 +0300	[thread overview]
Message-ID: <1495954328-28736-12-git-send-email-noamca@mellanox.com> (raw)
In-Reply-To: <1495954328-28736-1-git-send-email-noamca@mellanox.com>

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.
We override weak symbole of mem_service to achieve that.

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

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.
diff --git a/arch/arc/plat-eznps/entry.S b/arch/arc/plat-eznps/entry.S
index 328261c..03e2892 100644
--- a/arch/arc/plat-eznps/entry.S
+++ b/arch/arc/plat-eznps/entry.S
@@ -68,3 +68,17 @@ ENTRY(res_service)
 
 	j	stext
 END(res_service)
+
+#if defined(CONFIG_EZNPS_MEM_ERROR)
+ENTRY(mem_service)
+	; 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
+END(mem_service)
+#endif
-- 
1.7.1

  parent reply	other threads:[~2017-05-28  6:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-28  6:51 [PATCH v2 00/11] ARC plat-eznps upstream cont Noam Camus
2017-05-28  6:51 ` [PATCH v2 01/11] ARC: set level of log per CPU during boot to be debug level Noam Camus
2017-05-28  6:51 ` [PATCH v2 02/11] ARC: send ipi to all cpus sharing task mm in case of page fault Noam Camus
2017-05-30 16:40   ` Vineet Gupta
2017-05-28  6:52 ` [PATCH v2 03/11] ARC: typo fix in mm/fault.c Noam Camus
2017-05-28  6:52 ` [PATCH v2 04/11] ARC: typos fix in kernel/entry-compact.S Noam Camus
2017-05-28  6:52 ` [PATCH v2 05/11] ARC: [plat-eznps] typo fix at Kconfig Noam Camus
2017-05-28  6:52 ` [PATCH v2 06/11] ARC: [plat-eznps] Fix TLB Errata Noam Camus
2017-05-28  6:52 ` [PATCH v2 07/11] ARC: [plat-eznps] disabled stall counter due to a HW bug Noam Camus
2017-05-29 15:15   ` Alexey Brodkin
2017-05-28  6:52 ` [PATCH v2 08/11] ARC: [plat-eznps] spinlock aware for MTM Noam Camus
2017-06-02 18:36   ` Vineet Gupta
2017-06-04  6:11     ` Noam Camus
2017-05-28  6:52 ` [PATCH v2 09/11] ARC: [plat-eznps] use schd.wft instruction instead of sleep at idle task Noam Camus
2017-05-28  6:52 ` [PATCH v2 10/11] ARC: enable platform specific mem_service implementation Noam Camus
2017-05-28  6:52 ` Noam Camus [this message]
2017-06-02 19:04   ` [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception Vineet Gupta
2017-06-04  6:10     ` Noam Camus
2017-06-06 22:10   ` Vineet Gupta
2017-06-07  6:07     ` Noam Camus
2017-06-07 11:14     ` Noam Camus
2017-06-07 16:15       ` Vineet Gupta
     [not found]         ` <AM5PR0502MB2996A1F4CFE1FE6AEB433A7DAAC80@AM5PR0502MB2996.eurprd05.prod.outlook.com>
     [not found]           ` <AM5PR0502MB2996FBD57D8591A42ED4A84CAAC90@AM5PR0502MB2996.eurprd05.prod.outlook.com>
2017-06-08 16:38             ` Vineet Gupta
     [not found]               ` <AM5PR0502MB299646D52F2A0AF3764CEC4BAAC90@AM5PR0502MB2996.eurprd05.prod.outlook.com>
2017-06-08 19:00                 ` Vineet Gupta
     [not found]                   ` <AM5PR0502MB2996B6DA5530C4B37A7B1AF0AACE0@AM5PR0502MB2996.eurprd05.prod.outlook.com>
2017-06-12 17:40                     ` Vineet Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495954328-28736-12-git-send-email-noamca@mellanox.com \
    --to=noamca@mellanox.com \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).