[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1604271120480.3836@pobox.suse.cz>
Date: Wed, 27 Apr 2016 11:37:20 +0200 (CEST)
From: Miroslav Benes <mbenes@...e.cz>
To: Balbir Singh <bsingharora@...il.com>
cc: Petr Mladek <pmladek@...e.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jessica Yu <jeyu@...hat.com>, Jiri Kosina <jikos@...nel.org>,
Vojtech Pavlik <vojtech@...e.com>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linuxppc-dev@...abs.org, Torsten Duwe <duwe@...e.de>,
Michael Ellerman <mpe@...erman.id.au>,
Nikolay Borisov <kernel@...p.com>
Subject: Re: [PATCH v2] livepatch: Add some basic LivePatch documentation
On Tue, 26 Apr 2016, Balbir Singh wrote:
> > + + Anything inlined into __schedule() can not be patched.
> > +
> > + The switch_to macro is inlined into __schedule(). It switches the
> > + context between two processes in the middle of the macro. It does
> > + not save RIP in x86_64 version (contrary to 32-bit version). Instead,
> > + the currently used __schedule()/switch_to() handles both processes.
> > +
> > + Now, let's have two different tasks. One calls the original
> > + __schedule(), its registers are stored in a defined order and it
> > + goes to sleep in the switch_to macro and some other task is restored
> > + using the original __schedule(). Then there is the second task which
> > + calls patched__schedule(), it goes to sleep there and the first task
> > + is picked by the patched__schedule(). Its RSP is restored and now
> > + the registers should be restored as well. But the order is different
> > + in the new patched__schedule(), so...
> > +
> > + There is a work in progress to remove this limitation.
> > +
>
> I am afraid the example requires more clarification. I don't quite get the order is different
Different order is not inevitable but perfectly possible (even probable).
GCC may simply generate different object code for patched__schedule() than
it did for __schedule(). The problem is when the prologue and epilogue are
different.
Miroslav
Powered by blists - more mailing lists