Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1101293yba; Thu, 9 May 2019 10:44:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTKk0PcL/mfHIbbRMn0Ez7rCpfHVpsiEtZpch3vKkOxsH7QKeo606NuZNf0JkxJTYPAqi9 X-Received: by 2002:a17:902:be09:: with SMTP id r9mr6888183pls.215.1557423885212; Thu, 09 May 2019 10:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557423885; cv=none; d=google.com; s=arc-20160816; b=c9AS0kt6VwLBL8DSJGLKlthX8652IMZXM3mUOnmOiPCabPk/qo2FUs02iupyB20X35 ZKikN3cUdt7c7mNj9Son/W1/BflxNRqjBCX9k4idjn/uONv0DBU7SlneXvNJbk6XmKub XA0kTOepmhKtY1dSKKVH5tyzeRwaVlbgBwcj9DmH2dKSIpEbw6WxbzFt0o/ZqKX0Dvrl v7kDU1Qok6qMbCl6q7F4/acPjBWHBJy44lUbZDQxOmB3YusNvUobmNs+eiWeY/Rwkx89 w3cS5mJ6pbqmNLEC9f88RUZcWDeQCuGyvaGbLfho0ggziFuYGulNgItieMjH7znBc2lv vudA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=WRsA0FI/10Htq2DUDzPCzJs6nVx0M3jGjNJWw+NRYAg=; b=YGDMpHo56KeZcLsZnZNKzVndUMj5J0yFuwdaKUPQeUgMCvvGZdC8S4pcHRrkagSFyg k9tj6NBgjY62nFLWv45i3h009V6oZJzXCpmec8Olk6wzIXm66CThmxI6DnFjwNFMcIk5 U/+wBCt9X9a6jbLl8ClBlPH64hqlOFPekjHJxiDiQTFm9kco4Gix3WzzmAxNIIN9nl0z UWvGFSB0abfsL3FPMUUEKazyxQ3MxDiJgLI2xWhTS5iVjGNhKQtSsnqIe0M8TemH7mBF GPShFT9U0sm/kB3Gd/DRoPESLmz+HkZsO7w6tFvGJJXfLrAQh/wuFx67Yd/h4/A9Op4c +w+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78si3533362pfr.138.2019.05.09.10.44.29; Thu, 09 May 2019 10:44:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbfEIRn1 (ORCPT + 99 others); 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