ppc64: fix missing to check all bits of _TIF_USER_WORK_MASK in preempt
authorTiejun Chen <tiejun.chen@windriver.com>
Wed, 6 Jun 2012 20:56:43 +0000 (20:56 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 29 Jun 2012 04:35:35 +0000 (14:35 +1000)
commitc58ce2b1e3c75c55e7ebf751afce9f5a30f60b42
treefdc5569cb1afea0afeb09eb818d194f17bdecc11
parent82b2521d257b5c0efd51821cf5fa306e53bbb6ba
ppc64: fix missing to check all bits of _TIF_USER_WORK_MASK in preempt

In entry_64.S version of ret_from_except_lite, you'll notice that
in the !preempt case, after we've checked MSR_PR we test for any
TIF flag in _TIF_USER_WORK_MASK to decide whether to go to do_work
or not. However, in the preempt case, we do a convoluted trick to
test SIGPENDING only if PR was set and always test NEED_RESCHED ...
but we forget to test any other bit of _TIF_USER_WORK_MASK !!! So
that means that with preempt, we completely fail to test for things
like single step, syscall tracing, etc...

This should be fixed as the following path:

 - Test PR. If not set, go to resume_kernel, else continue.

 - If go resume_kernel, to do that original do_work.

 - If else, then always test for _TIF_USER_WORK_MASK to decide to do
that original user_work, else restore directly.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/entry_64.S