ARM: bugs: hook processor bug checking into SMP and suspend paths
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 7 Nov 2018 16:43:41 +0000 (11:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Nov 2018 07:20:37 +0000 (08:20 +0100)
Commit 26602161b5ba795928a5a719fe1d5d9f2ab5c3ef upstream.

Check for CPU bugs when secondary processors are being brought online,
and also when CPUs are resuming from a low power mode.  This gives an
opportunity to check that processor specific bug workarounds are
correctly enabled for all paths that a CPU re-enters the kernel.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Boot-tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: David A. Long <dave.long@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/bugs.h
arch/arm/kernel/bugs.c
arch/arm/kernel/smp.c
arch/arm/kernel/suspend.c

index ed122d294f3f9aff11e09dc951b7f5e8ff9a1d2e..73a99c72a930a98498a94423fe484c28aab0f583 100644 (file)
@@ -14,8 +14,10 @@ extern void check_writebuffer_bugs(void);
 
 #ifdef CONFIG_MMU
 extern void check_bugs(void);
+extern void check_other_bugs(void);
 #else
 #define check_bugs() do { } while (0)
+#define check_other_bugs() do { } while (0)
 #endif
 
 #endif
index 88024028bb7043919b79eaa4a4efd0aee0b59bb1..16e7ba2a9cc40c77f9d39a8e24efc861c7122273 100644 (file)
@@ -3,7 +3,12 @@
 #include <asm/bugs.h>
 #include <asm/proc-fns.h>
 
+void check_other_bugs(void)
+{
+}
+
 void __init check_bugs(void)
 {
        check_writebuffer_bugs();
+       check_other_bugs();
 }
index 7dd14e8395e62976b3083f677b0e4d2ea0d71d95..d2ce37da87d882e16231ff7996a0d8ed7605729c 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/irq_work.h>
 
 #include <linux/atomic.h>
+#include <asm/bugs.h>
 #include <asm/smp.h>
 #include <asm/cacheflush.h>
 #include <asm/cpu.h>
@@ -400,6 +401,9 @@ asmlinkage void secondary_start_kernel(void)
         * before we continue - which happens after __cpu_up returns.
         */
        set_cpu_online(cpu, true);
+
+       check_other_bugs();
+
        complete(&cpu_running);
 
        local_irq_enable();
index 9a2f882a0a2d1cdafaea431931326296e407a8cc..134f0d4326103afc75cf064f83bc876cc849a68d 100644 (file)
@@ -1,6 +1,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 
+#include <asm/bugs.h>
 #include <asm/cacheflush.h>
 #include <asm/idmap.h>
 #include <asm/pgalloc.h>
@@ -34,6 +35,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
                cpu_switch_mm(mm->pgd, mm);
                local_flush_bp_all();
                local_flush_tlb_all();
+               check_other_bugs();
        }
 
        return ret;