Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4982118yba; Tue, 30 Apr 2019 07:22:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNlIxR3OWVixLr+4ju3CpdX5YOAb4TkaH9T0iUU1e3cjkfp3GEnlgNWmIOTU/ABdOSgjQI X-Received: by 2002:a62:125c:: with SMTP id a89mr2436529pfj.93.1556634167934; Tue, 30 Apr 2019 07:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556634167; cv=none; d=google.com; s=arc-20160816; b=happllhO0BhlTkEZlV+pUlB4jEVGKWVmd0+9seVvqF6fwpPJhTOkQHxYA2WWUha4L+ 5YBgR0EXjGHIwDcO8I1n8MOmqTT4XmQo6mbYsugysSPM7FT/+FppzkyfxAdsBn4x61l3 iB/d9R6ThXjM4Itg/20HA9MMNGnj855HkNZ2R3PJ+hP61RfT48L3yQr29xZAo7IEzuug 6yhSpoLf7O5hpQMr/TkDaFnrxgTQL4sa1EsWI8Q6vNZWHi4qEk0/ZKx89k+ii8V6ChUj HI4QEWg3PZ+aqnG70zKW368JRN2NfMrvw6IVv6khgJX30/ker5R+Anh3n4FMaDCZBIC5 C9Fg== 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=DmPQLX/JhEDEHGtqAEZE1FkXZlxjBDwjwufypaIFiWs=; b=MQbMydc/G5Lo0rbVph2HGvuyILZ1B2kIgMfaSkBScmBqazUKls7gWTTfDAlY8XHUhw vtF/2VN0xH6z8FoUGrwW8mBZSu4j1Ie/pz645z/OZnqtMbpbLpyHHuRY3N1AplhvCvpT LblB3sHSn5d792z9w59m7nMDyKOeZT3611KnmTJu7CK+jJ9/0pqL+L1b6KYZ+VnO87V+ BQiz9tvg48BrME5LvOF158yKtCVV3uLa06rf5L5VjSzBSjl6qpASd+fV3zepSRzDhNZh /fw3hy7ZSLwhdlRosuapMJogZdyhxikucr7rHxAv4Db2b33+K2FJ19XtbQbbpW8i6N2N Rzsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VnwvnEcn; 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 y66si36028589pgy.186.2019.04.30.07.22.29; Tue, 30 Apr 2019 07:22:47 -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=VnwvnEcn; 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 S1727180AbfD3OVX (ORCPT + 99 others); Tue, 30 Apr 2019 10:21:23 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37940 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbfD3OVX (ORCPT ); Tue, 30 Apr 2019 10:21:23 -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=DmPQLX/JhEDEHGtqAEZE1FkXZlxjBDwjwufypaIFiWs=; b=VnwvnEcnA1SyY3k0IXuwFMawd DPw6MkCqF+3qVTl302bH8+OWQeMLZxjmBZkpjs84ZS4cMoytqKQoNtRXSlK0k7TcKUpAZyLnv6atk eeSC9a1NLauiM7FrPFkXg13HgtTQLngTScVK2LVJqSu7KhSJq3Vwk3UDktsjfB2qwtKv5q+DNkl/C 3aen4Z2JIxMF1it3ut5qhj6Cy2WjlBzd+LBWtttEy5BceexLULpmSj85ylW9ajEnRUtSMVzCLItKx A0WWvqcB3pVZs9iHg6k0Em3cCrh/cuzy9zWWLJCHSD6/tFWsliJmEzRKbZfQ56uQT+4Gv+/e0VWSc olIuh6UXg==; 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 1hLTcm-0001Yt-O1; Tue, 30 Apr 2019 14:20:48 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8106F29D226A0; Tue, 30 Apr 2019 16:20:47 +0200 (CEST) Date: Tue, 30 Apr 2019 16:20:47 +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: <20190430142047.GF2589@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> <20190430104648.GR2623@hirez.programming.kicks-ass.net> <20190430094445.13e61f41@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430094445.13e61f41@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 Tue, Apr 30, 2019 at 09:44:45AM -0400, Steven Rostedt wrote: > On Tue, 30 Apr 2019 12:46:48 +0200 > Peter Zijlstra wrote: > > > 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. > > Sure, but that's a completely different issue. We would need to solve > the 'emulate' call for batch mode first. I don't see a problem there; when INT3 happens; you bsearch() the batch array to find the one you hit, you frob that into the percpu variables and do the thing. Or am I loosing the plot again?