From: Prarit Bhargava <prarit@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
Ingo Molnar <mingo@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, X86 ML <x86@kernel.org>,
Len Brown <len.brown@intel.com>,
Dasaratharaman Chandramouli
<dasaratharaman.chandramouli@intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Borislav Petkov <bp@alien8.de>, Andy Lutomirski <luto@kernel.org>,
Denys Vlasenko <dvlasenk@redhat.com>,
Brian Gerst <brgerst@gmail.com>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Matt Fleming <matt@codeblueprint.co.uk>
Subject: Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr
Date: Tue, 30 Jun 2015 08:20:55 -0400 [thread overview]
Message-ID: <559289A7.3040500@redhat.com> (raw)
In-Reply-To: <5591A1D3.6010003@zytor.com>
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 particular MSR is supported by a processor. That doesn't
seem difficult to do IMO.
Here are the options that have been discussed in this thread, as well as a
third that I'm proposing:
1. Andy's PMU driver suggestion (eventually exposed via sysfs)
2. Standalone driver (LLNL) which exposes values in sysfs (one value per
sysfs file)
3. Make /dev/cpu/X/msr readable for those addresses in the whitelist.
ie) Allow read access to address for IA32_MPERF, etc.
I find exposing MSRs via sysfs difficult to maintain as we move forward.
I suppose we could name them according to their MSR names in the Intel
documentation, however from a userspace point of view I still find it
cumbersome to code that way. Doing this in the existing /dev/ space has the
benefit that we wouldn't have to change any userspace code. For
those users who did (in some crazy situation) want full read access, they can
still do 'setcap' on that particular executable.
Using Henrique's list of packages that use /dev/cpu/X/msr,
* cpufrequtils
* flashrom
* i7z
* intel-gpu-tools
* inteltool
* mcelog
* msrtool, msr-tools
* PAPI (can use msr_safe)
* powertop
* qemu
* slurm-llnl (maybe this can also use msr_safe?)
* stressapptest
* turbostat
* wmlongrun, longrun
* x86info
* xserver-xorg-video-geode
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?
P.
next prev parent reply other threads:[~2015-06-30 12:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 17:52 [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr Prarit Bhargava
2015-06-26 18:45 ` H. Peter Anvin
2015-06-26 19:23 ` Brian Gerst
2015-06-26 21:26 ` Prarit Bhargava
2015-06-28 15:13 ` Henrique de Moraes Holschuh
2015-06-27 8:33 ` Ingo Molnar
2015-06-27 8:39 ` Ingo Molnar
2015-06-27 15:52 ` Andy Lutomirski
2015-06-28 14:34 ` Prarit Bhargava
2015-06-28 15:10 ` Henrique de Moraes Holschuh
2015-06-29 6:42 ` Ingo Molnar
2015-06-29 10:58 ` Matt Fleming
2015-06-29 19:51 ` H. Peter Anvin
2015-06-30 12:20 ` Prarit Bhargava [this message]
2015-06-30 12:44 ` Peter Zijlstra
2015-06-30 12:57 ` Ingo Molnar
2015-06-30 13:23 ` Prarit Bhargava
2015-07-01 16:38 ` Brown, Len
2015-07-01 17:33 ` Andy Lutomirski
2015-07-02 9:15 ` Ingo Molnar
2015-07-02 19:22 ` H. Peter Anvin
2015-07-02 19:26 ` Andy Lutomirski
2015-07-03 7:42 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559289A7.3040500@redhat.com \
--to=prarit@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dasaratharaman.chandramouli@intel.com \
--cc=dvlasenk@redhat.com \
--cc=hmh@hmh.eng.br \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.