linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* -mprofile-kernel vs. notrace in ppc64(le) Linux kernels
@ 2015-09-26 14:30 Torsten Duwe
  2015-09-26 14:52 ` Segher Boessenkool
  2015-09-28  0:08 ` Stewart Smith
  0 siblings, 2 replies; 5+ messages in thread
From: Torsten Duwe @ 2015-09-26 14:30 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: live-patching

As I mentioned earlier this year, it's a bad idea to call _mcount from
MMU helper functions (e.g. hash_page...), when the profiling/tracing/
live-patching/whatever framewok might in turn cause another such fault.
Jikos suggested to use fine-grained control of these functions with the
"notrace" keyword in the Linux kernel. It is mapped to GCC's (4.8, FWIW)
__attribute__((no_instrument_function)), which, to my surprise, works
for -p and -pg nicely, but does not affect -mprofile-kernel at all!

Should we consider this a bug? IMHO it is. I can see in the GCC sources
that -mprofile-kernel is more like a low-level hack in rs6000.c,
quite far below the RTL code generator, so the no_instrument_function
attribute is probably hard to check for.

What is -mprofile-kernel good for, if it bears such a risk of crashing
the kernel? Is it the right hook for ppc64 live patching? How to protect
those critical functions? Filter -mprofile-kernel for those object files?
Ask the GCC experts to fix this?

Any ideas welcome!

	Torsten

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-28  0:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26 14:30 -mprofile-kernel vs. notrace in ppc64(le) Linux kernels Torsten Duwe
2015-09-26 14:52 ` Segher Boessenkool
2015-09-26 23:03   ` Anton Blanchard
2015-09-27 11:06     ` Torsten Duwe
2015-09-28  0:08 ` Stewart Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).