[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1492620027.h27iuc5j5o.astroid@naverao1-tp.none>
Date: Wed, 19 Apr 2017 16:42:50 +0000
From: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Ingo Molnar <mingo@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v3 6/7] powerpc: kprobes: emulate instructions on kprobe
handler re-entry
Excerpts from Masami Hiramatsu's message of April 19, 2017 20:13:
>
> BTW, as I pointed, 5/7 and 6/7 should be merged since this actually
> makes meaningful change.
Yes, sorry if I wasn't clear in my previous reply in the (!) previous
patch series.
Since this has to go through the powerpc tree, I followed this since I
felt that Michael Ellerman prefers to keep functional changes separate
from refactoring. I'm fine with either approach.
Michael?
Thanks!
- Naveen
>
> Thank you,
>
> On Wed, 19 Apr 2017 18:21:05 +0530
> "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com> wrote:
>
>> On kprobe handler re-entry, try to emulate the instruction rather than
>> single stepping always.
>>
>> Acked-by: Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
>> Signed-off-by: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
>> ---
>> arch/powerpc/kernel/kprobes.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
>> index 46e8c1e03ce4..067e9863bfdf 100644
>> --- a/arch/powerpc/kernel/kprobes.c
>> +++ b/arch/powerpc/kernel/kprobes.c
>> @@ -276,6 +276,14 @@ int __kprobes kprobe_handler(struct pt_regs *regs)
>> kprobes_inc_nmissed_count(p);
>> prepare_singlestep(p, regs);
>> kcb->kprobe_status = KPROBE_REENTER;
>> + if (p->ainsn.boostable >= 0) {
>> + ret = try_to_emulate(p, regs);
>> +
>> + if (ret > 0) {
>> + restore_previous_kprobe(kcb);
>> + return 1;
>> + }
>> + }
>> return 1;
>> } else {
>> if (*addr != BREAKPOINT_INSTRUCTION) {
>> --
>> 2.12.1
>>
>
>
> --
> Masami Hiramatsu <mhiramat@...nel.org>
>
>
Powered by blists - more mailing lists