hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/lib/smp_processor_id.c
....@@ -5,10 +5,11 @@
55 * DEBUG_PREEMPT variant of smp_processor_id().
66 */
77 #include <linux/export.h>
8
+#include <linux/kprobes.h>
89 #include <linux/sched.h>
910
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)
1213 {
1314 int this_cpu = raw_smp_processor_id();
1415
....@@ -22,11 +23,6 @@
2223 * Kernel threads bound to a single CPU can safely use
2324 * smp_processor_id():
2425 */
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
-
3026 if (current->nr_cpus_allowed == 1)
3127 goto out;
3228
....@@ -41,6 +37,7 @@
4137 */
4238 preempt_disable_notrace();
4339
40
+ instrumentation_begin();
4441 if (!printk_ratelimit())
4542 goto out_enable;
4643
....@@ -51,18 +48,19 @@
5148 dump_stack();
5249
5350 out_enable:
51
+ instrumentation_end();
5452 preempt_enable_no_resched_notrace();
5553 out:
5654 return this_cpu;
5755 }
5856
59
-notrace unsigned int debug_smp_processor_id(void)
57
+noinstr unsigned int debug_smp_processor_id(void)
6058 {
6159 return check_preemption_disabled("smp_processor_id", "");
6260 }
6361 EXPORT_SYMBOL(debug_smp_processor_id);
6462
65
-notrace void __this_cpu_preempt_check(const char *op)
63
+noinstr void __this_cpu_preempt_check(const char *op)
6664 {
6765 check_preemption_disabled("__this_cpu_", op);
6866 }