Re: [PATCH] perf/x86: check ucode before disabling PEBS on SandyBridge

Borislav Petkov
2012-06-08T18:05:28Z

On Fri, Jun 08, 2012 at 03:26:12PM +0200, Peter Zijlstra wrote:
> The very worst is that it does per-cpu micro-code updates, not machine
> wide. This results in it being able to have different revisions on
> different cpus. This in turn makes the below O(n^2) :/

How about this: since the ucode cannot be downgraded and since higher
ucode versions are supposed to fix current and older problems (otherwise
ucoders will get an earlfull) you shouldn't be needing to verify the
ucode version on all CPUs per-CPU, i.e. the O(n^2) overhead.

Rather, simply track which CPUs _haven't_ been updated yet, and once
this is the empty set, run the verify thing to check ucode version on
all CPUs.

And this should happen only when we update ucode from version A to
version B, where B > A.

And unless I'm missing something, this should be O(n) and ucode update
should happen very seldomly anyway.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551