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]
Date:	Fri, 27 Mar 2015 17:35:47 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	John Stultz <john.stultz@...aro.org>,
	"H. Peter Anvin" <hpa@...or.com>, David Ahern <dsahern@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [tip:perf/timer] perf: Add per event clockid support

On Fri, Mar 27, 2015 at 09:31:45AM -0700, Stephane Eranian wrote:
> On Fri, Mar 27, 2015 at 4:48 AM, tip-bot for Peter Zijlstra
> > +static int perf_event_set_clock(struct perf_event *event, clockid_t clk_id)
> > +{
> > +       bool nmi_safe = false;
> > +
> > +       switch (clk_id) {
> > +       case CLOCK_MONOTONIC:
> > +               event->clock = &ktime_get_mono_fast_ns;
> > +               nmi_safe = true;
> > +               break;
> > +
> > +       case CLOCK_MONOTONIC_RAW:
> > +               event->clock = &ktime_get_raw_fast_ns;
> > +               nmi_safe = true;
> > +               break;
> > +
> > +       case CLOCK_REALTIME:
> > +               event->clock = &ktime_get_real_ns;
> > +               break;
> > +
> > +       case CLOCK_BOOTTIME:
> > +               event->clock = &ktime_get_boot_ns;
> > +               break;
> > +
> > +       case CLOCK_TAI:
> > +               event->clock = &ktime_get_tai_ns;
> > +               break;
> > +
> Can all those clocks be safely called from an NMI context?

+       if (!nmi_safe && !(event->pmu->capabilities & PERF_PMU_CAP_NO_NMI))
+               return -EINVAL;

no :-)
--
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