Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1145484yba; Thu, 9 May 2019 11:28:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBy4fS60amUTbQsGly7Z0u7LbL1FQvNewMn14pJdoU5zb9rm6THROoJpzn49k8QDlQKuTm X-Received: by 2002:a63:af45:: with SMTP id s5mr7560711pgo.420.1557426534341; Thu, 09 May 2019 11:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557426534; cv=none; d=google.com; s=arc-20160816; b=ipILl5ZOZ3Pqgqdz6qY+ZPT7LpV3h+ZwyAcrV7NRMoTKs0kIBciV7DgdGY64vfGkWT mJGU/QvNbvN4zJH3J2jq8JiTyHGPvrsaEPK417NKv1tFpipRcSi+XW2PAmmt8kBXP99i WPLkUYBxF5vp5YiE9zTc63SyOmTwP8Q25RLoSgkccwTbxzlh0ZnhNXAJNLr7zRhjLIh6 gq5knDuvqmcJ7WPY6/O5xyN8sPBo/qdoWGZVWuPShtxuL2lpW3PcwaDc6OYCQdJcWxjt 9ormB8xA2UsOLw4Tz+SGV80TAvAQe+Fbb+E21BTEUmmfBEIluL9nXpZLe9nR9YCb1aEw cTKQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=M+ac/UzOhEovku6TvaL3m7ed0JPo1/Dl8jj2JnZY/7E=; b=vR1AZTrbRgJ9A1NKZ6izsgyx4Grl6akAatW7jx0YgYBcIL+RsbUScgBuleiYOBz6t0 G7Bj28z0I1ISINGfEmG1zTGj7+SZUX1hYLlM27sMOOw85eig6u8VMN2XC3HrDj6hKLvC Qzj4m299OXvQKU9+dibXH4DEu8rEjZupbAXaRz4QAMVmEzA4Jvxa2flTfVtRvbAD7IJ4 JoMAs/CdE/wbuEMLxMSSdT3Cq9BLqpvqta8+dCLqBeVdPtPQ01ZDwMc9gGMKHODPgS6K tBvtJ5bjUNhhwq3MsqHhPcIkaTjgb+JzmUEyFRsr4CIDrzOVkMH8ag6Ta5aK7gkvtEfb Es1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iTJ9LIl7; 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 j30si4065570pgl.338.2019.05.09.11.28.37; Thu, 09 May 2019 11:28:54 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iTJ9LIl7; 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 S1726797AbfEIS0z (ORCPT + 99 others); Thu, 9 May 2019 14:26:55 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:35246 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbfEIS0z (ORCPT ); Thu, 9 May 2019 14:26:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M+ac/UzOhEovku6TvaL3m7ed0JPo1/Dl8jj2JnZY/7E=; b=iTJ9LIl7aeRopKzTZ3VOE/mYf Gvc+rqcVgiuiuD6oJoIBfLtkF/IFiFLEJUWw6tUjPF8TQYE9ri2m1SECKM835zcl43lCNC06mQv4O UnU06gmyVgEJoAcmklK/KhHWR+y1uhidZOLNrFdr+Gy9NG+hzWkdVPNXbLENCMnSncVqlvrCrjr0j ijYd+J5FWgqMruK6JzUY+/Dc0tfC00zOEBQeUCxNC9OGFQX9reneb8HFrDSZYa6SRVHm7bdLfrKcw T635XepFYxxMJWDMdfy7RGCO2B2SgLmdxK7kXFbj/4PqQMfTZQ8vygSFpoG3kAtWn1/RAjm80f9dy joEYtlD9Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOnkN-0004KF-Ja; Thu, 09 May 2019 18:26:23 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1FF2B2143093D; Thu, 9 May 2019 20:26:22 +0200 (CEST) Date: Thu, 9 May 2019 20:26:22 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: 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: <20190509182622.GB2623@hirez.programming.kicks-ass.net> 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> <20190509173741.pfvecznqdndihxzg@home.goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190509173741.pfvecznqdndihxzg@home.goodmis.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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 01:37:42PM -0400, Steven Rostedt wrote: > On Thu, May 09, 2019 at 10:14:31AM +0200, Peter Zijlstra wrote: > > > > Right; I already fixed that in my patch changing i386's pt_regs. > > > > But what I'd love to do is something like the belwo patch, and make all > > the trampolines (very much including ftrace) use that. Such that we then > > only have 1 copy of this magic (well, 2 because x86_64 also needs an > > implementation of this of course). > > > > Changing ftrace over to this would be a little more work but it can > > easily chain things a little to get its original context back: > > > > ENTRY(ftrace_regs_caller) > > GLOBAL(ftrace_regs_func) > > push ftrace_stub > > push ftrace_regs_handler > > Note, ftrace_stub is dynamically modified to remove any indirect calls. Yeah, I realized that a few hours after I send this out; as you might have seen by the IRC chatter on this. Still, maybe we can wrap the thing in a .macro and reuse things that way. Because I really hate there are at least 3 (x2 for x86_64) copies of this around.