Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1283691
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] x86/rapl: Do not load in a guest |
| Date | 2015-12-04 11:30 +0100 |
| Message-ID | <qBVMK-1pj-13@gated-at.bofh.it> (permalink) |
| References | <qBGNH-fM-13@gated-at.bofh.it> <qBThT-8cA-3@gated-at.bofh.it> <qBTUC-dS-1@gated-at.bofh.it> <qBTUD-dS-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
+ Paolo.
On Fri, Dec 04, 2015 at 09:28:23AM +0100, Ingo Molnar wrote:
> > > 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.
Well, looks like someone dropped the ball at the CPUID registrar. Other
features have more than one CPUID bit allocated to them, this one
doesn't have a single one.
And since there's no CPUID bit, I don't see any other way to detect the
RAPL presence. Poking at MSRs is a bad idea.
I wonder if we could go and allocate a bit in the kvm-emulated CPUID
leafs which says whether RAPL is supported or not.
Then we can go and check for that leaf on baremetal - if it is not
there, we do the vendor + fms check and if it is there, we know we're in
a guest and whether the guest supports it or not.
Dunno.
On the one hand, it looks like a bit too much to me.
On the other, it could be useful for other future feature checks where
we want baremetal and kvm to be synchronized wrt features and a single
method to be used by the kernel for checking features presence works
both on baremetal and virt.
Just a thought, anyway...
hpa, thoughts?
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--
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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-03 19:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-03 19:40 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-03 19:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-03 20:10 +0100
Re: [PATCH] x86/rapl: Do not load in a guest "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-04 00:10 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 00:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-04 01:40 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 08:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 09:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 11:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Paolo Bonzini <pbonzini@redhat.com> - 2015-12-04 11:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 12:00 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Ingo Molnar <mingo@kernel.org> - 2015-12-04 13:00 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 18:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Paolo Bonzini <pbonzini@redhat.com> - 2015-12-04 19:00 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 19:10 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:20 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 19:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Borislav Petkov <bp@alien8.de> - 2015-12-04 20:50 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Peter Zijlstra <peterz@infradead.org> - 2015-12-04 09:30 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-12-04 19:00 +0100
Re: [PATCH] x86/rapl: Do not load in a guest Peter Zijlstra <peterz@infradead.org> - 2015-12-04 23:20 +0100
Re: [PATCH] x86/rapl: Do not load in a guest "H. Peter Anvin" <hpa@zytor.com> - 2015-12-04 23:50 +0100
csiph-web