Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753321AbbHMRMR (ORCPT ); Thu, 13 Aug 2015 13:12:17 -0400 Received: from mail-bl2on0078.outbound.protection.outlook.com ([65.55.169.78]:5138 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753040AbbHMRMM (ORCPT ); Thu, 13 Aug 2015 13:12:12 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@caviumnetworks.com; Date: Thu, 13 Aug 2015 19:11:50 +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: <20150813171150.GB4914@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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <55CCCBD1.2090304@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.224.194.112] X-ClientProxiedBy: HE1PR02CA0054.eurprd02.prod.outlook.com (25.163.170.22) To CY1PR0701MB1613.namprd07.prod.outlook.com (25.163.20.150) X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1613;2:YpM2QfNci7F1tSjN52igtCBsSUgDyGxfe37a6Py6VCkD1XGngT/nssLawMYOu0dnin9droAcRI4yQJClVvG5OzKzesmRpqjWIEkSxIp8LUjSN6+yjCZ4B0ASZrI6InWFDQY4lenR9DDzAUQ0L5sUrbwJV/YHqEGlD3YFlNPB0rU=;3:7QOgmMeREgcUtSLlYKj8pOZK/AEO3nWf0AVWOeo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RxRozs3ayBHuckH5BykkZc5FcPY=;4:w84CGwg3RRskv2rgxvJPgEYgZaMsxBH1N2S0Gyi3SYUZB2jaJ4J+cggB4FNEjhu3IhY2/i6uD5GuKEUhNd8afrdR+Sd3GCsQgPFUbE1dYSRw4eESefyeMhkAlYgI9LM5Pn7pS5EbMi0xcC8KZILWZl5lfaKMQLnC40+bCkHOzyMf0oolRL4P3PzUnOYyWIizN8y5/sizN/5Nq436/BeNO38XWd03tvV0rK6cQpmohSYFY/1ruRlwnlEnVDrOuweWD2nHs/apKaTlk7ZC7aQdjyOta01Xd+40Sg2VpNR2vvs= 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:CY1PR0701MB1613;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1613; X-Forefront-PRVS: 0667289FF8 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(479174004)(164054003)(199003)(76104003)(24454002)(189002)(46406003)(76506005)(23726002)(42186005)(33656002)(97736004)(4001350100001)(4001540100001)(5001960100002)(5001830100001)(47776003)(64706001)(110136002)(106356001)(46102003)(105586002)(81156007)(50466002)(87976001)(189998001)(77156002)(575784001)(93886004)(86362001)(5001860100001)(62966003)(66066001)(83506001)(2950100001)(92566002)(101416001)(50986999)(77096005)(54356999)(97756001)(40100003)(68736005)(19580405001)(122386002)(19580395003)(76176999);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1613;H:rric.localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1613;23:ShAnmIQwDTlazscK40LXwDWlEPwbaoqjeKBIsfp?= =?us-ascii?Q?BE2Dh5SepMY1wr2jyIA0ouF2y4fbkxXCXm3QLH4rSWdq5d2j7x1+9i259T9g?= =?us-ascii?Q?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Z9dd28fevt?= =?us-ascii?Q?bmb5PnjP0Ckm/ya0gIDrAJQZCHqvXb2ibQN0ORnY/QIanni2/CDBAwZ+zOHU?= =?us-ascii?Q?hB9OATMsD6J3KAOn0SKPvrVCjyZIRXFq8ioKLGbCVKDJPXq3XqZtTEjOQvfj?= =?us-ascii?Q?dqOBza5iLS/vL/ie0xWHV1eWYSzy65LxBUGn4sfQGtA+hN5IEsXNANGhnJV5?= =?us-ascii?Q?xPV1X41YmnZwo/hayRJBVfQCLYSlQ+0FoaUX8cW7gmi1WLleqLgCFTneCW4L?= =?us-ascii?Q?RY5/r2Ka9Aidyy/LspCepb1HMe/fusvGXZgcwKtLy?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1613;5:jj0epLRdOFLGutJ4tQbrGaeZvZDtDIsKi4njLYojFyGWYTitU06kHXwAfpi2HpVGhO7XkZDSFGpEFcd3+6XI4V08PRee1owQ3pAj8d6tcUb1qokYtACj0FONsA+vvaws2t5As8CEee9UvymNL5kHvA==;24:REsYDsGmbzNSFeRZwiHSkmy7az6XF3rslqaKmsIH56O+5+tFueCOSHczGSl2ITqa4xQ28k/GMXwYSvAk5ZiMsLgKQL+jUtb+S65bRNdn1ZQ=;20:zDF7WtQ6GFEKjob9NwD9verMgtXuGJNg3GDPQTfD0l/Le4hgdLe2soZF/IRxQ1ydX/eJfqVq/UVgorpv0BDfpw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2015 17:12:00.6151 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1613 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3584 Lines: 97 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. 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. > where "feature" is a one of things declared in cpufeature.h, and that > would condition the capability (I love the name!) if that really > happens. I don't think we're there yet. Yeah, some "Newspeak". :) -Robert > > As for the complexity of implementation, testing a flag in the probe > function and tingling a static key is not really a big deal. > > Thanks, > > M. > -- > Jazz is not dead. It just smells funny... -- 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/