Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4000547ybp; Mon, 7 Oct 2019 01:19:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnTeX86rmAIgowNFq8mj9SgAMe5WO+7dRsQQw8ziXxHnZtiRBl3I8KXBSypcNYzGS4Ftbb X-Received: by 2002:a17:906:82c1:: with SMTP id a1mr22915691ejy.187.1570436355649; Mon, 07 Oct 2019 01:19:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570436355; cv=none; d=google.com; s=arc-20160816; b=pTEzOk5XpZh4yiSOSQGCMr4Kv9srem88Js9hrtTUReje9fnHcT01E0/kidQmojVbAJ tYCYupf1kZN0KSfhhQio4qQDK5DqIG4XufoU/eIvAhF1AjdmYucIHgK9R/WbnqtL3Wcj mNqm52qQT/VBInPasDwpDRPrMjA0tRuKBL6xn0g6rhXKuPeEfOH8u/kLhqjCgEDLqJwF wchGboCTy/3xx3I1BhbgjuyOfRjhcNG4/CZYwXOh+d+IVxAb3a9qnnZfPjdROSM7YJzg uROSQOBH3Ianu2VwRw5O8pAzV/3sIU3Jk2Izpr1CG0QUiAjmiO26C2NyoGTIRmE7aZb4 9QIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9igMORVn6i3krjPJJBQINTmI7ZA1CfbVwh8Wl5AgPVQ=; b=XDsErPxpl1eK3qNRuRR3hw2Q0GYAm4aHaf6Bsu322QskIScvCNUqx5+0v3PXecGxPY onexNoNuOPmKmSdB7l34DI/j6lUJ4CsI++uFrn6t94e+mW28R/CS5XCSurdFK6CYtX3t 9aNtPvpgfLkuqxgJPEV3srxVqA1RMpbWHRDY292OoKCpE0dyxe9ova2EKvMc7AuX+Ikf M30fSmuHBWTgmrK6TYR41HSHEVITCLzM3fovYP5hu3w7hLw7SGJ6WNjKVgZc7vwdyPb6 17sbH7f68A+xMd2DeVyGKxijnfYhslAnHJD3I4/tH6WRuI1TjwIpTbwrXLZ9DuaW00or guwQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d25si7772326eds.40.2019.10.07.01.18.52; Mon, 07 Oct 2019 01:19:15 -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; 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 S1727496AbfJGIRS (ORCPT + 99 others); Mon, 7 Oct 2019 04:17:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:56240 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727448AbfJGIRS (ORCPT ); Mon, 7 Oct 2019 04:17:18 -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 DC998AE46; Mon, 7 Oct 2019 08:17:16 +0000 (UTC) From: Miroslav Benes To: rostedt@goodmis.org, mingo@redhat.com, jpoimboe@redhat.com, jikos@kernel.org, pmladek@suse.com, joe.lawrence@redhat.com Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Miroslav Benes Subject: [PATCH 0/3] ftrace: Introduce PERMANENT ftrace_ops flag Date: Mon, 7 Oct 2019 10:17:11 +0200 Message-Id: <20191007081714.20259-1-mbenes@suse.cz> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Livepatch uses ftrace for redirection to new patched functions. It is thus directly affected by ftrace sysctl knobs such as ftrace_enabled. Setting ftrace_enabled to 0 also disables all live patched functions. It is not a problem per se, because only administrator can set sysctl values, but it still may be surprising. Introduce PERMANENT ftrace_ops flag to amend this. If the FTRACE_OPS_FL_PERMANENT is set, the tracing of the function is not disabled. Such ftrace_ops can still be unregistered in a standard way. The patch set passes ftrace and livepatch kselftests. Miroslav Benes (3): ftrace: Make test_rec_ops_needs_regs() generic ftrace: Introduce PERMANENT ftrace_ops flag livepatch: Use FTRACE_OPS_FL_PERMANENT Documentation/trace/ftrace-uses.rst | 6 ++++ Documentation/trace/ftrace.rst | 2 ++ include/linux/ftrace.h | 8 +++-- kernel/livepatch/patch.c | 3 +- kernel/trace/ftrace.c | 47 ++++++++++++++++++++++++----- 5 files changed, 55 insertions(+), 11 deletions(-) -- 2.23.0