x86, traps: Fix ist_enter from userspace
authorAndy Lutomirski <luto@amacapital.net>
Sat, 31 Jan 2015 12:53:53 +0000 (04:53 -0800)
committerAndy Lutomirski <luto@amacapital.net>
Sun, 1 Feb 2015 12:02:53 +0000 (04:02 -0800)
commitb926e6f61a26036ee9eabe6761483954d481ad25
tree0ed87a7d7acc4e8f6e1e443f032b2444fd8eaa1e
parent772a9aca12567badb5b9caf2af249a5991f47ea8
x86, traps: Fix ist_enter from userspace

context_tracking_user_exit() has no effect if in_interrupt() returns true,
so ist_enter() didn't work.  Fix it by calling exception_enter(), and thus
context_tracking_user_exit(), before incrementing the preempt count.

This also adds an assertion that will catch the problem reliably if
CONFIG_PROVE_RCU=y to help prevent the bug from being reintroduced.

Link: http://lkml.kernel.org/r/261ebee6aee55a4724746d0d7024697013c40a08.1422709102.git.luto@amacapital.net
Fixes: 959274753857 x86, traps: Track entry into and exit from IST context
Reported-and-tested-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
arch/x86/kernel/traps.c