Thread (10 messages) flat view 10 messages, 4 authors, 2018-03-20

Re: [PATCH 1/2] powerpc64/ftrace: Add a field in paca to disable ftrace in unsafe code paths

From: Naveen N. Rao <hidden>
Date: 2018-03-19 18:53:26

Nicholas Piggin wrote:
On Mon, 19 Mar 2018 14:43:00 +0530
"Naveen N. Rao" [off-list ref] wrote:
=20
quoted
We have some C code that we call into from real mode where we cannot
take any exceptions. Though the C functions themselves are mostly safe,
if these functions are traced, there is a possibility that we may take
an exception. For instance, in certain conditions, the ftrace code uses
WARN(), which uses a 'trap' to do its job.
=20
For such scenarios, introduce a new field in paca 'ftrace_disabled',
which is checked on ftrace entry before continuing. This field can then
be set to a non-zero value to disable/pause ftrace, and reset to zero to
resume ftrace.
=20
Since KVM is the only user for this currently, we guard the
ftrace/mcount checks within CONFIG_KVM. This can later be removed
if/when there are other users.
=20
Why not test HSTATE_IN_GUEST then? Add ftrace_disabled if non-KVM users
come along.
That's indeed simpler -- thanks for the suggestion!

- Naveen
=
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help