.. | .. |
---|
5 | 5 | * DEBUG_PREEMPT variant of smp_processor_id(). |
---|
6 | 6 | */ |
---|
7 | 7 | #include <linux/export.h> |
---|
| 8 | +#include <linux/kprobes.h> |
---|
8 | 9 | #include <linux/sched.h> |
---|
9 | 10 | |
---|
10 | | -notrace static unsigned int check_preemption_disabled(const char *what1, |
---|
11 | | - const char *what2) |
---|
| 11 | +noinstr static |
---|
| 12 | +unsigned int check_preemption_disabled(const char *what1, const char *what2) |
---|
12 | 13 | { |
---|
13 | 14 | int this_cpu = raw_smp_processor_id(); |
---|
14 | 15 | |
---|
.. | .. |
---|
22 | 23 | * Kernel threads bound to a single CPU can safely use |
---|
23 | 24 | * smp_processor_id(): |
---|
24 | 25 | */ |
---|
25 | | -#if defined(CONFIG_PREEMPT_RT_BASE) && (defined(CONFIG_SMP) || defined(CONFIG_SCHED_DEBUG)) |
---|
26 | | - if (current->migrate_disable) |
---|
27 | | - goto out; |
---|
28 | | -#endif |
---|
29 | | - |
---|
30 | 26 | if (current->nr_cpus_allowed == 1) |
---|
31 | 27 | goto out; |
---|
32 | 28 | |
---|
.. | .. |
---|
41 | 37 | */ |
---|
42 | 38 | preempt_disable_notrace(); |
---|
43 | 39 | |
---|
| 40 | + instrumentation_begin(); |
---|
44 | 41 | if (!printk_ratelimit()) |
---|
45 | 42 | goto out_enable; |
---|
46 | 43 | |
---|
.. | .. |
---|
51 | 48 | dump_stack(); |
---|
52 | 49 | |
---|
53 | 50 | out_enable: |
---|
| 51 | + instrumentation_end(); |
---|
54 | 52 | preempt_enable_no_resched_notrace(); |
---|
55 | 53 | out: |
---|
56 | 54 | return this_cpu; |
---|
57 | 55 | } |
---|
58 | 56 | |
---|
59 | | -notrace unsigned int debug_smp_processor_id(void) |
---|
| 57 | +noinstr unsigned int debug_smp_processor_id(void) |
---|
60 | 58 | { |
---|
61 | 59 | return check_preemption_disabled("smp_processor_id", ""); |
---|
62 | 60 | } |
---|
63 | 61 | EXPORT_SYMBOL(debug_smp_processor_id); |
---|
64 | 62 | |
---|
65 | | -notrace void __this_cpu_preempt_check(const char *op) |
---|
| 63 | +noinstr void __this_cpu_preempt_check(const char *op) |
---|
66 | 64 | { |
---|
67 | 65 | check_preemption_disabled("__this_cpu_", op); |
---|
68 | 66 | } |
---|