[RFC PATCH 1/1] powerpc/ftrace: Exclude real mode code from
Naveen N. Rao
naveen.n.rao at linux.vnet.ibm.com
Fri Mar 9 23:05:25 AEDT 2018
Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:
>> My earlier assumption was that we have other scenarios when we are in
>> realmode (specifically with MSR_RI unset) where we won't be able to
>> recover from a trap, during function tracing (*). I did a set of
>> experiments yesterday to verify that, but I was not able to uncover
>> any such scenarios with my brief testing. So, we seem to be
>> functioning just fine while tracing realmode C code, except for KVM.
> Hmm. If MSR_RI is clear then that should indicate that you can't recover
> from an interrupt, typically because you'd lose state in SRR0/1. So I
> would expect things to go badly in that case.
Yes, so it looks like we aren't calling into any C code (that isn't
already annotated with 'notrace') with MSR_RI unset. At least, with the
usual interrupt handling on powernv. I tested this by putting a 'trap'
in the function tracer callback after the recursion test. This forces a
trap for each function that we trace non-recursively.
There may be other paths where we do so, but it isn't as pervasive as I
previously thought. So, we should be able to exclude those paths using
the paca field, as and when we find them.
More information about the Linuxppc-dev