Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932532Ab2FHNyn (ORCPT ); Fri, 8 Jun 2012 09:54:43 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58493 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932082Ab2FHNym (ORCPT ); Fri, 8 Jun 2012 09:54:42 -0400 Subject: Re: [PATCH] perf/x86: check ucode before disabling PEBS on SandyBridge From: Peter Zijlstra To: Borislav Petkov Cc: Ingo Molnar , Stephane Eranian , linux-kernel@vger.kernel.org, andi@firstfloor.org, mingo@elte.hu, ming.m.lin@intel.com, Andreas Herrmann , Dimitri Sivanich , Dmitry Adamushko In-Reply-To: <20120608135117.GB31359@aftab.osrc.amd.com> References: <20120607071531.GA4849@quad> <1339064319.23343.13.camel@twins> <1339065932.23343.18.camel@twins> <1339067757.23343.21.camel@twins> <20120608093513.GA22520@gmail.com> <1339149613.23343.52.camel@twins> <1339161972.2507.13.camel@laptop> <20120608135117.GB31359@aftab.osrc.amd.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 08 Jun 2012 15:54:29 +0200 Message-ID: <1339163669.2507.16.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 31 On Fri, 2012-06-08 at 15:51 +0200, Borislav Petkov wrote: > Reportedly, there are some obscure systems which need different > microcode versions per CPU: > > http://lkml.indiana.edu/hypermail/linux/kernel/1105.3/01010.html *groan*,.. ok. > > The biggest problem is finding when the minimum revision changes, at > > best this is a n log n sorting problem due to the per-cpu setup, but I > > couldn't be arsed to implement a tree or anything fancy since it all > > stinks anyway. > > I know. Can't you just iterate over all CPUs and collect the lowest > ucode version? Provided, of course, newer microcode versions means a > higher version number. That's what I do.. but that's O(n) per cpu, so if you update all cpus, that's O(n^2). You don't know when userspace is done updating the 'last' cpu, so you have to scan all cpus for every cpu. I'm sure the SGI people with their silly CPU counts aren't too thrilled to have this. -- 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/