From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752218AbcA2GoP (ORCPT ); Fri, 29 Jan 2016 01:44:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38363 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbcA2GoN (ORCPT ); Fri, 29 Jan 2016 01:44:13 -0500 From: Jessica Yu To: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik , Miroslav Benes , Steven Rostedt , Ingo Molnar Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jessica Yu Subject: [PATCH 0/2] Fix ordering of ftrace + livepatch module notifier callbacks Date: Fri, 29 Jan 2016 01:43:45 -0500 Message-Id: <1454049827-3726-1-git-send-email-jeyu@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As explained here [1], livepatch modules are failing to initialize properly because the ftrace coming module notifier (which calls ftrace_module_enable()) runs after the livepatch module notifier (which enables the patch(es)). Thus livepatch attempts to apply patches to modules before ftrace_module_enable() is even called for the corresponding module(s). Separate klp_module_notify() into coming and going notifiers and tweak the priorities to fix the order in which the ftrace and livepatch notifiers are called. Tested the changes with a test livepatch module that patches 9p and nilfs2, and verified that the issue is fixed. Patch 1/2 based on the 'for-next' branch in livepatching - git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching.git Patch 2/2 based on the 'ftrace/core' branch in linux-trace - git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git [1] http://lkml.kernel.org/g/20160128204033.GA32131@packer-debian-8-amd64.digitalocean.com Jessica Yu (2): livepatch: Implement separate coming and going module notifiers ftrace: Adjust priority of ftrace module notifier kernel/livepatch/core.c | 128 +++++++++++++++++++++++++++--------------------- kernel/trace/ftrace.c | 7 ++- 2 files changed, 79 insertions(+), 56 deletions(-) -- 2.4.3