[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150217145830.GD11861@treble.redhat.com>
Date: Tue, 17 Feb 2015 08:58:30 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Jiri Slaby <jslaby@...e.cz>
Cc: Seth Jennings <sjenning@...hat.com>, Jiri Kosina <jkosina@...e.cz>,
Vojtech Pavlik <vojtech@...e.cz>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 9/9] livepatch: update task universe when exiting
kernel
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 <jpoimboe@...hat.com>
> > ---
> > 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 <linux/tick.h>
> > #include <linux/mm.h>
> > #include <linux/stackprotector.h>
> > +#include <linux/livepatch.h>
> >
> > #include <asm/tlb.h>
> >
> > @@ -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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists