Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030839AbcCQM6a (ORCPT ); Thu, 17 Mar 2016 08:58:30 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:52461 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030688AbcCQM6Z (ORCPT ); Thu, 17 Mar 2016 08:58:25 -0400 From: =?gb2312?B?xr3LydHFy8ggLyBISVJBTUFUVaOsTUFTQU1J?= To: "'ltc-kernel@ml.yrl.intra.hitachi.co.jp'" , "'David Long'" , Catalin Marinas , Will Deacon , Sandeepa Prabhu , William Cohen , Pratyush Anand , Steve Capper , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Marc Zyngier CC: Mark Rutland , Petr Mladek , Viresh Kumar , John Blackwood , Feng Kan , Zi Shen Lim , Dave P Martin , Yang Shi , Vladimir Murzin , Kees Cook , "Suzuki K. Poulose" , "Mark Brown" , =?gb2312?B?QWxleCBCZW5uqKZl?= , Ard Biesheuvel , "Greg Kroah-Hartman" , Mark Salyzyn , James Morse , Christoffer Dall , Andrew Morton , Robin Murphy , Jens Wiklander , Balamurugan Shanmugam , sysp-manager Subject: RE: [PATCH v11 8/9] arm64: Add kernel return probes support (kretprobes) Thread-Topic: [!][PATCH v11 8/9] arm64: Add kernel return probes support (kretprobes) Thread-Index: AQHRgEeyWPksqRab50G9DdeIlpDZaZ9dlkrw Date: Thu, 17 Mar 2016 12:58:20 +0000 Message-ID: <50399556C9727B4D88A595C8584AAB37B4E504AA@GSjpTKYDCembx32.service.hitachi.net> References: <1457501543-24197-1-git-send-email-dave.long@linaro.org> <1457501543-24197-9-git-send-email-dave.long@linaro.org> <50399556C9727B4D88A595C8584AAB37B4E50431@GSjpTKYDCembx32.service.hitachi.net> In-Reply-To: <50399556C9727B4D88A595C8584AAB37B4E50431@GSjpTKYDCembx32.service.hitachi.net> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.198.219.31] Content-Type: text/plain; charset="gb2312" MIME-Version: 1.0 X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u2HCwYeZ019181 Content-Length: 1471 Lines: 49 >From: ƽ?????? / HIRAMATU??MASAMI [mailto:masami.hiramatsu.pt@hitachi.com] > >Hi, > >>From: Sandeepa Prabhu >> >>The pre-handler of this special 'trampoline' kprobe executes the return >>probe handler functions and restores original return address in ELR_EL1. >>This way the saved pt_regs still hold the original register context to be >>carried back to the probed kernel function. > >This patch seems not well separated. > >>diff --git a/arch/arm64/kernel/kprobes.c b/arch/arm64/kernel/kprobes.c >>index bd3f233..13d3333 100644 >>--- a/arch/arm64/kernel/kprobes.c >>+++ b/arch/arm64/kernel/kprobes.c > >[snip] > >>+void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, >>+ struct pt_regs *regs) >>+{ >>+ ri->ret_addr = (kprobe_opcode_t *)regs->regs[30]; >>+ >>+ /* replace return addr (x30) with trampoline */ >>+ regs->regs[30] = (long)&kretprobe_trampoline; > >So, where is the kretprobe_trampoline? It seems that function is >defined in other patch. > >>+} >>+ >>+int __kprobes arch_trampoline_kprobe(struct kprobe *p) >>+{ >>+ return 0; >> } > >And what this function is for?? Ah, sorry, this was my fault. Yes, this function is required. But this implementation also means there is an asm-based trampoline function which should be included in this patch. David, could you tell me the repository which I can get the latest version of this series? I'd like to see the whole code of kprobes/arm64. Thank you,