Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4747687yba; Tue, 30 Apr 2019 03:50:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqytcFDbTJpdua1JnAWbXalK1ar+foxgiPoaxvJTYzblYXXv11F5JU+EcIeFk+Cv+GS1zotE X-Received: by 2002:a63:4b20:: with SMTP id y32mr65636035pga.244.1556621432060; Tue, 30 Apr 2019 03:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556621432; cv=none; d=google.com; s=arc-20160816; b=CpJJyuFfRCvG1NdU8rRGAtPCI95wfx3Yu8hMJ2eo7ncbA/jzmGDfvtIGGZQaVK+81v Aw2OGtQMAxkt3Sh8NiNu7B673js/J8pZc2smMqkjGq4szawqBeE8cSBKR/PfaRm3sdCt zH+k9WYv6RT4dprtDNL88qyrFgWe/lkwmhG0mv813J7Uq0ENGFq3wFvTMmLrg0ue2pHv j1otbfdVi0P1Mxh8MIyMiOj+QS7fLvGYieHqfz8u+SYzwIwFR3hkubn2z5U933kb835r lVrUw9mWfoxgv1mt5lTGdHB7lWK4+18JPxTFUkdyn6W/ezO1xiKsaTGcYH5BfdRHehQP u+XQ== 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=hqqOHMMUuBvpuVQELeBZmURuJXjgQFqffW8kA9cAK/I=; b=Kf+0Aw11Ld/S1gjYan+dYSFgACa4Q+HxB/f8gAGZTBop/7rXcbcicsxLA4xcq+9WQy xVq0A6HrSqdD4exJcf234i3RaqQS4xhCDPc4bdtnnDXO/7kSOv4yLfSk2mwNom8DnBGY eMZmkismoUPCb49GDZ5oIPXtDATJoS4/SvGNiPY2qBwdSyO9nd8JYOEfLPYdtNwHPKOt Qo5l8FZpa4k0Tw47lDMuyu2XKrslA6JEAOVJZxasgXJ6nv6KKHE6qX5bQ8PL9bIOmYG3 sk+zaO6nssaNgzxA1hDZk4ceF9eiHwTjyx6jLlEaN7Wfxzveay57m0GIKiyNskYEEKmd 9lWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=PaVG+9Rw; 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 k12si34780371pgi.107.2019.04.30.03.50.16; Tue, 30 Apr 2019 03:50:32 -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=PaVG+9Rw; 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 S1727335AbfD3KrT (ORCPT + 99 others); Tue, 30 Apr 2019 06:47:19 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59070 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfD3KrT (ORCPT ); Tue, 30 Apr 2019 06:47:19 -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=hqqOHMMUuBvpuVQELeBZmURuJXjgQFqffW8kA9cAK/I=; b=PaVG+9RwpCsXq15eaBB6EYSbN kSbHYkqvjqUvSv3jpTDD9Z/uLy3t//bG0X+q/rBM5tUljQmNVrSIAC16d5DWJjguWhS03TvhXFVke m2tBVj6tvBTp0mR573beuNeRyZSVhY3M1m+BidytXleKrDBBZqCaR6QJFLPSlaidaZ2HPF+y1bEwS WZ1t8L0HPIZFikNyRg3L6ZMurl0eejHBOFV4y+vUIr5iMBjfipjE7DJFdIwN7KNXOmwsbqnddIIb4 x8YKCMOSStKAuoQRJbG7ZhKn3fq3uJb2stY/jCun14hfRD3yhi8H7az6tyHPLffJLOAMnz4bRGxeN 41K2u1XDw==; 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 1hLQHi-0004y1-Ln; Tue, 30 Apr 2019 10:46:50 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F4112203E886A; Tue, 30 Apr 2019 12:46:48 +0200 (CEST) Date: Tue, 30 Apr 2019 12:46:48 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: Linus Torvalds , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Josh Poimboeuf , 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 , Andy Lutomirski , Joerg Roedel , Linux List Kernel Mailing , live-patching@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH 3/4] x86/ftrace: make ftrace_int3_handler() not to skip fops invocation Message-ID: <20190430104648.GR2623@hirez.programming.kicks-ass.net> References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-4-nstange@suse.de> <20190427102657.GF2623@hirez.programming.kicks-ass.net> <20190428133826.3e142cfd@oasis.local.home> <20190429145250.1a5da6ed@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190429145250.1a5da6ed@gandalf.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 Mon, Apr 29, 2019 at 02:52:50PM -0400, Steven Rostedt wrote: > On Mon, 29 Apr 2019 11:06:58 -0700 > Linus Torvalds wrote: > > > +void replace_call(void *addr, const void *opcode, size_t len, void *target) > > +{ > > + bp_int3_call_target = target; > > + bp_int3_call_return = addr + len; > > + bp_int3_handler_irqoff = emulate_call_irqoff; > > + text_poke_bp(addr, opcode, len, emulate_call_irqon); > > +} > > Note, the function tracer does not use text poke. It does it in batch > mode. It can update over 40,000 calls in one go: Note that Daniel is adding batch stuff to text_poke(), because jump_label/static_key stuffs also end up wanting to change more than one site at a time and IPI spraying the machine for every single instance is hurting. So ideally ftrace would start to use the 'normal' code when that happens.