uprobes: Change uprobe_copy_process() to dup xol_area
[platform/adaptation/renesas_rcar/renesas_kernel.git] / kernel / context_tracking.c
index 247091b..859c8df 100644 (file)
@@ -51,6 +51,15 @@ void context_tracking_user_enter(void)
        unsigned long flags;
 
        /*
+        * Repeat the user_enter() check here because some archs may be calling
+        * this from asm and if no CPU needs context tracking, they shouldn't
+        * go further. Repeat the check here until they support the static key
+        * check.
+        */
+       if (!static_key_false(&context_tracking_enabled))
+               return;
+
+       /*
         * Some contexts may involve an exception occuring in an irq,
         * leading to that nesting:
         * rcu_irq_enter() rcu_user_exit() rcu_user_exit() rcu_irq_exit()
@@ -151,6 +160,9 @@ void context_tracking_user_exit(void)
 {
        unsigned long flags;
 
+       if (!static_key_false(&context_tracking_enabled))
+               return;
+
        if (in_interrupt())
                return;