]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: bugs: add support for per-processor bug checking
authorRussell King <rmk+kernel@armlinux.org.uk>
Thu, 10 May 2018 12:07:29 +0000 (13:07 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 31 May 2018 09:39:34 +0000 (10:39 +0100)
Add support for per-processor bug checking - each processor function
descriptor gains a function pointer for this check, which must not be
an __init function.  If non-NULL, this will be called whenever a CPU
enters the kernel via which ever path (boot CPU, secondary CPU startup,
CPU resuming, etc.)

This allows processor specific bug checks to validate that workaround
bits are properly enabled by firmware via all entry paths to 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>
arch/arm/include/asm/proc-fns.h
arch/arm/kernel/bugs.c
arch/arm/mm/proc-macros.S

index f2e1af45bd6fae33e8f22a9c8d8c0d8cf7a5b7c9..e25f4392e1b2868446de858701d408aaaee26eab 100644 (file)
@@ -36,6 +36,10 @@ extern struct processor {
         * Set up any processor specifics
         */
        void (*_proc_init)(void);
+       /*
+        * Check for processor bugs
+        */
+       void (*check_bugs)(void);
        /*
         * Disable any processor specifics
         */
index 16e7ba2a9cc40c77f9d39a8e24efc861c7122273..7be5113101915cd81a5558f45238041138fb5a58 100644 (file)
@@ -5,6 +5,10 @@
 
 void check_other_bugs(void)
 {
+#ifdef MULTI_CPU
+       if (processor.check_bugs)
+               processor.check_bugs();
+#endif
 }
 
 void __init check_bugs(void)
index f10e31d0730afa572cb6604d65813eb6df1dcfa9..81d0efb055c66080e976f9504c69866f7699b1a6 100644 (file)
        mcr     p15, 0, ip, c7, c10, 4          @ data write barrier
        .endm
 
-.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0
+.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0, bugs=0
        .type   \name\()_processor_functions, #object
        .align 2
 ENTRY(\name\()_processor_functions)
        .word   \dabort
        .word   \pabort
        .word   cpu_\name\()_proc_init
+       .word   \bugs
        .word   cpu_\name\()_proc_fin
        .word   cpu_\name\()_reset
        .word   cpu_\name\()_do_idle