Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbbBQO6j (ORCPT ); Tue, 17 Feb 2015 09:58:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217AbbBQO6h (ORCPT ); Tue, 17 Feb 2015 09:58:37 -0500 Date: Tue, 17 Feb 2015 08:58:30 -0600 From: Josh Poimboeuf To: Jiri Slaby Cc: Seth Jennings , Jiri Kosina , Vojtech Pavlik , Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 9/9] livepatch: update task universe when exiting kernel Message-ID: <20150217145830.GD11861@treble.redhat.com> References: <9c012546723ee556ea8c1118811d2d02b2d1c9ed.1423499826.git.jpoimboe@redhat.com> <54E1C36B.5020907@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54E1C36B.5020907@suse.cz> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 55 On Mon, Feb 16, 2015 at 11:16:11AM +0100, Jiri Slaby wrote: > On 02/09/2015, 06:31 PM, Josh Poimboeuf wrote: > > Update a tasks's universe when returning from a system call or user > > space interrupt, or after handling a signal. > > > > This greatly increases the chances of a patch operation succeeding. If > > a task is I/O bound, it can switch universes when returning from a > > system call. If a task is CPU bound, it can switch universes when > > returning from an interrupt. If a task is sleeping on a to-be-patched > > function, the user can send SIGSTOP and SIGCONT to force it to switch. > > > > Since the idle "swapper" tasks don't ever exit the kernel, they're > > updated from within the idle loop. > > > > Signed-off-by: Josh Poimboeuf > > --- > > arch/x86/include/asm/thread_info.h | 4 +++- > > arch/x86/kernel/signal.c | 4 ++++ > > include/linux/livepatch.h | 2 ++ > > kernel/livepatch/transition.c | 15 +++++++++++++++ > > kernel/sched/idle.c | 4 ++++ > ... > > --- a/kernel/sched/idle.c > > +++ b/kernel/sched/idle.c > > @@ -7,6 +7,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > > > @@ -250,6 +251,9 @@ static void cpu_idle_loop(void) > > > > sched_ttwu_pending(); > > schedule_preempt_disabled(); > > + > > + if (unlikely(test_thread_flag(TIF_KLP_NEED_UPDATE))) > > + klp_update_task_universe(current); > > Oh, this is indeed broken on non-x86 archs as kbuild reports. > (TIF_KLP_NEED_UPDATE undefined) > > We need a klp_maybe_update_task_universe inline or something like that > and define it void for non-LIVEPATCH configs. Doh, thanks. -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/