Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755414AbbBPKQR (ORCPT ); Mon, 16 Feb 2015 05:16:17 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:47212 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbbBPKQP (ORCPT ); Mon, 16 Feb 2015 05:16:15 -0500 Message-ID: <54E1C36B.5020907@suse.cz> Date: Mon, 16 Feb 2015 11:16:11 +0100 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Josh Poimboeuf , Seth Jennings , Jiri Kosina , Vojtech Pavlik CC: 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 References: <9c012546723ee556ea8c1118811d2d02b2d1c9ed.1423499826.git.jpoimboe@redhat.com> In-Reply-To: <9c012546723ee556ea8c1118811d2d02b2d1c9ed.1423499826.git.jpoimboe@redhat.com> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1884 Lines: 54 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. regards, -- js suse labs -- 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/