From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Noam Camus <noamca@mellanox.com>
Cc: "linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Elad Kanfi <eladkan@mellanox.com>
Subject: Re: [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception
Date: Mon, 12 Jun 2017 10:40:00 -0700 [thread overview]
Message-ID: <01e7716b-291c-08b2-fe93-5c5982ba4a11@synopsys.com> (raw)
In-Reply-To: <AM5PR0502MB2996B6DA5530C4B37A7B1AF0AACE0@AM5PR0502MB2996.eurprd05.prod.outlook.com>
On 06/08/2017 08:17 PM, Noam Camus wrote:
>
> *> From:*Vineet Gupta <Vineet.Gupta1@synopsys.com>
>
> *> Sent:* Thursday, June 8, 2017 10:00 PM
>
>
> >> With EZsim we try to simulate NPS400 CTOP core and not ARC core, and as such we
> >> strive to have similar echo system for both silicon and its simulator.
>
> >Right, but if you are using nSIM which generates L2 interrupt for user mode error
> >- then it is already different from silicon and needs to handled as such.
> Why so, this is something I wish to minimize and not just live with.
> So I handle difference by redirecting back to the track I want to.
>
> >> If we could, we would alter nSIM to behave just like our silicon.
> >> So in current situation where we lack doing so we suffice in single pretty small
> >> adjustment in OS (platform specific code).
>
> >You are saying contradicting things here. Above u want EZSim to simulate CTOP
> >(i.e. generate machinechk for U errors) but here you claim u use nSIM which will
> >generates L2 intr.
>
> >So I'm still grossly confused.
> Sorry, for confusion.
> I am using nSIM which creates L2 interrupt and not machine check because I got
> no alternative.
> At the first chance I get the opportunity, I put execution back to my desired
> direction.
> Since the direction as our silicon dictate is ending with die() it is a clear
> path without a risk.
OK I understand now - you want the die semantics not try and continue... but the
patch is simply wrong. From L2 interrupt you jump to machine check vector which
reads ECR. In this case it would be bogus - with some old stale value. What you
really want is an NPS version of do_memory_error - since platforms can have their
way of dealing with such errors - but the low level machine handling is just not
in their control.
I'd propose the patch below and then you can define your own version of
do_memory_error() and handle as appropriate !
---->
diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c
index ff83e78d0cfb..5a8042784ee9 100644
--- a/arch/arc/kernel/traps.c
+++ b/arch/arc/kernel/traps.c
@@ -80,11 +80,26 @@ int name(unsigned long address, struct pt_regs *regs) \
DO_ERROR_INFO(SIGILL, "Priv Op/Disabled Extn", do_privilege_fault, ILL_PRVOPC)
DO_ERROR_INFO(SIGILL, "Invalid Extn Insn", do_extension_fault, ILL_ILLOPC)
DO_ERROR_INFO(SIGILL, "Illegal Insn (or Seq)", insterror_is_error, ILL_ILLOPC)
-DO_ERROR_INFO(SIGBUS, "Invalid Mem Access", do_memory_error, BUS_ADRERR)
DO_ERROR_INFO(SIGTRAP, "Breakpoint Set", trap_is_brkpt, TRAP_BRKPT)
DO_ERROR_INFO(SIGBUS, "Misaligned Access", do_misaligned_error, BUS_ADRALN)
/*
+ * Entry point for bus errors
+ * opencoded DO_ERROR_INFO() but __weak to allow possible plarform override
+ */
+int __weak do_memory_error(unsigned long address, struct pt_regs *regs)
+{
+ siginfo_t info = {
+ .si_signo = SIGBUS,
+ .si_errno = 0,
+ .si_code = BUS_ADRERR,
+ .si_addr = (void __user *)address,
+ };
+
+ return unhandled_exception("Invalid Mem Access", regs, &info);
+}
+
+/*
prev parent reply other threads:[~2017-06-12 17:40 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 ` [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception Noam Camus
2017-06-02 19:04 ` 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 [this message]
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=01e7716b-291c-08b2-fe93-5c5982ba4a11@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=eladkan@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=noamca@mellanox.com \
/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).