aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/context_tracking_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/context_tracking_state.h')
-rw-r--r--include/linux/context_tracking_state.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index 0f1979d0674f..97a81225d037 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -22,15 +22,20 @@ struct context_tracking {
22extern struct static_key context_tracking_enabled; 22extern struct static_key context_tracking_enabled;
23DECLARE_PER_CPU(struct context_tracking, context_tracking); 23DECLARE_PER_CPU(struct context_tracking, context_tracking);
24 24
25static inline bool context_tracking_in_user(void) 25static inline bool context_tracking_is_enabled(void)
26{ 26{
27 return __this_cpu_read(context_tracking.state) == IN_USER; 27 return static_key_false(&context_tracking_enabled);
28} 28}
29 29
30static inline bool context_tracking_active(void) 30static inline bool context_tracking_cpu_is_enabled(void)
31{ 31{
32 return __this_cpu_read(context_tracking.active); 32 return __this_cpu_read(context_tracking.active);
33} 33}
34
35static inline bool context_tracking_in_user(void)
36{
37 return __this_cpu_read(context_tracking.state) == IN_USER;
38}
34#else 39#else
35static inline bool context_tracking_in_user(void) { return false; } 40static inline bool context_tracking_in_user(void) { return false; }
36static inline bool context_tracking_active(void) { return false; } 41static inline bool context_tracking_active(void) { return false; }