[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151204082823.GA31591@gmail.com>
Date: Fri, 4 Dec 2015 09:28:23 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>, Amy Wiles <amy.l.wiles@...el.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] x86/rapl: Do not load in a guest
* Peter Zijlstra <peterz@...radead.org> wrote:
> On Fri, Dec 04, 2015 at 08:42:06AM +0100, Ingo Molnar wrote:
> >
> > * Borislav Petkov <bp@...en8.de> wrote:
> >
> > > From: Borislav Petkov <bp@...e.de>
> > >
> > > qemu/kvm doesn't support RAPL and RAPL doesn't have a CPUID feature bit
> > > so check whether we're in a guest instead.
> >
> > So when a hypervisor starts supporting RAPL we'll disable the driver erroneously?
> >
> > Isn't there any better method to detect RAPL support?
> >
> > So in particular in drivers/powercap/intel_rapl.c there's an enumerated list of
> > CPU models, which is used via a x86_match_cpu() call. That's still not ideal (it
> > does not work on hypervisors for example), but even better would be to detect RAPL
> > support in some other fashion, that does not rely on us statically enumerating CPU
> > models that support it.
>
> RAPL isn't enumerated, the best we could do is attempt to write to one
> of the writable MSRs and see if that 'works'.
Hm, bad - writing to MSRs like that is generally dangerous.
So we should at least provide a central 'is RAPL available' call instead of
spreading multiple X86_FEATURE_HYPERVISOR checks.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists