From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164270AbdEYLPF (ORCPT ); Thu, 25 May 2017 07:15:05 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:47298 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760248AbdEYLPD (ORCPT ); Thu, 25 May 2017 07:15:03 -0400 From: Alexey Brodkin To: "noamca@mellanox.com" CC: "linux-kernel@vger.kernel.org" , "eladkan@mellanox.com" , "linux-snps-arc@lists.infradead.org" Subject: Re: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an exception Thread-Topic: [PATCH 10/10] ARC: [plat-eznps] Handle memory error as an exception Thread-Index: AQHS1P+LOC/y0M8+8UyCO0i53555o6IExMEA Date: Thu, 25 May 2017 11:14:59 +0000 Message-ID: <1495710896.5393.32.camel@synopsys.com> References: <1495679660-9598-1-git-send-email-noamca@mellanox.com> <1495679660-9598-11-git-send-email-noamca@mellanox.com> In-Reply-To: <1495679660-9598-11-git-send-email-noamca@mellanox.com> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.8.122] Content-Type: text/plain; charset="utf-8" Content-ID: <8BA9CDA102709A459BE891AEC0C46AD4@internal.synopsys.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v4PBFE9q018898 Hi Noam, On Thu, 2017-05-25 at 05:34 +0300, Noam Camus wrote: > From: Noam Camus > > 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 > Signed-off-by: Noam Camus > --- >  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 I'm not really buying that. Why don't you just make simulator behaving exactly as your real chip? Adding those stubs for some corner-cases here and there complicate code, affect maintainability etc. -Alexey