From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B45CC04AB1 for ; Thu, 9 May 2019 17:43:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 750F721019 for ; Thu, 9 May 2019 17:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbfEIRn1 (ORCPT ); Thu, 9 May 2019 13:43:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbfEIRn1 (ORCPT ); Thu, 9 May 2019 13:43:27 -0400 Received: from home.goodmis.org (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A989A20675; Thu, 9 May 2019 17:43:23 +0000 (UTC) Date: Thu, 9 May 2019 13:43:16 -0400 From: Steven Rostedt To: Andy Lutomirski Cc: Peter Zijlstra , Masami Hiramatsu , Josh Poimboeuf , linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 2/4] x86/kprobes: Fix frame pointer annotations Message-ID: <20190509174316.pzuakeu657g3fnlm@home.goodmis.org> References: <20190508074901.982470324@infradead.org> <20190508080612.721269814@infradead.org> <20190508115416.nblx7c2kocidpytm@treble> <20190508120416.GL2589@hirez.programming.kicks-ass.net> <20190508124248.u5ukpbhnh4wpiccq@treble> <20190508153907.GM2589@hirez.programming.kicks-ass.net> <20190508184848.qerg3flv3ej3xsev@treble> <20190509102030.dfa62e058f09d0d8cbdd6053@kernel.org> <20190509081431.GO2589@hirez.programming.kicks-ass.net> <81170F0B-A2BB-4CD6-A1B5-5E7E0DDBC282@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <81170F0B-A2BB-4CD6-A1B5-5E7E0DDBC282@amacapital.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 09, 2019 at 09:20:06AM -0700, Andy Lutomirski wrote: > > +END(call_to_exception_trampoline) > > --- a/arch/x86/kernel/kprobes/core.c > > +++ b/arch/x86/kernel/kprobes/core.c > > @@ -731,29 +731,8 @@ asm( > > ".global kretprobe_trampoline\n" > > ".type kretprobe_trampoline, @function\n" > > "kretprobe_trampoline:\n" > > - /* We don't bother saving the ss register */ > > -#ifdef CONFIG_X86_64 > > - " pushq %rsp\n" > > - " pushfq\n" > > - SAVE_REGS_STRING > > - " movq %rsp, %rdi\n" > > - " call trampoline_handler\n" > > - /* Replace saved sp with true return address. */ > > - " movq %rax, 19*8(%rsp)\n" > > - RESTORE_REGS_STRING > > - " popfq\n" > > -#else > > - " pushl %esp\n" > > - " pushfl\n" > > - SAVE_REGS_STRING > > - " movl %esp, %eax\n" > > - " call trampoline_handler\n" > > - /* Replace saved sp with true return address. */ > > - " movl %eax, 15*4(%esp)\n" > > - RESTORE_REGS_STRING > > - " popfl\n" > > -#endif > > - " ret\n" > > + "push trampoline_handler\n" > > + "jmp call_to_exception_trampoline\n" > > ".size kretprobe_trampoline, .-kretprobe_trampoline\n" > > ); > > > Potentially minor nit: you’re doing popfl, but you’re not doing TRACE_IRQ_whatever. This makes me think that you should either add the tracing (ugh!) or you should maybe just skip the popfl. Note, kprobes (and ftrace for that matter) are not saving flags for interrupts, but because it must not modify the sign, zero and carry flags. -- Steve