]> git.baikalelectronics.ru Git - kernel.git/commit
context_tracking: Restore preempted context state after preempt_schedule_irq()
authorFrederic Weisbecker <fweisbec@gmail.com>
Sun, 24 Feb 2013 11:59:30 +0000 (12:59 +0100)
committerFrederic Weisbecker <fweisbec@gmail.com>
Thu, 7 Mar 2013 16:10:21 +0000 (17:10 +0100)
commitf6a9afdcd0974e99e677f1c170ad79a95d347913
tree3eb42a6ae0c6b25c27d946e6ffa4787f82ac952f
parent91b7c74189cc5eb8a0648587a17b970ca7c16673
context_tracking: Restore preempted context state after preempt_schedule_irq()

From the context tracking POV, preempt_schedule_irq() behaves pretty much
like an exception: It can be called anytime and schedule another task.

But currently it doesn't restore the context tracking state of the preempted
code on preempt_schedule_irq() return.

As a result, if preempt_schedule_irq() is called in the tiny frame between
user_enter() and the actual return to userspace, we resume userspace with
the wrong context tracking state.

Fix this by using exception_enter/exit() which are a perfect fit for this
kind of issue.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Mats Liljegren <mats.liljegren@enea.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/sched/core.c