Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-03 Thread Ingo Molnar
* Brown, Len wrote: > > This driver only knows how to handle counters, though. I'm not sure > > whether all of the MSRs that turbostat needs are counters. > > turbostat --debug > dumps a lot of configuration MSRs that are not counters. > > "--debug" is not an obscure option, it is the only

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-03 Thread Ingo Molnar
* Brown, Len len.br...@intel.com wrote: This driver only knows how to handle counters, though. I'm not sure whether all of the MSRs that turbostat needs are counters. turbostat --debug dumps a lot of configuration MSRs that are not counters. --debug is not an obscure option, it is the

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread Andy Lutomirski
On Thu, Jul 2, 2015 at 12:22 PM, H. Peter Anvin wrote: > On 07/01/2015 09:38 AM, Brown, Len wrote: >> >> BTW. I've had a discussion w/ LLNL about their needs, >> both for security and performance. For security, as concluded >> by this thread, a white list is the only way to go. >> I'm thinking a

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread H. Peter Anvin
On 07/01/2015 09:38 AM, Brown, Len wrote: > > BTW. I've had a discussion w/ LLNL about their needs, > both for security and performance. For security, as concluded > by this thread, a white list is the only way to go. > I'm thinking a bit-vector of allowed MSR offsets... > For performance, they

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread Ingo Molnar
* Andy Lutomirski wrote: > On Wed, Jul 1, 2015 at 9:38 AM, Brown, Len wrote: > > > BTW. I've had a discussion w/ LLNL about their needs, both for security and > > performance. For security, as concluded by this thread, a white list is > > the > > only way to go. I'm thinking a bit-vector

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread Ingo Molnar
* Andy Lutomirski l...@amacapital.net wrote: On Wed, Jul 1, 2015 at 9:38 AM, Brown, Len len.br...@intel.com wrote: BTW. I've had a discussion w/ LLNL about their needs, both for security and performance. For security, as concluded by this thread, a white list is the only way to go.

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread H. Peter Anvin
On 07/01/2015 09:38 AM, Brown, Len wrote: BTW. I've had a discussion w/ LLNL about their needs, both for security and performance. For security, as concluded by this thread, a white list is the only way to go. I'm thinking a bit-vector of allowed MSR offsets... For performance, they

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-02 Thread Andy Lutomirski
On Thu, Jul 2, 2015 at 12:22 PM, H. Peter Anvin h...@zytor.com wrote: On 07/01/2015 09:38 AM, Brown, Len wrote: BTW. I've had a discussion w/ LLNL about their needs, both for security and performance. For security, as concluded by this thread, a white list is the only way to go. I'm

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-01 Thread Andy Lutomirski
On Wed, Jul 1, 2015 at 9:38 AM, Brown, Len wrote: > BTW. I've had a discussion w/ LLNL about their needs, > both for security and performance. For security, as concluded > by this thread, a white list is the only way to go. > I'm thinking a bit-vector of allowed MSR offsets... > For performance,

RE: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-01 Thread Brown, Len
> This driver only knows how to handle counters, though. I'm not sure > whether all of the MSRs that turbostat needs are counters. turbostat --debug dumps a lot of configuration MSRs that are not counters. "--debug" is not an obscure option, it is the only way that the turbostat is used by

