aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/context_tracking.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-04-19 21:32:26 -0400
committerDave Airlie <airlied@redhat.com>2015-04-19 23:05:20 -0400
commit2c33ce009ca2389dbf0535d0672214d09738e35e (patch)
tree6186a6458c3c160385d794a23eaf07c786a9e61b /include/linux/context_tracking.h
parentcec32a47010647e8b0603726ebb75b990a4057a4 (diff)
parent09d51602cf84a1264946711dd4ea0dddbac599a1 (diff)
Merge Linus master into drm-next
The merge is clean, but the arm build fails afterwards, due to API changes in the regulator tree. I've included the patch into the merge to fix the build. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/linux/context_tracking.h')
-rw-r--r--include/linux/context_tracking.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index 37b81bd51ec0..2821838256b4 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -10,6 +10,8 @@
10#ifdef CONFIG_CONTEXT_TRACKING 10#ifdef CONFIG_CONTEXT_TRACKING
11extern void context_tracking_cpu_set(int cpu); 11extern void context_tracking_cpu_set(int cpu);
12 12
13extern void context_tracking_enter(enum ctx_state state);
14extern void context_tracking_exit(enum ctx_state state);
13extern void context_tracking_user_enter(void); 15extern void context_tracking_user_enter(void);
14extern void context_tracking_user_exit(void); 16extern void context_tracking_user_exit(void);
15extern void __context_tracking_task_switch(struct task_struct *prev, 17extern void __context_tracking_task_switch(struct task_struct *prev,
@@ -35,7 +37,8 @@ static inline enum ctx_state exception_enter(void)
35 return 0; 37 return 0;
36 38
37 prev_ctx = this_cpu_read(context_tracking.state); 39 prev_ctx = this_cpu_read(context_tracking.state);
38 context_tracking_user_exit(); 40 if (prev_ctx != CONTEXT_KERNEL)
41 context_tracking_exit(prev_ctx);
39 42
40 return prev_ctx; 43 return prev_ctx;
41} 44}
@@ -43,8 +46,8 @@ static inline enum ctx_state exception_enter(void)
43static inline void exception_exit(enum ctx_state prev_ctx) 46static inline void exception_exit(enum ctx_state prev_ctx)
44{ 47{
45 if (context_tracking_is_enabled()) { 48 if (context_tracking_is_enabled()) {
46 if (prev_ctx == IN_USER) 49 if (prev_ctx != CONTEXT_KERNEL)
47 context_tracking_user_enter(); 50 context_tracking_enter(prev_ctx);
48 } 51 }
49} 52}
50 53
@@ -78,10 +81,16 @@ static inline void guest_enter(void)
78 vtime_guest_enter(current); 81 vtime_guest_enter(current);
79 else 82 else
80 current->flags |= PF_VCPU; 83 current->flags |= PF_VCPU;
84
85 if (context_tracking_is_enabled())
86 context_tracking_enter(CONTEXT_GUEST);
81} 87}
82 88
83static inline void guest_exit(void) 89static inline void guest_exit(void)
84{ 90{
91 if (context_tracking_is_enabled())
92 context_tracking_exit(CONTEXT_GUEST);
93
85 if (vtime_accounting_enabled()) 94 if (vtime_accounting_enabled())
86 vtime_guest_exit(current); 95 vtime_guest_exit(current);
87 else 96 else