diff options
| author | Ingo Molnar <mingo@kernel.org> | 2014-01-25 03:16:14 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2014-01-25 03:16:14 -0500 |
| commit | 2b45e0f9f34f718725e093f4e335600811d7105a (patch) | |
| tree | 3c6d594539eb16fc955906da65b9fa7aacbc9145 /include/linux | |
| parent | a85eba8814631d0d48361c8b9a7ee0984e80c03c (diff) | |
| parent | 15c81026204da897a05424c79263aea861a782cc (diff) | |
Merge branch 'linus' into x86/urgent
Merge in the x86 changes to apply a fix.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
38 files changed, 563 insertions, 851 deletions
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h index 27b1bcffe408..86c12c93e3cf 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h | |||
| @@ -1,9 +1,35 @@ | |||
| 1 | #ifndef _LINUX_BH_H | 1 | #ifndef _LINUX_BH_H |
| 2 | #define _LINUX_BH_H | 2 | #define _LINUX_BH_H |
| 3 | 3 | ||
| 4 | extern void local_bh_disable(void); | 4 | #include <linux/preempt.h> |
| 5 | #include <linux/preempt_mask.h> | ||
| 6 | |||
| 7 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
| 8 | extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt); | ||
| 9 | #else | ||
| 10 | static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt) | ||
| 11 | { | ||
| 12 | preempt_count_add(cnt); | ||
| 13 | barrier(); | ||
| 14 | } | ||
| 15 | #endif | ||
| 16 | |||
| 17 | static inline void local_bh_disable(void) | ||
| 18 | { | ||
| 19 | __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 20 | } | ||
| 21 | |||
| 5 | extern void _local_bh_enable(void); | 22 | extern void _local_bh_enable(void); |
| 6 | extern void local_bh_enable(void); | 23 | extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt); |
| 7 | extern void local_bh_enable_ip(unsigned long ip); | 24 | |
| 25 | static inline void local_bh_enable_ip(unsigned long ip) | ||
| 26 | { | ||
| 27 | __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET); | ||
| 28 | } | ||
| 29 | |||
| 30 | static inline void local_bh_enable(void) | ||
| 31 | { | ||
| 32 | __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET); | ||
| 33 | } | ||
| 8 | 34 | ||
| 9 | #endif /* _LINUX_BH_H */ | 35 | #endif /* _LINUX_BH_H */ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 92669cd182a6..fe7a686dfd8d 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -298,6 +298,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 298 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
| 299 | #endif | 299 | #endif |
| 300 | 300 | ||
| 301 | /* Is this type a native word size -- useful for atomic operations */ | ||
| 302 | #ifndef __native_word | ||
| 303 | # define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) | ||
| 304 | #endif | ||
| 305 | |||
| 301 | /* Compile time object size, -1 for unknown */ | 306 | /* Compile time object size, -1 for unknown */ |
| 302 | #ifndef __compiletime_object_size | 307 | #ifndef __compiletime_object_size |
| 303 | # define __compiletime_object_size(obj) -1 | 308 | # define __compiletime_object_size(obj) -1 |
| @@ -337,6 +342,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 337 | #define compiletime_assert(condition, msg) \ | 342 | #define compiletime_assert(condition, msg) \ |
| 338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | 343 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) |
| 339 | 344 | ||
| 345 | #define compiletime_assert_atomic_type(t) \ | ||
| 346 | compiletime_assert(__native_word(t), \ | ||
| 347 | "Need native word sized stores/loads for atomicity.") | ||
| 348 | |||
| 340 | /* | 349 | /* |
| 341 | * Prevent the compiler from merging or refetching accesses. The compiler | 350 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 351 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 158158704c30..37b81bd51ec0 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
| @@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev, | |||
| 17 | 17 | ||
| 18 | static inline void user_enter(void) | 18 | static inline void user_enter(void) |
| 19 | { | 19 | { |
| 20 | if (static_key_false(&context_tracking_enabled)) | 20 | if (context_tracking_is_enabled()) |
| 21 | context_tracking_user_enter(); | 21 | context_tracking_user_enter(); |
| 22 | 22 | ||
| 23 | } | 23 | } |
| 24 | static inline void user_exit(void) | 24 | static inline void user_exit(void) |
| 25 | { | 25 | { |
| 26 | if (static_key_false(&context_tracking_enabled)) | 26 | if (context_tracking_is_enabled()) |
| 27 | context_tracking_user_exit(); | 27 | context_tracking_user_exit(); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| @@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 31 | { | 31 | { |
| 32 | enum ctx_state prev_ctx; | 32 | enum ctx_state prev_ctx; |
| 33 | 33 | ||
| 34 | if (!static_key_false(&context_tracking_enabled)) | 34 | if (!context_tracking_is_enabled()) |
| 35 | return 0; | 35 | return 0; |
| 36 | 36 | ||
| 37 | prev_ctx = this_cpu_read(context_tracking.state); | 37 | prev_ctx = this_cpu_read(context_tracking.state); |
| @@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void) | |||
| 42 | 42 | ||
| 43 | static inline void exception_exit(enum ctx_state prev_ctx) | 43 | static inline void exception_exit(enum ctx_state prev_ctx) |
| 44 | { | 44 | { |
| 45 | if (static_key_false(&context_tracking_enabled)) { | 45 | if (context_tracking_is_enabled()) { |
| 46 | if (prev_ctx == IN_USER) | 46 | if (prev_ctx == IN_USER) |
| 47 | context_tracking_user_enter(); | 47 | context_tracking_user_enter(); |
| 48 | } | 48 | } |
| @@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) | |||
| 51 | static inline void context_tracking_task_switch(struct task_struct *prev, | 51 | static inline void context_tracking_task_switch(struct task_struct *prev, |
| 52 | struct task_struct *next) | 52 | struct task_struct *next) |
| 53 | { | 53 | { |
| 54 | if (static_key_false(&context_tracking_enabled)) | 54 | if (context_tracking_is_enabled()) |
| 55 | __context_tracking_task_switch(prev, next); | 55 | __context_tracking_task_switch(prev, next); |
| 56 | } | 56 | } |
| 57 | #else | 57 | #else |
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 { | |||
| 22 | |||
