From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Anton Blanchard <anton@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev@lists.ozlabs.org,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Paul Mackerras <paulus@ozlabs.org>
Subject: Re: [RFC PATCH 1/1] powerpc/ftrace: Exclude real mode code from
Date: Thu, 08 Mar 2018 00:07:07 +0530 [thread overview]
Message-ID: <1520447419.431mwwg71x.naveen@linux.ibm.com> (raw)
In-Reply-To: <20180307124553.312ea88c@vmware.local.home>
Hi Steve,
Steven Rostedt wrote:
> On Wed, 7 Mar 2018 22:16:19 +0530
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:
>=20
>> We can't take a trap in most parts of real mode code. Instead of adding
>> the 'notrace' annotation to all C functions that can be invoked from
>> real mode, detect that we are in real mode on ftrace entry and return
>> back.
>>=20
>> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
>> ---
>> This RFC only handles -mprofile-kernel to demonstrate the approach being=
=20
>> considered. We will need to handle other ftrace entry if we decide to=20
>> continue down this path.
>=20
> I do prefer this trade off.
Great, thanks!
>=20
>=20
>> diff --git a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S b/arch/power=
pc/kernel/trace/ftrace_64_mprofile.S
>> index 3f3e81852422..ecc0e8e38ead 100644
>> --- a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
>> +++ b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
>> @@ -56,6 +56,21 @@ _GLOBAL(ftrace_caller)
>> =20
>> /* Load special regs for save below */
>> mfmsr r8
>> +
>> + /* Only proceed if we are not in real mode and can take interrupts */
>> + andi. r9, r8, MSR_IR|MSR_DR|MSR_RI
>> + cmpdi r9, MSR_IR|MSR_DR|MSR_RI
>> + beq 1f
>=20
> OK, I assume this check and branch is negligible compared to the mfmsr
> call?
Yes, that's negligible.
Though, to be honest, I will have to introduce a 'mfmsr' for the older=20
-pg variant. I still think that the improved reliability far outweighs=20
the minor slowdown there.
- Naveen
=
next prev parent reply other threads:[~2018-03-07 18:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 16:46 [RFC PATCH 0/1] Exclude real mode code from ftrace Naveen N. Rao
2018-03-07 16:46 ` [RFC PATCH 1/1] powerpc/ftrace: Exclude real mode code from Naveen N. Rao
2018-03-07 17:45 ` Steven Rostedt
2018-03-07 18:37 ` Naveen N. Rao [this message]
2018-03-07 19:02 ` Steven Rostedt
2018-03-09 8:17 ` Naveen N. Rao
2018-03-08 3:03 ` Michael Ellerman
2018-03-09 8:15 ` Naveen N. Rao
2018-03-09 10:27 ` Michael Ellerman
2018-03-09 12:05 ` Naveen N. Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520447419.431mwwg71x.naveen@linux.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@ozlabs.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).