Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3255383imm; Mon, 8 Oct 2018 00:22:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV61+D3c7aHCTEUnY5yn9Yd4oDOXWro2LUXH92BPJtGd03LebyCWzrmbpNZnM1VjlsxOWUvWK X-Received: by 2002:a17:902:82c5:: with SMTP id u5-v6mr22512749plz.227.1538983372611; Mon, 08 Oct 2018 00:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538983372; cv=none; d=google.com; s=arc-20160816; b=HF+R1SUxMZffes2dXgIDus0QcV5HYMiYlcADMJdDCKXpZWNC8IjfknLHpkVevXIvzP jHHZHePLsR9+jz617jZ6uxn5p9z2wqSKmRO8bPzr1s/4JW+spZJ+n3F2ZK+t4tfOR9L7 DTEV7Z/BrZShoDTS8zqN2PxO+pQQvb/TX/ysLN/I4oTn2zJjFzOL0C14HS6OavzUbBkU 40ZeZnhcG/9v5XvcsFMw35ZHhyFWpHEnPP4JCtWRRIJm5KT05EwlnB8GAU36w4/Jgb9L xzQh3LeioZPPVnsYC+gY7jvwcmPmmAm9w8MarKrpPTbDE780CI5xXtZe1nigKDZPVI7G s1lw== 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=zoATZdqlafS/3eCKuhEuqAYlbGPUieQWmTRfBK1bszU=; b=JsV0XdMLEE9q8s3TIY1PysvSA8x6Ab/KVb4MGAIkx+2a4ckyRj4ze3/JSftz3C2rT+ DuUZakxMXGQRm4Fe9vj1PnPtrFX66hwm/m4TqNOooH7evMIQhCDcImifyne10hu5ekEB Bj8YfWUaj7h9S33Tn1kn8qhIUCQ0Rr8hi1JD90U6XsZRVjHuiGn/maQ1t1Ond75TiVWM W4srJHyjUsADpLKnLG2J9cyoGDfS5AYFDSbv/KlKadOV0QLQZgkUQwi+S7C3zHfZhW0W DXL9obxkguHfgo+HK4jzBAlXT46uEzjHnNtatLJNll0aaLNpc05RAdmAEiepqNHx4L1l sDEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=2SCc0Bxt; 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 v11-v6si19297129pfl.233.2018.10.08.00.22.36; Mon, 08 Oct 2018 00:22:52 -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=merlin.20170209 header.b=2SCc0Bxt; 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 S1726354AbeJHOck (ORCPT + 99 others); Mon, 8 Oct 2018 10:32:40 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48356 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725950AbeJHOck (ORCPT ); Mon, 8 Oct 2018 10:32:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=zoATZdqlafS/3eCKuhEuqAYlbGPUieQWmTRfBK1bszU=; b=2SCc0BxtxOQteT9FdVUqkHLTJ 3v9pMKjF1ywQ5UAIttruDcGJuGiQnoUb6y1dBWwBEo/nHKe84dS7mu4IKBCDZUav7FrLunqHhLqDV WAT3OLHk0mnSbauMfMb7WNF1/Fn50y1JPI/3t7Qx86JZx3Z412IqrNdQtUx9JPNu0SfeM0mfNuEub ONIEWxE+6BQ93RWKW0ajhbQJnFtQ+2jycuV1TiERvm1NpK/JMd9x0GKUJb2uJidEyL6odP/ieZRv2 Wfc1oY/y11l/U8KgNpjrnVXnM1zetDJYVQPsJ47/YC4oaw1rLQvqgZNrmTtsB0Q0d+fAwz5kXDcOO OX/EZsA+Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9PrK-0002Wc-Fo; Mon, 08 Oct 2018 07:21:52 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 51A5520268264; Mon, 8 Oct 2018 09:21:34 +0200 (CEST) Date: Mon, 8 Oct 2018 09:21:34 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Thomas Gleixner , Masami Hiramatsu , Mathieu Desnoyers , Matthew Helsley , "Rafael J . Wysocki" , David Woodhouse , Paolo Bonzini , Josh Poimboeuf , Jason Baron , Jiri Kosina , ard.biesheuvel@linaro.org, Andy Lutomirski Subject: Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function" Message-ID: <20181008072134.GB5663@hirez.programming.kicks-ass.net> References: <20181006015110.653946300@goodmis.org> <20181006015720.634688468@goodmis.org> <20181006121211.GA5663@hirez.programming.kicks-ass.net> <20181006093905.46276505@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181006093905.46276505@vmware.local.home> 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 Sat, Oct 06, 2018 at 09:39:05AM -0400, Steven Rostedt wrote: > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: > > > On Fri, Oct 05, 2018 at 09:51:11PM -0400, Steven Rostedt wrote: > > > +#define arch_dynfunc_trampoline(name, def) \ > > > + asm volatile ( \ > > > + ".globl dynfunc_" #name "; \n\t" \ > > > + "dynfunc_" #name ": \n\t" \ > > > + "jmp " #def " \n\t" \ > > > + ".balign 8 \n \t" \ > > > + : : : "memory" ) > > > > Bah, what is it with you people and trampolines. Why can't we, just like > > jump_label, patch the call directly? > > > > The whole call+jmp thing is silly, don't do that. It just wrecks I$ and > > is slower for no real reason afaict. > > My first attempt was to do just that. But to add a label at the > call site required handling all the parameters too. See my branch: > ftrace/jump_function-v1 for how ugly it got (and it didn't work). Can't we hijack the relocation records for these functions before they get thrown out in the (final) link pass or something?