From: Borislav Petkov <bp@alien8.de>
To: "Mcfadden, Marty Jay" <mcfadden8@llnl.gov>
Cc: George Spelvin <linux@horizon.com>,
"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
"acme@infradead.org" <acme@infradead.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"brgerst@gmail.com" <brgerst@gmail.com>,
"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
"dyoung@redhat.com" <dyoung@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"jolsa@redhat.com" <jolsa@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"luto@kernel.org" <luto@kernel.org>,
"mingo@kernel.org" <mingo@kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"pavel@ucw.cz" <pavel@ucw.cz>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"x86@kernel.org" <x86@kernel.org>,
"yu.c.chen@intel.com" <yu.c.chen@intel.com>
Subject: Re: [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction
Date: Tue, 1 Mar 2016 00:41:25 +0100 [thread overview]
Message-ID: <20160229234125.GJ3724@pd.tnic> (raw)
In-Reply-To: <AEA6FC45760E2A42897809E8E402EA1E0F2CA586@PRDEXMBX-02.the-lab.llnl.gov>
On Mon, Feb 29, 2016 at 10:35:12PM +0000, Mcfadden, Marty Jay wrote:
> The examples provided were to address why bit-level access granularity
> was needed. They were not intended to be, nor are they, a comprehensive list
> of scenarios.
So which scenarios cannot be satisfied by proper implementation of
userspace APIs (sysfs, procfs, etc) and direct access to MSRs is the
only way?
> What is being proposed is to make msr.ko better with a whitelist which
> does not allow access to any MSRs be default unless you are root or
> are a user with the appropriate capability (which is how it works
> today).
That doesn't protect you from mistakenly configuring the wrong mask, as
root. A well-defined userspace interface does.
Also, as I hinted at before, you have cases where other drivers
and modules access the same MSRs as msr.ko and for that you need
synchronization. Which would then need to be added. But we're going
to be stuck with this wrong interface already and we then would be
*extending* that wrong interface. No thanks.
> System Administrators can then selectively add entries to the whitelist
> to allow userspace applications access to specified bits of specific MSRs
> of interest. This can all be done on emerging hardware before new
> updates or interfaces are added to the kernel.
Emerging hardware uses specialized hw bringup software - not the
upstream kernel. Or it is a heavily patched beyond recognition ancient
upstream kernel. And to that kernel people can do whatever they want.
> Keeping msr.ko around and adding a whitelist mechanism will provide a
> safe means for developers to experiment with MSR sets in their to
> squeeze out performance and power and possibly inform future features
> of modules like the rapl driver.
This can be done with msr.ko now too.
So no one is removing msr.ko. I'm saying extending it is the wrong
approach. msr.ko is a simple debugging module. Nothing more. Everything
else which is going to be user-visible and widely used, needs to be safe
and clean. Exposing MSRs directly is not. It might be useful for some
niche HPC use cases but is not nearly clean, safe and generic enough for
a userspace API which we will have to support forever.
And the fact that a bunch of tools are already using it is wrong. They
shouldn't. They should use proper, safe user APIs and not poke at MSRs
directly.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
next prev parent reply other threads:[~2016-02-29 23:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 0:02 [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction Marty McFadden
2016-02-26 0:02 ` [PATCH 1/4] MSR: Prep for separating msr.c into three files Marty McFadden
2016-02-26 2:56 ` kbuild test robot
2016-02-26 10:08 ` Andy Shevchenko
2016-02-26 0:02 ` [PATCH 2/4] " Marty McFadden
2016-02-26 0:02 ` [PATCH 3/4] MSR: msr Whitelist Implementation Marty McFadden
2016-02-26 1:05 ` kbuild test robot
2016-02-26 1:05 ` [PATCH] MSR: fix badzero.cocci warnings kbuild test robot
2016-02-26 0:02 ` [PATCH 4/4] MSR: msr Batch processing feature Marty McFadden
2016-02-26 2:48 ` Andy Lutomirski
2016-03-03 17:21 ` One Thousand Gnomes
2016-03-03 23:09 ` Mcfadden, Marty Jay
2016-02-26 7:37 ` [PATCH 0/4] MSR: MSR: MSR Whitelist and Batch Introduction Ingo Molnar
2016-02-28 18:54 ` Mcfadden, Marty Jay
2016-02-28 19:01 ` Borislav Petkov
2016-02-29 2:55 ` Mcfadden, Marty Jay
2016-02-29 14:58 ` Borislav Petkov
2016-02-29 16:31 ` Henrique de Moraes Holschuh
2016-02-29 17:22 ` Borislav Petkov
2016-02-29 17:53 ` George Spelvin
2016-02-29 18:20 ` Borislav Petkov
2016-02-29 22:35 ` Mcfadden, Marty Jay
2016-02-29 23:41 ` Borislav Petkov [this message]
2016-03-01 19:01 ` Rountree, Barry L.
2016-03-03 0:40 ` Andy Lutomirski
2016-03-01 8:02 ` Thomas Gleixner
2016-03-01 18:29 ` Rountree, Barry L.
2016-03-01 18:38 ` Borislav Petkov
2016-02-29 17:17 ` Andy Lutomirski
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=20160229234125.GJ3724@pd.tnic \
--to=bp@alien8.de \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgerst@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dyoung@redhat.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
--cc=luto@kernel.org \
--cc=mcfadden8@llnl.gov \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=pavel@ucw.cz \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox