lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <559005DD.3070003@redhat.com>
Date:	Sun, 28 Jun 2015 10:34:05 -0400
From:	Prarit Bhargava <prarit@...hat.com>
To:	Andy Lutomirski <luto@...capital.net>
CC:	Ingo Molnar <mingo@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, X86 ML <x86@...nel.org>,
	Len Brown <len.brown@...el.com>,
	Dasaratharaman Chandramouli 
	<dasaratharaman.chandramouli@...el.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Borislav Petkov <bp@...en8.de>,
	Andy Lutomirski <luto@...nel.org>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Brian Gerst <brgerst@...il.com>,
	Arnaldo Carvalho de Melo <acme@...radead.org>
Subject: Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr



On 06/27/2015 11:52 AM, Andy Lutomirski wrote:
> On Sat, Jun 27, 2015 at 1:39 AM, Ingo Molnar <mingo@...nel.org> wrote:
>>
>> * Ingo Molnar <mingo@...nel.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 Andy that exposes a single MSR via perf. At the core of the
>> PMU driver is a single rdmsrl():
>>
>> +static void aperfmperf_event_start(struct perf_event *event, int flags)
>> +{
>> +       u64 now;
>> +
>> +       rdmsrl(event->hw.event_base, now);
>> +       local64_set(&event->hw.prev_count, now);
>> +}
>>

I just sat down to do something similar to what Andy had proposed here :).

>> Now I think what we really want is to expose not a single MSR but multiple MSRs in
>> a single driver, i.e. don't have one PMU driver per MSR, but have a driver that
>> allows the exposure of select MSRs as counters.
> 
> I'm way ahead of you: this driver can expose *two* MSRs as counters :)


> 
> 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
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.

> 
> This driver only knows how to handle counters, though.  I'm not sure
> whether all of the MSRs that turbostat needs are counters.

I knew that turbostat only did MSR reads and that's why turbostat's code was
changed in this patch.  TBH I'm more concerned for software that monitors system
power consumption, performance, and load.

I'll take what Andy has proposed and expand on it.

P.

> 
> --Andy
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