Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619AbbHNMEC (ORCPT ); Fri, 14 Aug 2015 08:04:02 -0400 Received: from mail-bn1on0055.outbound.protection.outlook.com ([157.56.110.55]:55840 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751867AbbHNMD7 (ORCPT ); Fri, 14 Aug 2015 08:03:59 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@caviumnetworks.com; Date: Fri, 14 Aug 2015 13:47:54 +0200 From: Robert Richter To: Marc Zyngier CC: Robert Richter , Thomas Gleixner , Jason Cooper , Tirumalesh Chalamarla , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Will Deacon Subject: Re: [PATCH v2 3/5] irqchip, gicv3: Workaround for Cavium ThunderX erratum 23154 Message-ID: <20150814114754.GR1820@rric.localhost> References: <1439477277-6157-1-git-send-email-rric@kernel.org> <1439477277-6157-4-git-send-email-rric@kernel.org> <55CCB393.1040909@arm.com> <20150813161741.GO1820@rric.localhost> <55CCCBD1.2090304@arm.com> <20150813171150.GB4914@rric.localhost> <55CDA69C.50600@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <55CDA69C.50600@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.224.195.21] X-ClientProxiedBy: VI1PR05CA0019.eurprd05.prod.outlook.com (25.162.33.157) To BLUPR0701MB1604.namprd07.prod.outlook.com (25.163.84.153) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1604;2:7sF880nhrBJAHi2KBZ3E0o2a8UE0RkuQG3MMVWArIzEpiYWFqGh+2SvR4M6yDskyoDbRbhN061B9jPxIvF6d2ACn5G/SUusOO60qJKFPcJPWx1CD/Kw2pXg3fsIW0DeBPaimN+RzMWSdeyGFOt7IMtIJ94GaCHEHmTPHgv9BSeA=;3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/I9/E5HUKoOnaU2PT4tM/yU6PflPyjUrQBZURMxNsWkY4Byc4YPY75oYRiPK3cx/BU/OrsqfM=;4:CV1SwJymWL2nLmqoZpufSbEI2ZQLf07nIQj0H56ObgmGYU7dQZm0WUnvaKIPkbFAJXWjpp2ARaroNY42O0XjkEJ/H59unayXpkHliz8fB69bWKshu4HeJehxBELSYa4puoKKf3qVkm09Ux546Hf416NPX0KABsGImxjiENTST6DRvzR97tMVxzINcXmVDbv2nhkKj1VH0nkeEdCDirn9S6c70B5FFRy4f/W0g4Xk9OHJ/bpMo4nCA2767Ql9vHH/IEqspwYWCo4F50VtAnbqiAl/jRni9o//PxuJ4QQ5Y84= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BLUPR0701MB1604;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1604; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(199003)(189002)(76104003)(24454002)(479174004)(164054003)(87976001)(92566002)(46406003)(19580395003)(97756001)(19580405001)(46102003)(23726002)(575784001)(86362001)(2950100001)(68736005)(5001830100001)(5001960100002)(77096005)(4001540100001)(4001350100001)(93886004)(97736004)(110136002)(5001860100001)(33656002)(81156007)(40100003)(66066001)(122386002)(64706001)(50986999)(83506001)(76176999)(62966003)(54356999)(105586002)(76506005)(106356001)(42186005)(77156002)(50466002)(189998001)(47776003)(101416001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1604;H:rric.localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1604;23:/0VHbwEKahxZqkecxCFEqygqibOeovsllWY9lA2?= =?us-ascii?Q?KqTh4KdvzfLz+iC7mi6TlP5QdEVtKo9aL2zypbhGVavZd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ULW5BWGPn3B8rsZHrVwwETqoQPLGM3LxAjeNaK?= =?us-ascii?Q?ND4ikpKPVvaHWO3wV5T3kuJDs1wrW6sa3va4W5L/GrklpUih1VCCOxxMR1n2?= =?us-ascii?Q?8OX4lIecMrqH6rEpavorlCpKL5Q1LrUFLuXpFRjKG770IxvilwZbUK329CH5?= =?us-ascii?Q?mo8x+xxDWTOmPB5USsywZP569rJchBbIBdgSS3UZoD/VZAPvoT6aI8zbhvzN?= =?us-ascii?Q?cznaW/SX6kjD/0Y10JmC2qc/CnmALgXhUjpVlgRiZE+hS50SWxcr/oNwn2Od?= =?us-ascii?Q?TZhi1niRLY7WeR9kiB/wk0a3INZxQX4hw/SIIOaTs?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1604;5:t7cxEkCeil6+S8SkSH+QtnW2ls7jUzFw9uEiqfjbmpG57b3ExzRuq28v5oz4yzurJjF8kvz+Uk/f+FICNzrzfUhWSycNMrbmVXuDcrbpW15xHO+JWiRW7nQ/P8zPG+WshRUoUfeiB6d27n4uPKAZHQ==;24:r+1oybp+yOHXWKTKGMgHuKTz3yq+nsE6HuXfodbJ/OXxbfObVGfNZciq6w59LNOR2h+ORG/7EEVG89nL6kVE3e98OdYDSFLDUwqhdiXRJgA=;20:iCfXEV4qQPS27kmpX6OX5rGJ6FzkF9m+TFwm1zdqrEXcO3mNdlDzuMAE1jC8+XxAYjeZ9RaIrR9GUV3N4aidAA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2015 11:48:05.7542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1604 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3982 Lines: 99 On 14.08.15 09:28:12, Marc Zyngier wrote: > On 13/08/15 18:11, Robert Richter wrote: > > On 13.08.15 17:54:41, Marc Zyngier wrote: > >> On 13/08/15 17:17, Robert Richter wrote: > >>> Marc, > >>> > >>> thanks for your quick review. > >>> > >>> On 13.08.15 16:11:15, Marc Zyngier wrote: > >>>> On 13/08/15 15:47, Robert Richter wrote: > >>>>> From: Robert Richter > >>> > >>>>> static const struct gic_capabilities gicv3_errata[] = { > >>>>> { > >>>>> + .desc = "GIC: Cavium erratum 23154", > >>>>> + .iidr = 0xa100034c, /* ThunderX pass 1.x */ > >>>>> + .iidr_mask = 0xffff0fff, > >>>>> + .init = gicv3_enable_cavium_thunderx, > >>>>> + }, > >>>> > >>>> I'm even more puzzled. You're working around a CPU bug based on the ITS > >>>> ID registers? Or have you swapped the detection methods for the two errata? > >>> > >>> :/ Right, I mixed this up... Must have starred on this for too long. > >>> Will fix that. > >>> > >>> Wrt midr: Originally this was written to support iidr. I wanted to > >>> keep the version check in the driver of the hw, an implementation > >>> outside of drivers/irqchip looked not appropriate here as it would > >>> rely then on arch arm64 only. This is the main reason. Apart from > >>> that, I think an implmentation based on struct arm64_cpu_capabilities, > >>> etc. would require much rework compared to my current easy > >>> implementation, e.g: > >>> > >>> * binding flags to callbacks and actually run them, > >>> > >>> * handing over private driver data (base addr for iidr detection) to > >>> a capabilty's match function. > >>> > >>> Overall this looked bloated. Now, that the MIDR also needs to be > >>> checked, it looked better to me to keep the gic hw detection at a > >>> single location in the driver. This also allows us to check a > >>> combination of midr and iidr values. > >>> > >>> I hope this sounds reasonable? > >> > >> +Will. > >> > >> The point I was trying to make is that a CPU interface bug is a CPU bug, > >> and that it feels quite weird weird to have the detection in the GIC. > >> Will, what do you think? > >> > >> Also, I don't really buy the combined MIDR/GITS_IIDR detection. These > >> are two *very* distinct pieces of HW that are not even directly > >> connected (the redistributors are in between). > >> > >> I wouldn't mind having something like: > >> > >> struct gic_capabilities { > >> const char *desc; > >> void (*init)(void *data); > >> u32 iidr; > >> u32 iidr_mask; > >> int feature; > >> }; > > > > Yes, once we leave this in the driver it is much easier. But why do > > the read_cpuid_id() in cpu_errata.c and not in his file? The > > value/mask pairs will be then on complete different locations for the > > same kind of hw depending on midr/iidr. And the only reason for using > > midr is not, that it's a cpu, but just that it needs to be applied to > > guests too and this is the only way to find out the real hw, otherwise > > we would use iidr. > > But that's the thing! Using GITS_IIDR would be the complete wrong thing > to check for a CPU interface, which is what your ICC_IAR1_EL1 workaround > is about. > > > Apart from the fact that this looks inconsistent > > having one errata^Mfeature flag for one errata, but not for the > > other. And only because one is useing midr for hw detection and the > > other iidr. > > Because they are architecturally two different things. I strongly > suspect that you could take the ThunderX core, remove Cavium's own > implementation of the GIC and slap another GIC implementation in front > of it, and you would have the exact same CPU interface bug, because > that's where the issue is. Ok, I am going to send an update based on your suggestions. Thanks, -Robert -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/