Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbdFDGKP (ORCPT ); Sun, 4 Jun 2017 02:10:15 -0400 Received: from mail-eopbgr00082.outbound.protection.outlook.com ([40.107.0.82]:60000 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750931AbdFDGKL (ORCPT ); Sun, 4 Jun 2017 02:10:11 -0400 From: Noam Camus To: Vineet Gupta , "linux-snps-arc@lists.infradead.org" CC: "linux-kernel@vger.kernel.org" , Elad Kanfi Subject: RE: [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception Thread-Topic: [PATCH v2 11/11] ARC: [plat-eznps] Handle memory error as an exception Thread-Index: AQHS1374ZM4e6KMH1UqiHVlkW9nEJKIR9xyAgAJLozA= Date: Sun, 4 Jun 2017 06:10:08 +0000 Message-ID: References: <1495954328-28736-1-git-send-email-noamca@mellanox.com> <1495954328-28736-12-git-send-email-noamca@mellanox.com> <529402c7-e75e-8640-fbc1-37d8efd92dd9@synopsys.com> In-Reply-To: <529402c7-e75e-8640-fbc1-37d8efd92dd9@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: synopsys.com; dkim=none (message not signed) header.d=none;synopsys.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;HE1PR05MB3180;7:g4tsGhGm6wyKq0eAnt7JaQRbYiMvAqPgZYBK0FVmBHL+ex0HaGPCEcQkfIpcTPtw7gN5GBbhUs2KGEHTXhklcjJfjfdVGq+VnWkDWm6PkdctRB2VCIlavDbhJ2z3WDbFG+p6iEmM9JZNYFe+ZE8EKFwvN1k33EZitXOmE51vOxm8OYpt8ZEKWKr0bymAwaSLSfKZ+pTfTvyeG3/CQIk+dboziOHtAl4POnC5USlwWxiGlchwEBenxy5BFDUP5Y558SHiyvwjcb+9h3zAdpFJR2hYmx8qRnuBdOSoVS6rtc2f2K6UvtNBg9naaMc886jmC+fIVhAV73Y3uaCMDLB2Sg== x-ms-traffictypediagnostic: HE1PR05MB3180: x-ms-office365-filtering-correlation-id: b2d9f483-1ba2-4a87-71e6-08d4ab105a1e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:HE1PR05MB3180; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR05MB3180;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR05MB3180; x-forefront-prvs: 03283976A6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39850400002)(39450400003)(39400400002)(39410400002)(39860400002)(377454003)(38730400002)(81166006)(2906002)(86362001)(7696004)(8936002)(3280700002)(7736002)(6436002)(305945005)(3660700001)(5660300001)(8676002)(478600001)(6506006)(55016002)(66066001)(74316002)(54906002)(102836003)(3846002)(53936002)(107886003)(6246003)(6116002)(33656002)(2501003)(189998001)(9686003)(54356999)(76176999)(50986999)(25786009)(2950100002)(99286003)(2900100001)(14454004)(4326008)(229853002);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB3180;H:HE1PR05MB1625.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2017 06:10:08.3978 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3180 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 v546AUvK010296 Content-Length: 2133 Lines: 57 > From: Vineet Gupta [mailto:Vineet.Gupta1@synopsys.com] > Sent: Friday, June 2, 2017 22:04 PM >> 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. >Do you really need a Kconfig option here. AFAIKR you guys had some magic in platform code to determine whether running on sim or hw - can that be not used ? We do not have this anymore, needed to create dedicated one here. ... >> 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 >Just squash the weak symbol patch in here - not worth a separate patch ! Ok , no problem. -Noam