Re: [PATCH] perf, x86: Disable perf if the BIOS got its grubbypaws on the PMU

From: Peter Zijlstra
Date: Fri Sep 03 2010 - 10:46:34 EST


On Fri, 2010-09-03 at 09:32 -0500, Matt Domsch wrote:
> On Fri, Sep 03, 2010 at 06:53:59AM -0700, Arjan van de Ven wrote:
> > On 9/3/2010 2:13 AM, Peter Zijlstra wrote:
> > >
> > >+static void print_BIOS_fail(void)
> > >+{
> > >+ printk(KERN_ERR "\n");
> > >+ printk(KERN_ERR "=============================================\n");
> > >+ printk(KERN_ERR "It appears the BIOS is actively using the PMU\n");
> > >+ printk(KERN_ERR "this avoids Linux from using it, please de- \n");
> > >+ printk(KERN_ERR "activate this BIOS feature or request a BIOS \n");
> > >+ printk(KERN_ERR "update from your vendor. \n");
> > >+ printk(KERN_ERR "=============================================\n");
> > >+
> > >+ memset(&x86_pmu, 0, sizeof(x86_pmu));
> > >+}

> I must object to messages that repeatedly (at least on every boot)
> tell system administrators to contact their hardware vendor's support
> lines, when it's not clear what the BIOS is doing is incorrect.

It is using the PMU, it should not _ever_ do that.

> There
> are plenty of valid reasons why BIOS itself would use PMU counters.
> Dell PowerEdge server power management, handled by the BIOS, certainly
> does use one.

Them make them stop doing that, or at least provide a BIOS option to
disable this Feat^WFailure-add.

An no, doing power-management from the BIOS is most certainly not a
valid reason. That's not what BIOSes are for, a BIOS should bring up the
system and then sod off.

> My understanding is that there is a mechanism for the OS to request
> BIOS to release use of PMU counters. Are we doing that?

I'm not aware of any such thing. The Intel Arch docs most certainly
don't specify anything about that.

> If BIOS does
> not release the counters when asked, ok, that's something to
> (potentially) warn about. But blanket "BIOS is using a CPU feature!
> Bad BIOS! No treat for you!" - that's not helpful to anyone.

Again, I'm not aware there is a spec on how to ask anything of the BIOS,
let alone a part pertaining to PMU functionality.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/