From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbdJCRLG (ORCPT ); Tue, 3 Oct 2017 13:11:06 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:35986 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751177AbdJCRLF (ORCPT ); Tue, 3 Oct 2017 13:11:05 -0400 X-Google-Smtp-Source: AOwi7QARXkJURVa+x3/bT6lwMRf2mUXUMNVmmDtf9vfOl6mHLxzA5jmxT970m0nAMcg5nyDYan2wQA== Date: Tue, 3 Oct 2017 19:11:00 +0200 From: Ingo Molnar To: Masami Hiramatsu Cc: mingo@redhat.com, x86@kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org, Peter Zijlstra , Ananth N Mavinakayanahalli , Thomas Gleixner , "H . Peter Anvin" , "Paul E . McKenney" , Alexei Starovoitov , Alexei Starovoitov , Linus Torvalds Subject: Re: [BUGFIX PATCH] kprobes/x86: Remove IRQ disabling from jprobe handlers Message-ID: <20171003171100.p535ul3wml4uhsow@gmail.com> References: <20170930231251.emiuyrapdgzpcylp@inn> <150701508194.32266.14458959863314097305.stgit@devbox> <20171003093344.feh7gqa4aimsjwqv@gmail.com> <20171004002437.66c15c68ef662c0d9a458bef@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171004002437.66c15c68ef662c0d9a458bef@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Masami Hiramatsu wrote: > On Tue, 3 Oct 2017 11:33:44 +0200 > Ingo Molnar wrote: > > > > > * Masami Hiramatsu wrote: > > > > > Jprobe actually doesn't need to disable IRQs while calling > > > handlers, because Documentation/kprobes.txt says: > > > > > > ----- > > > Probe handlers are run with preemption disabled. Depending on the > > > architecture and optimization state, handlers may also run with > > > interrupts disabled (e.g., kretprobe handlers and optimized kprobe > > > handlers run without interrupt disabled on x86/x86-64). > > > ----- > > > > > > So let's remove IRQ disabling from jprobes too. > > > > > > Signed-off-by: Masami Hiramatsu > > > --- > > > arch/x86/kernel/kprobes/core.c | 2 -- > > > 1 file changed, 2 deletions(-) > > > > > > diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c > > > index b48e0efd668e..bd36f3c33cd0 100644 > > > --- a/arch/x86/kernel/kprobes/core.c > > > +++ b/arch/x86/kernel/kprobes/core.c > > > @@ -1099,8 +1099,6 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) > > > * raw stack chunk with redzones: > > > */ > > > __memcpy(kcb->jprobes_stack, (kprobe_opcode_t *)addr, MIN_STACK_SIZE(addr)); > > > - regs->flags &= ~X86_EFLAGS_IF; > > > - trace_hardirqs_off(); > > > regs->ip = (unsigned long)(jp->entry); > > > > > > /* > > > > Could you please also do a patch that disables jprobes permanently, in preparation > > of eventually removing them later? > > Would you mean introducing CONFIG_JPROBE_API and cut APIs out, > or just adding "__deprecated" for each API? No, I'd suggest removing in-kernel uses and disabling jprobes in the Kconfig altogether, but without removing the code and its integration for the time being. Thanks, Ingo