From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53752C10F14 for ; Thu, 10 Oct 2019 08:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 268BB21929 for ; Thu, 10 Oct 2019 08:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390021AbfJJIuo (ORCPT ); Thu, 10 Oct 2019 04:50:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:44292 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390001AbfJJIuh (ORCPT ); Thu, 10 Oct 2019 04:50:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E6965AD7B; Thu, 10 Oct 2019 08:50:35 +0000 (UTC) Date: Thu, 10 Oct 2019 10:50:35 +0200 From: Petr Mladek To: Steven Rostedt Cc: jikos@kernel.org, Joe Lawrence , jpoimboe@redhat.com, mingo@redhat.com, Miroslav Benes , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH 0/3] ftrace: Introduce PERMANENT ftrace_ops flag Message-ID: <20191010085035.emsdks6xecazqc6k@pathway.suse.cz> References: <20191007081714.20259-1-mbenes@suse.cz> <20191008193534.GA16675@redhat.com> <20191009112234.bi7lvp4pvmna26vz@pathway.suse.cz> <20191009102654.501ad7c3@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191009102654.501ad7c3@gandalf.local.home> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2019-10-09 10:26:54, Steven Rostedt wrote: > Petr Mladek wrote: > I think Joe's approach is much easier to understand and implement. The > "ftrace_enabled" is a global flag, and affects all things ftrace (the > function bindings). What this patch was doing, was what you said. Make > ftrace_enabled only affect the ftrace_ops without the "PERMANENT" flag > set. But that is complex and requires a bit more accounting in the > ftrace system. Something I think we should try to avoid. >From my POV, the fact that livepatches make use of ftrace handlers is just an implementation detail. Ideally, users should not know about it. The livepatch handlers should be handled special way and should not be affected by the ftrace sysfs interface. And ideally, the ftrace sysfs interface should still be available for other ftrace users. I would understand if this would be too complicated and we would need to find a compromise. > What we are now proposing, is that if "ftrace_enabled" is not set, the > register_ftrace_function() will fail if the ftrace_ops passed to it has > the PERMANENT flag set (which would cause live patching to fail to > load). >From the livepatch point of view it would be more reliable if ftrace_ops with PERMANENT flag would force "ftrace_enabled" to be always true. It will make the flag unusable for other ftrace users. But it will be already be the case when it can't be disabled. Best Regards, Petr