From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030586AbcCQMWi (ORCPT ); Thu, 17 Mar 2016 08:22:38 -0400 Received: from mail9.hitachi.co.jp ([133.145.228.44]:43511 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030211AbcCQMWf (ORCPT ); Thu, 17 Mar 2016 08:22:35 -0400 From: =?gb2312?B?xr3LydHFy8ggLyBISVJBTUFUVaOsTUFTQU1J?= To: "'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: AQHRecWGLyNOYzEq3kekw6T0fuqZYZ9dmZTQ Date: Thu, 17 Mar 2016 12:22:30 +0000 Message-ID: <50399556C9727B4D88A595C8584AAB37B4E50431@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> In-Reply-To: <1457501543-24197-9-git-send-email-dave.long@linaro.org> 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 u2HCMjQS018973 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?? Thank you, > > int __init arch_init_kprobes(void) >-- >2.5.0 > > >_______________________________________________ >linux-arm-kernel mailing list >linux-arm-kernel@lists.infradead.org >http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: masami.hiramatsu.pt@hitachi.com (=?gb2312?B?xr3LydHFy8ggLyBISVJBTUFUVaOsTUFTQU1J?=) Date: Thu, 17 Mar 2016 12:22:30 +0000 Subject: [PATCH v11 8/9] arm64: Add kernel return probes support (kretprobes) In-Reply-To: <1457501543-24197-9-git-send-email-dave.long@linaro.org> References: <1457501543-24197-1-git-send-email-dave.long@linaro.org> <1457501543-24197-9-git-send-email-dave.long@linaro.org> Message-ID: <50399556C9727B4D88A595C8584AAB37B4E50431@GSjpTKYDCembx32.service.hitachi.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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?? Thank you, > > int __init arch_init_kprobes(void) >-- >2.5.0 > > >_______________________________________________ >linux-arm-kernel mailing list >linux-arm-kernel at lists.infradead.org >http://lists.infradead.org/mailman/listinfo/linux-arm-kernel