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

Borislav Petkov
2012-06-12T20:10:09Z

On Tue, Jun 12, 2012 at 07:40:43PM +0200, Peter Zijlstra wrote:
> How so? afaict there's nothing stopping it from working.

I spoke too soon. It works but only if you have a
newer-than-whats-on-the-system microcode image file. IOW, you need to
move the microcode image away so that the ucode driver doesn't find it,
boot, then move it back to /lib/firmware and do the reload thing through
sysfs.

Last time I tried this, the microcode got already updated during boot
and so the loading path didn't find a newer image, leading me to think
the interface didn't work and I didn't dig deeper as to why it didn't.

Which means that I definitely need to disable this on AMD. I'll try to
cook up something...

> Ideally this interface should be removed, but yeah. As long as its there
> you have to check all CPUs, because officially supported or not simply
> doesn't matter, the user can do it.
>
> Also, you can create a pebs event while updating micro-code. There's a
> race window there if you don't check all cpus.

Oh man, this is just nasty.

Ok, we could probably make the notifier functionality dependent on
whether the ucode driver for a vendor supports the reload_store
interface and thus single cpu ucode updates. If it doesn't, no need to
run the notifier per cpu but then the story with the race window is
still unsolved.

I need to sleep on it.

--
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