Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1680451imm; Sat, 6 Oct 2018 08:13:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV60o0ek5D7thOouflWPCA+ZdXEoouakjkAE0jRfw3Lg83hdM7sCobgb42pLLX/GLs9eIxj7v X-Received: by 2002:a62:1b45:: with SMTP id b66-v6mr16998289pfb.94.1538838839277; Sat, 06 Oct 2018 08:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538838839; cv=none; d=google.com; s=arc-20160816; b=HCVPxshpJJDn9CmoYF394ie2Xr3d6g/4cnmpo1h8P+VXGIE901bLCHz2WBoDrKX8Tp yMcl2LseSSXysIzNqmEubgMjI17DBuaMgMFx8xHQ5JJF3nxD3L3xeUQ2g8NSjHQHHfYH 0ZPNZjIWdFPOoT2kt+sts1nfT2RKZY0wl8R+mTIZviJVgnMH8w4xP7It4sYd2fXCcrwu 1vo3oygoV4NMKamG5WfMYOuvRFXeqQV4N+PRawSfVCMrh5NOZb6I1eVsAlCtv1L/iPk7 7FE5s362/tA6P1elNH8aSwgpNKCHDcT55pS3WiGTckMoOutNaPZKEwqmEiNLQJRydPwp A6NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=osp/8g64650E0fpKftQjpbgb16j7L2b3OT1r+lOeUAU=; b=rzI3yo97qj5xB9kNSyOpQfeWLxlEst7YIfUu2HgUpQutdsa9gUtJbrLGiP9RyELcFP w7ZebpPsRgRimsWhiMzGUx3bvBjamMg9ospuZGcaT55xRlyUXxKVs64N6Asy8FBLMQwb DQmFjYy3xbGaZFdtNa9nbyDJ7R14tddefoD/u+yjfm3QqV8rgqXGCx3Iqeem0n64yRpX eyXPJRVlqStOlTnTMb5ay4UcaOpJaxuTG0JHdoGq5U7DZxGiBXJbYnARB+EJTY4tmCA0 NUgSa7BjpmCekHdGhOsI+TOUpupB9Qck7iN+XRMK7YDy0dWRjKn4/C9b6imnhmR4xG1A oEng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=TXvCrvW3; 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 v13-v6si9622158pgi.92.2018.10.06.08.13.27; Sat, 06 Oct 2018 08:13:59 -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=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=TXvCrvW3; 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 S1727771AbeJFWRC (ORCPT + 99 others); Sat, 6 Oct 2018 18:17:02 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45308 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeJFWRC (ORCPT ); Sat, 6 Oct 2018 18:17:02 -0400 Received: by mail-pf1-f194.google.com with SMTP id u12-v6so3287032pfn.12 for ; Sat, 06 Oct 2018 08:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=osp/8g64650E0fpKftQjpbgb16j7L2b3OT1r+lOeUAU=; b=TXvCrvW3NF/na5gFsjPMP9JDUp7Pf+ZSudJTPbRrqBNcoLZRcQAErkffPV/hpaSZu6 m20UZ58r9E84Ysmu9yfIE+32vE/D6LPN/weuQ8/VYQWiNrIF3OU1HoFF5llDefCtpTkf RpQwgipUJC2CKei3Fpleqg4L/8dqJkK9FsMbM0vTtqLYUDkabXzcjtKekfkSPkOYFrK9 osYp8qT79wlsVKpmo45y08EYewDOp0/LoSyL65e79CMY/fN4UqWeCvBQVE66N3KHWvT6 GIcP9WRMMB5CgfAsWDzcOSxpQyQef6YZsKjjAcboTfzAPoen3STo64Sm4gO2d4hZOpGd gmyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=osp/8g64650E0fpKftQjpbgb16j7L2b3OT1r+lOeUAU=; b=VPixdeEZKH9h6pwYR1BjsJk20NNKyFRue8Z5uPxb2ykTRTlZOtG6TQoTFwELYBEkQw 48Nb/m2mCAtY31go1vsCwbTNmBLiQuPbjzcSIXWamV80jVsc5kXe4/C+58ZvM0A30Z4q /sgOrdweCfbWkJx1MCi+WA/VWssVqhA05xua4Ki/t0QDmoEooMaI9quq79cKzD1OlJgj e+WIXe/i+YY4bu+CN2/DHSQSTxRRWieRkqNInlpjh+IIUJxpY18i9Ifm+ssNjpWOI5pT kkHPMAJlLK60OFmm/qwLr12jEUmof6GRma8k7P5g1qJGAFGHiImLDDXgmg0avY0YknLO 07Zw== X-Gm-Message-State: ABuFfohOzOHtAyO8Q5D3rMT6s2PKhtH83kmQ6v5W6OTkA8A+XY+dWQRZ YhYKyOB9SLPVtitn+GOIm4Xq9v9lw4M= X-Received: by 2002:a62:9b9a:: with SMTP id e26-v6mr17571762pfk.181.1538838801042; Sat, 06 Oct 2018 08:13:21 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:b0dd:ac42:e4a:4c9f? ([2601:646:c200:7429:b0dd:ac42:e4a:4c9f]) by smtp.gmail.com with ESMTPSA id 72-v6sm24717361pfr.115.2018.10.06.08.13.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Oct 2018 08:13:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [POC][RFC][PATCH 1/2] jump_function: Addition of new feature "jump_function" From: Andy Lutomirski X-Mailer: iPhone Mail (16A366) In-Reply-To: <20181006093905.46276505@vmware.local.home> Date: Sat, 6 Oct 2018 08:13:18 -0700 Cc: Peter Zijlstra , 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 Content-Transfer-Encoding: quoted-printable Message-Id: <1AF87411-7E98-4FD7-B3D8-F4C6423F24AE@amacapital.net> References: <20181006015110.653946300@goodmis.org> <20181006015720.634688468@goodmis.org> <20181006121211.GA5663@hirez.programming.kicks-ass.net> <20181006093905.46276505@vmware.local.home> To: Steven Rostedt Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 6, 2018, at 6:39 AM, Steven Rostedt wrote: >=20 > On Sat, 6 Oct 2018 14:12:11 +0200 > Peter Zijlstra wrote: >=20 >>> 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" ) =20 >>=20 >> Bah, what is it with you people and trampolines. Why can't we, just like >> jump_label, patch the call directly? >>=20 >> The whole call+jmp thing is silly, don't do that. It just wrecks I$ and >> is slower for no real reason afaict. >=20 > 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). >=20 >>=20 >> Steve, also see: >>=20 >> https://lkml.kernel.org/r/20181005081333.15018-1-ard.biesheuvel@linaro.o= rg >=20 > Interesting. I don't have time to look at it at the moment to see what > was done, but will do so in the near future. >=20 > Remember, this was a proof of concept and even with the trampolines, it > showed a great level of improvement. One thought was to do a > "recordmcount.c" type of action to find where the calls were and patch > them directly at boot up. I tried to keep the API the same where this > could actually be done as an improvement later. >=20 > Perhaps a gcc plugin might work too. >=20 My suggestion was to have objtool do the dirty work. Josh said something sus= piciously like =E2=80=9Csounds fun=E2=80=9D on IRC :) > I'll have to see what Ard did to handle the function parameters. >=20 > -- Steve >=20