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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120324073731.GD20145@gmail.com>
Date:	Sat, 24 Mar 2012 08:37:31 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Borislav Petkov <bp@...64.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] x86, mce: Add persistent MCE event


* Borislav Petkov <bp@...64.org> wrote:

> On Fri, Mar 23, 2012 at 01:31:56PM +0100, Ingo Molnar wrote:
> > Have you considered making the addition of persistent events
> > straightforward and robust, in terms of adding a TRACE_EVENT() variant
> > for them? It could replace the above code.
> 
> Err,
> 
> are you thinking of something in TRACE_EVENT() that sets
> perf_event_attr.persistent to 1?

I was mainly thinking of reducing this:

 arch/x86/kernel/cpu/mcheck/mce.c |   53 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

to almost nothing. There doesn't seem to be much MCE specific in 
that code, right?

> Btw, the more important question is are we going to need 
> persistent events that much so that a generic approach is 
> warranted? I guess maybe the black box events recording deal 
> would be another user..

So, here's the big picture as I see it:

I think tracing could use persistent events: mark all the events 
we want to trace as persistent from bootup, and recover the 
bootup trace after the system has been booted up.

But other, runtime models of tracing could use it as well: 
basically the main difference that ftrace has to perf based 
tracing today is a system-wide persistent buffer with no 
particular owning process. (The rest is mostly UI and analysis 
features and scope of tracing differences, and of course a lot 
more love and detail went into ftrace so far.)

So MCE will in the end be just a minor user of such a facility - 
I think you should aim for enabling *any* set of events to have 
persistent recording properties, and add the APIs to recover 
that information sanely. It should also be possible for them to 
record into a shared mmap page in essence - instead of having 
per event persistent buffers.

That way testing would be a lot easier as well: you could enable 
persistent tracing via something like:

    perf trace on -e <events>

and turn it off via:

    perf trace off

and just recover the recorded events via something like:

    perf trace

... or so. That you can then also enable this during bootup for 
MCE events is just a very nice side effect of a much more 
generally useful feature.

Would you be interested in creating a clean incarnation of this 
without making peterz sad? The 'perf trace' perf subcommand is 
still unused and up for grabs for sufficiently good patches, 
coincidentally ;-)

Thanks,

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