Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-22 Thread Borislav Petkov
On Wed, Oct 21, 2020 at 06:11:09AM -0700, Srinivas Pandruvada wrote: > That is the problem. There is no public document. Well, considering how important this functionality has become, maybe they should be made public and maybe there should be a kernel undervolt driver, as peterz suggests. > > I

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-21 Thread Peter Zijlstra
On Tue, Oct 20, 2020 at 10:21:48AM -0700, Srinivas Pandruvada wrote: > On Mon, 2020-10-19 at 19:15 +0200, Borislav Petkov wrote: > These command id are model specific. There is no guarantee that even > meaning changes. So I don't think we should write any code in kernel > which can't stick. > >

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-21 Thread Srinivas Pandruvada
On Tue, 2020-10-20 at 12:40 -0700, Dave Hansen wrote: > On 10/20/20 11:40 AM, Srinivas Pandruvada wrote: > > On Tue, 2020-10-20 at 19:47 +0200, Borislav Petkov wrote: > > > On Tue, Oct 20, 2020 at 10:21:48AM -0700, Srinivas Pandruvada > > > wrote: > > > > These command id are model specific. There

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-20 Thread Dave Hansen
On 10/20/20 11:40 AM, Srinivas Pandruvada wrote: > On Tue, 2020-10-20 at 19:47 +0200, Borislav Petkov wrote: >> On Tue, Oct 20, 2020 at 10:21:48AM -0700, Srinivas Pandruvada wrote: >>> These command id are model specific. There is no guarantee that >>> even >>> meaning changes. So I don't think we

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-20 Thread Srinivas Pandruvada
On Tue, 2020-10-20 at 19:47 +0200, Borislav Petkov wrote: > On Tue, Oct 20, 2020 at 10:21:48AM -0700, Srinivas Pandruvada wrote: > > These command id are model specific. There is no guarantee that > > even > > meaning changes. So I don't think we should write any code in > > kernel > > which can't

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-20 Thread Borislav Petkov
On Tue, Oct 20, 2020 at 10:21:48AM -0700, Srinivas Pandruvada wrote: > These command id are model specific. There is no guarantee that even > meaning changes. So I don't think we should write any code in kernel > which can't stick. Ok, is there a common *set* of values present on all models? A

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-20 Thread Srinivas Pandruvada
On Mon, 2020-10-19 at 19:15 +0200, Borislav Petkov wrote: > On Tue, Sep 08, 2020 at 06:02:05PM -0700, Srinivas Pandruvada wrote: > > The actual OC mailbox implementation itself is implemented in Linux > > in > > intel_turbo_max_3 driver. So that is public. > > So someone can develop a driver and

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-10-19 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 06:02:05PM -0700, Srinivas Pandruvada wrote: > The actual OC mailbox implementation itself is implemented in Linux in > intel_turbo_max_3 driver. So that is public. > So someone can develop a driver and provide some sysfs to send mailbox > commands, but kernel can't

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-09 Thread Andy Lutomirski
On Tue, Sep 8, 2020 at 6:02 PM Srinivas Pandruvada wrote: > > On Tue, 2020-09-08 at 21:30 +0200, Borislav Petkov wrote: > > On Tue, Sep 08, 2020 at 12:18:38PM -0700, Sultan Alsawaf wrote: > > > I'd like to point out that on Intel's recent 14nm parts, > > > undervolting > > > is not so much for

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-09 Thread Andy Lutomirski
On Tue, Sep 8, 2020 at 3:32 PM Matthew Garrett wrote: > > On Tue, Sep 8, 2020 at 1:35 PM Andy Lutomirski wrote: > > > Undervolting is a bit different. It’s a genuinely useful configuration that > > can affect system stability. In general, I think it should be allowed, and > > it should have a

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Srinivas Pandruvada
On Tue, 2020-09-08 at 21:30 +0200, Borislav Petkov wrote: > On Tue, Sep 08, 2020 at 12:18:38PM -0700, Sultan Alsawaf wrote: > > I'd like to point out that on Intel's recent 14nm parts, > > undervolting > > is not so much for squeezing every last drop of performance out of > > the > > SoC as it is

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Matthew Garrett
On Tue, Sep 8, 2020 at 1:35 PM Andy Lutomirski wrote: > Undervolting is a bit different. It’s a genuinely useful configuration that > can affect system stability. In general, I think it should be allowed, and > it should have a real driver in tree. Agree that this should be a proper driver

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Andy Lutomirski
> On Sep 8, 2020, at 12:30 PM, Borislav Petkov wrote: > > On Tue, Sep 08, 2020 at 12:18:38PM -0700, Sultan Alsawaf wrote: >> I'd like to point out that on Intel's recent 14nm parts, undervolting >> is not so much for squeezing every last drop of performance out of the >> SoC as it is for

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 12:18:38PM -0700, Sultan Alsawaf wrote: > I'd like to point out that on Intel's recent 14nm parts, undervolting > is not so much for squeezing every last drop of performance out of the > SoC as it is for necessity. Sounds to me that this undervolting functionality should

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Sultan Alsawaf
On Tue, Sep 08, 2020 at 08:01:12PM +0200, Borislav Petkov wrote: > On Tue, Sep 08, 2020 at 07:42:12PM +0200, Jason A. Donenfeld wrote: > > Are you prepared to track down all the MSRs that might maybe do > > something naughty? > > I'm not prepared - that's why this MSR filtering. To block *all*

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Jason A. Donenfeld
On Tue, Sep 8, 2020 at 8:01 PM Borislav Petkov wrote: > > On Tue, Sep 08, 2020 at 07:42:12PM +0200, Jason A. Donenfeld wrote: > > Are you prepared to track down all the MSRs that might maybe do > > something naughty? > > I'm not prepared - that's why this MSR filtering. To block *all* direct >

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 07:42:12PM +0200, Jason A. Donenfeld wrote: > Are you prepared to track down all the MSRs that might maybe do > something naughty? I'm not prepared - that's why this MSR filtering. To block *all* direct MSR accesses from userspace in the future. > Does `dd` warn when you

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Jason A. Donenfeld
On Tue, Sep 8, 2020 at 7:36 PM Borislav Petkov wrote: > > On Tue, Sep 08, 2020 at 07:29:11PM +0200, Jason A. Donenfeld wrote: > > Well that's not cool. > > So you're saying that if someone wants to kill its box by poking at that > MSR, we should just let her/him? > > If anything, I think that a

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 07:29:11PM +0200, Jason A. Donenfeld wrote: > Well that's not cool. So you're saying that if someone wants to kill its box by poking at that MSR, we should just let her/him? If anything, I think that a BIG FAT WARNING at least would make sense. Now, if there were a

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 10:10:17AM -0700, Srinivas Pandruvada wrote: > > > - if (reg == MSR_IA32_ENERGY_PERF_BIAS) > > > + switch (reg) { > > > + case MSR_IA32_ENERGY_PERF_BIAS: > There is already sysfs interface for it. So someone needs to convert all those to it:

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Jason A. Donenfeld
On Tue, Sep 8, 2020 at 7:26 PM Borislav Petkov wrote: > > On Tue, Sep 08, 2020 at 07:12:44PM +0200, Jason A. Donenfeld wrote: > > > Overclocking is not architectural I/F and is supported by some special > > > CPU skews. I can't find any public document to specify the commands > > > which can be

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Borislav Petkov
On Tue, Sep 08, 2020 at 07:12:44PM +0200, Jason A. Donenfeld wrote: > > Overclocking is not architectural I/F and is supported by some special > > CPU skews. I can't find any public document to specify the commands > > which can be used via this OC mailbox. I have to check internally to > > see if

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Jason A. Donenfeld
On Tue, Sep 8, 2020 at 7:10 PM Srinivas Pandruvada wrote: > > On Mon, 2020-09-07 at 12:06 +0200, Borislav Petkov wrote: > > + Srinivas. > > + kitsunyan. > > > > On Mon, Sep 07, 2020 at 11:48:43AM +0200, Jason A. Donenfeld wrote: > > > Popular tools, like intel-undervolt, use MSR 0x150 to control

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-08 Thread Srinivas Pandruvada
On Mon, 2020-09-07 at 12:06 +0200, Borislav Petkov wrote: > + Srinivas. > + kitsunyan. > > On Mon, Sep 07, 2020 at 11:48:43AM +0200, Jason A. Donenfeld wrote: > > Popular tools, like intel-undervolt, use MSR 0x150 to control the > > CPU > > voltage offset. In fact, evidently the intel_turbo_max_3

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Jason A. Donenfeld
On Mon, Sep 7, 2020 at 1:11 PM Borislav Petkov wrote: > > Hi, > > On Mon, Sep 07, 2020 at 12:46:35PM +0200, Jason A. Donenfeld wrote: > > Are you sure that intel-undervolt using OC_MAILBOX from userspace is > > actually a "misuse"? Should the kernel or kernel drivers actually be > > involved with

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Borislav Petkov
On Mon, Sep 07, 2020 at 01:15:14PM +0200, Jason A. Donenfeld wrote: > Gotcha. So your perspective is that the goal is actually to have no > list at all in the end, because all MSR writes should go through sysfs > interfaces and such, always? I certainly like that goal -- it'd make a > whole lot of

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Borislav Petkov
Hi, On Mon, Sep 07, 2020 at 12:46:35PM +0200, Jason A. Donenfeld wrote: > Are you sure that intel-undervolt using OC_MAILBOX from userspace is > actually a "misuse"? Should the kernel or kernel drivers actually be > involved with the task of underclocking? This seems pretty squarely in > the

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Jason A. Donenfeld
Hi Borislav, On Mon, Sep 7, 2020 at 12:06 PM Borislav Petkov wrote: > > + Srinivas. > + kitsunyan. > > On Mon, Sep 07, 2020 at 11:48:43AM +0200, Jason A. Donenfeld wrote: > > Popular tools, like intel-undervolt, use MSR 0x150 to control the CPU > > voltage offset. In fact, evidently the

Re: [PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Borislav Petkov
+ Srinivas. + kitsunyan. On Mon, Sep 07, 2020 at 11:48:43AM +0200, Jason A. Donenfeld wrote: > Popular tools, like intel-undervolt, use MSR 0x150 to control the CPU > voltage offset. In fact, evidently the intel_turbo_max_3 driver in-tree > also uses this MSR. So, teach the kernel's MSR list

[PATCH] x86/msr: do not warn on writes to OC_MAILBOX

2020-09-07 Thread Jason A. Donenfeld
Popular tools, like intel-undervolt, use MSR 0x150 to control the CPU voltage offset. In fact, evidently the intel_turbo_max_3 driver in-tree also uses this MSR. So, teach the kernel's MSR list about this, so that intel-undervolt and other such tools don't spew warnings to dmesg, while unifying