From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966536AbdDSQoA convert rfc822-to-8bit (ORCPT ); Wed, 19 Apr 2017 12:44:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49751 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966461AbdDSQn5 (ORCPT ); Wed, 19 Apr 2017 12:43:57 -0400 Date: Wed, 19 Apr 2017 16:42:50 +0000 From: "Naveen N. Rao" Subject: Re: [PATCH v3 6/7] powerpc: kprobes: emulate instructions on kprobe handler re-entry To: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Ingo Molnar , Michael Ellerman References: <0d4193a90e4b2ad3cd2ef33d41228b80a2ac9f91.1492604782.git.naveen.n.rao@linux.vnet.ibm.com> <20170419234319.7893df9c158e565fede4a386@kernel.org> In-Reply-To: <20170419234319.7893df9c158e565fede4a386@kernel.org> User-Agent: astroid/0.8 (https://github.com/astroidmail/astroid) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT X-TM-AS-MML: disable x-cbid: 17041916-0016-0000-0000-0000022F84D4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041916-0017-0000-0000-000006AA86C2 Message-Id: <1492620027.h27iuc5j5o.astroid@naverao1-tp.none> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-19_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704190139 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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" wrote: > >> On kprobe handler re-entry, try to emulate the instruction rather than >> single stepping always. >> >> Acked-by: Ananth N Mavinakayanahalli >> Signed-off-by: Naveen N. Rao >> --- >> 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 > >