RE: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-01 Thread Brown, Len
This driver only knows how to handle counters, though. I'm not sure whether all of the MSRs that turbostat needs are counters. turbostat --debug dumps a lot of configuration MSRs that are not counters. --debug is not an obscure option, it is the only way that the turbostat is used by advanced

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-07-01 Thread Andy Lutomirski
On Wed, Jul 1, 2015 at 9:38 AM, Brown, Len len.br...@intel.com wrote: BTW. I've had a discussion w/ LLNL about their needs, both for security and performance. For security, as concluded by this thread, a white list is the only way to go. I'm thinking a bit-vector of allowed MSR offsets...

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Prarit Bhargava
On 06/30/2015 08:44 AM, Peter Zijlstra wrote: > On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: >> it seems like visiting changes on each of these packages (and the other >> packages that I'm sure I've missed) will be moderately difficult. >> >> Thoughts? > > Start by changing

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Ingo Molnar
* Peter Zijlstra wrote: > On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: > > it seems like visiting changes on each of these packages (and the other > > packages that I'm sure I've missed) will be moderately difficult. > > > > Thoughts? > > Start by changing the ones users

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Peter Zijlstra
On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: > it seems like visiting changes on each of these packages (and the other > packages that I'm sure I've missed) will be moderately difficult. > > Thoughts? Start by changing the ones users want to run most and leave the rest

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Prarit Bhargava
The MSR exposure seems to be okay with the following statements: - complete read of /dev/cpu/X/msr is bad, whitelist instead - needs to be dependent on either CPU version or reading MSRs for support. IIRC the Intel documentaton on the MSRs indicated that there are ways to check to see if a

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Prarit Bhargava
The MSR exposure seems to be okay with the following statements: - complete read of /dev/cpu/X/msr is bad, whitelist instead - needs to be dependent on either CPU version or reading MSRs for support. IIRC the Intel documentaton on the MSRs indicated that there are ways to check to see if a

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Ingo Molnar
* Peter Zijlstra pet...@infradead.org wrote: On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: it seems like visiting changes on each of these packages (and the other packages that I'm sure I've missed) will be moderately difficult. Thoughts? Start by changing the

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Peter Zijlstra
On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: it seems like visiting changes on each of these packages (and the other packages that I'm sure I've missed) will be moderately difficult. Thoughts? Start by changing the ones users want to run most and leave the rest requiring

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-30 Thread Prarit Bhargava
On 06/30/2015 08:44 AM, Peter Zijlstra wrote: On Tue, Jun 30, 2015 at 08:20:55AM -0400, Prarit Bhargava wrote: it seems like visiting changes on each of these packages (and the other packages that I'm sure I've missed) will be moderately difficult. Thoughts? Start by changing the ones

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread H. Peter Anvin
On 06/28/2015 07:34 AM, Prarit Bhargava wrote: >> >> Seriously, though, it would be straightforward to make it handle a >> more general list, complete with non-architectural stuff (such as the >> upcoming PPERF in Skylake). > > Is it easier to blacklist MSRs we don't want generally exposed, or

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread Matt Fleming
On Sun, 28 Jun, at 12:10:49PM, Henrique de Moraes Holschuh wrote: > On Sun, 28 Jun 2015, Prarit Bhargava wrote: > > Is it easier to blacklist MSRs we don't want generally exposed, or only > > expose > > the ones that we think are safe? That's sort of a devil's advocate sort of > > question ;)

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread Ingo Molnar
* Henrique de Moraes Holschuh wrote: > On Sun, 28 Jun 2015, Prarit Bhargava wrote: > > > Is it easier to blacklist MSRs we don't want generally exposed, or only > > expose > > the ones that we think are safe? That's sort of a devil's advocate sort of > > question ;) and I'm wondering what

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread Matt Fleming
On Sun, 28 Jun, at 12:10:49PM, Henrique de Moraes Holschuh wrote: On Sun, 28 Jun 2015, Prarit Bhargava wrote: Is it easier to blacklist MSRs we don't want generally exposed, or only expose the ones that we think are safe? That's sort of a devil's advocate sort of question ;) and I'm

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread H. Peter Anvin
On 06/28/2015 07:34 AM, Prarit Bhargava wrote: Seriously, though, it would be straightforward to make it handle a more general list, complete with non-architectural stuff (such as the upcoming PPERF in Skylake). Is it easier to blacklist MSRs we don't want generally exposed, or only expose

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-29 Thread Ingo Molnar
* Henrique de Moraes Holschuh h...@hmh.eng.br wrote: On Sun, 28 Jun 2015, Prarit Bhargava wrote: Is it easier to blacklist MSRs we don't want generally exposed, or only expose the ones that we think are safe? That's sort of a devil's advocate sort of question ;) and I'm wondering

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Henrique de Moraes Holschuh
On Fri, 26 Jun 2015, Prarit Bhargava wrote: > > The proper way to do this is to write a driver to only expose the MSRs > > that the user tools need, and nothing else. > > Will do -- At least I got everyone's attention with this :). IMHO we need both a new driver that exposes semanthic

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Henrique de Moraes Holschuh
On Sun, 28 Jun 2015, Prarit Bhargava wrote: > Is it easier to blacklist MSRs we don't want generally exposed, or only expose > the ones that we think are safe? That's sort of a devil's advocate sort of > question ;) and I'm wondering what the shorter list is. The only way to make MSR access safe

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Prarit Bhargava
On 06/27/2015 11:52 AM, Andy Lutomirski wrote: > On Sat, Jun 27, 2015 at 1:39 AM, Ingo Molnar wrote: >> >> * Ingo Molnar wrote: >> >>> So what's wrong with exposing them as a simplified PMU driver? >>> >>> That way we only expose the ones we want to - plus tooling can use all the >>> rich >>>

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Henrique de Moraes Holschuh
On Sun, 28 Jun 2015, Prarit Bhargava wrote: Is it easier to blacklist MSRs we don't want generally exposed, or only expose the ones that we think are safe? That's sort of a devil's advocate sort of question ;) and I'm wondering what the shorter list is. The only way to make MSR access safe is

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Prarit Bhargava
On 06/27/2015 11:52 AM, Andy Lutomirski wrote: On Sat, Jun 27, 2015 at 1:39 AM, Ingo Molnar mi...@kernel.org wrote: * Ingo Molnar mi...@kernel.org wrote: So what's wrong with exposing them as a simplified PMU driver? That way we only expose the ones we want to - plus tooling can use all

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-28 Thread Henrique de Moraes Holschuh
On Fri, 26 Jun 2015, Prarit Bhargava wrote: The proper way to do this is to write a driver to only expose the MSRs that the user tools need, and nothing else. Will do -- At least I got everyone's attention with this :). IMHO we need both a new driver that exposes semanthic functionality

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Andy Lutomirski
On Sat, Jun 27, 2015 at 1:39 AM, Ingo Molnar wrote: > > * Ingo Molnar wrote: > >> So what's wrong with exposing them as a simplified PMU driver? >> >> That way we only expose the ones we want to - plus tooling can use all the >> rich >> perf features that can be used around this. (sampling,

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Ingo Molnar
* Ingo Molnar wrote: > So what's wrong with exposing them as a simplified PMU driver? > > That way we only expose the ones we want to - plus tooling can use all the > rich > perf features that can be used around this. (sampling, counting, call chains, > etc.) See below code from Andy that

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Ingo Molnar
* Prarit Bhargava wrote: > Customers write system monitoring software for single systems as well as > clusters. In load-balancing software it is useful to know how "busy" a > core is. Unfortunately the only way to get this data is to run as root, > or use setcap to allow userspace access for

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Ingo Molnar
* Prarit Bhargava pra...@redhat.com wrote: Customers write system monitoring software for single systems as well as clusters. In load-balancing software it is useful to know how busy a core is. Unfortunately the only way to get this data is to run as root, or use setcap to allow userspace

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Ingo Molnar
* Ingo Molnar mi...@kernel.org wrote: So what's wrong with exposing them as a simplified PMU driver? That way we only expose the ones we want to - plus tooling can use all the rich perf features that can be used around this. (sampling, counting, call chains, etc.) See below code from

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-27 Thread Andy Lutomirski
On Sat, Jun 27, 2015 at 1:39 AM, Ingo Molnar mi...@kernel.org wrote: * Ingo Molnar mi...@kernel.org wrote: So what's wrong with exposing them as a simplified PMU driver? That way we only expose the ones we want to - plus tooling can use all the rich perf features that can be used around

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Prarit Bhargava
On 06/26/2015 03:23 PM, Brian Gerst wrote: > On Fri, Jun 26, 2015 at 1:52 PM, Prarit Bhargava wrote: >> Customers write system monitoring software for single systems as well as >> clusters. In load-balancing software it is useful to know how "busy" a >> core is. Unfortunately the only way to

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Brian Gerst
On Fri, Jun 26, 2015 at 1:52 PM, Prarit Bhargava wrote: > Customers write system monitoring software for single systems as well as > clusters. In load-balancing software it is useful to know how "busy" a > core is. Unfortunately the only way to get this data is to run as root, > or use setcap

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread H. Peter Anvin
On 06/26/2015 10:52 AM, Prarit Bhargava wrote: > > This patch allows read access to the msr dev files which should be okay. > No damage can be done by reading the MSR values and it allows non-root > users to run system monitoring software. > I don't believe that is true. -hpa -- To

[PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Prarit Bhargava
Customers write system monitoring software for single systems as well as clusters. In load-balancing software it is useful to know how "busy" a core is. Unfortunately the only way to get this data is to run as root, or use setcap to allow userspace access for particular programs. Both of these

[PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Prarit Bhargava
Customers write system monitoring software for single systems as well as clusters. In load-balancing software it is useful to know how busy a core is. Unfortunately the only way to get this data is to run as root, or use setcap to allow userspace access for particular programs. Both of these

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread H. Peter Anvin
On 06/26/2015 10:52 AM, Prarit Bhargava wrote: This patch allows read access to the msr dev files which should be okay. No damage can be done by reading the MSR values and it allows non-root users to run system monitoring software. I don't believe that is true. -hpa -- To

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Prarit Bhargava
On 06/26/2015 03:23 PM, Brian Gerst wrote: On Fri, Jun 26, 2015 at 1:52 PM, Prarit Bhargava pra...@redhat.com wrote: Customers write system monitoring software for single systems as well as clusters. In load-balancing software it is useful to know how busy a core is. Unfortunately the only

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Brian Gerst
On Fri, Jun 26, 2015 at 1:52 PM, Prarit Bhargava pra...@redhat.com wrote: Customers write system monitoring software for single systems as well as clusters. In load-balancing software it is useful to know how busy a core is. Unfortunately the only way to get this data is to run as root, or