Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5897697ybp; Tue, 15 Oct 2019 06:43:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSlh6/NL3X3kGqZscaC0Gl6k3DfuwErMNY956A2KfljeYHfyp+P+JgBcnb7vzJvNlwf6HN X-Received: by 2002:a05:6402:170e:: with SMTP id y14mr33902599edu.82.1571147016241; Tue, 15 Oct 2019 06:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571147016; cv=none; d=google.com; s=arc-20160816; b=CQE9CWMdlVQpXACesa6AAZFvfmwR7wwUgT84HcPk83FiVLP6KERi1fe/fUz4bbWAtu hdwp+gMJXrRzEfG/zI6YGiXAvAiO/OG7hr4uK3w27XbCRh1XPlELiDHMB5qGyx3Kznw9 I0senoJK2ekRHwBPQeQiUS13qDvxs32kFVofBaa8RaW+UHZwwRHfctgO3f/ZTwOLCkRe QRG+OgIOhx9YyaoxW+N7hYqJNqaLgBg+YFStItEY0Tp0Kv0XfNgRtgrhoPtpcZjZHabb obB4eSF0fus1E3cV4FN1CJoF2jAI8mj1hc2ML11Zp1xYzFZ/0dXvWcnbZByMceX5aSTa 60Pg== 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=AKETJ2nfkH7uXxWCCj7sIia2rz/qZRIp9whr7XMbtYg=; b=wM3TRIcpK9dBA+Hh9ai+hxYBiNAN6AtYgJvUhuPjwBtoR4ZkKGYM0ZUppDrDpTrm+r fpjBuYD4Ayaqw8eHorRoJ4BNgbHR26i/mPqYgIm1kM9C8hOZ8mmiqs941/E/62/YSLEJ fScWWTN4f9CCZ+kZ5Ooy+VZbBlnNsi7nYQ+W9Cq7CqZ5wgeeIBxwFWUuedKJHpt/Gi4b 1iQeQWs9iQSHxCs5TlRqCUKnTF8BcoZlGOsMInZcL9TbGvRQnfjDTDAvz2h5PbPtgV+Q raae1KDlrP4+jMwO0W1Yp/+e9WW7NtJz9+ZasNR7VGfmIkRrXTnOh/VnQnsK6UHRbGeW c4Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ExujiklK; 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 bt13si13296030edb.245.2019.10.15.06.43.12; Tue, 15 Oct 2019 06:43:36 -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=ExujiklK; 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 S1732102AbfJONmq (ORCPT + 99 others); Tue, 15 Oct 2019 09:42:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:41254 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728880AbfJONmq (ORCPT ); Tue, 15 Oct 2019 09:42:46 -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=AKETJ2nfkH7uXxWCCj7sIia2rz/qZRIp9whr7XMbtYg=; b=ExujiklKpYGQs5qRdMBD1a134 Io09hhIpCZcfSrkebxinrJhEMRP+SHPdb0jWNRW6sGNTbTfztGeppICDkSMA4E5R1LlggR9VAic45 DJg+Vw/PUMqHiIPnlVsCFqgYBXHhGrjeFGRaTcYLKBhPP11NcAkuMyveJjpmdN47pSlu89YKdkd4f rDRMNWT4q8U/o0P/Gi6FRxGqpFDLihfrJXyLSNEwy8YPsTFVTFT0r6j/cOju27NlcVrLk8JXiJvwc /kGAS1QjBKxvOZMc6Dyj3Y88fGeMwU+o8pE4pGgqS0ELEDycU/nlAFAMziEwerHdUdKkWvMDZWk+/ i+ntNiW7w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKN5r-0006TP-Lk; Tue, 15 Oct 2019 13:42:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 28005300B8D; Tue, 15 Oct 2019 15:41:34 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 870A720B972E4; Tue, 15 Oct 2019 15:42:28 +0200 (CEST) Date: Tue, 15 Oct 2019 15:42:28 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: x86@kernel.org, linux-kernel@vger.kernel.org, mhiramat@kernel.org, bristot@redhat.com, jbaron@akamai.com, torvalds@linux-foundation.org, tglx@linutronix.de, mingo@kernel.org, namit@vmware.com, hpa@zytor.com, luto@kernel.org, ard.biesheuvel@linaro.org, jpoimboe@redhat.com, jeyu@kernel.org Subject: Re: [PATCH v3 5/6] x86/ftrace: Use text_poke() Message-ID: <20191015134228.GJ2328@hirez.programming.kicks-ass.net> References: <20191007081945.10951536.8@infradead.org> <20191008104335.6fcd78c9@gandalf.local.home> <20191009224135.2dcf7767@oasis.local.home> <20191010092054.GR2311@hirez.programming.kicks-ass.net> <20191010091956.48fbcf42@gandalf.local.home> <20191010140513.GT2311@hirez.programming.kicks-ass.net> <20191010115449.22044b53@gandalf.local.home> <20191010172819.GS2328@hirez.programming.kicks-ass.net> <20191011125903.GN2359@hirez.programming.kicks-ass.net> <20191015092802.5c9aea5e@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191015092802.5c9aea5e@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, Oct 15, 2019 at 09:28:02AM -0400, Steven Rostedt wrote: > On Fri, 11 Oct 2019 14:59:03 +0200 > Peter Zijlstra wrote: > > > On Thu, Oct 10, 2019 at 07:28:19PM +0200, Peter Zijlstra wrote: > > > > > Really the best solution is to move all the poking into > > > ftrace_module_init(), before we mark it RO+X. That's what I'm going to > > > do for jump_label and static_call as well, I just need to add that extra > > > notifier callback. > > > > OK, so I started writing that patch... or rather, I wrote the patch and > > started on the Changelog when I ran into trouble describing why we need > > it. > > > > That is, I'm struggling to explain why we cannot flip > > prepare_coming_module() and complete_formation(). > > > > Yes, it breaks ftrace, but I'm thinking that is all it breaks. So let me > > see if we can cure that. > > You are mainly worried about making text that is executable into > read-write again. What if we kept my one patch that just changed the > module in ftrace_module_enable() from read-only to read-write, but > before we ever set it executable. This still flips the protections back and forth, which is still really ugly. And afaict the only reason this is required is that set_all_modules_text_*() stuff. So please, instead of tinkering around, lets just kill that horrible interface and be done with it. There's only 2 users left, fixing those can't be too hard.