Commit 0d5360ee authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman

ARM: bugs: add support for per-processor bug checking

Commit 9d3a0492 upstream.

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: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Boot-tested-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarDavid A. Long <dave.long@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c7825c27
...@@ -36,6 +36,10 @@ extern struct processor { ...@@ -36,6 +36,10 @@ extern struct processor {
* Set up any processor specifics * Set up any processor specifics
*/ */
void (*_proc_init)(void); void (*_proc_init)(void);
/*
* Check for processor bugs
*/
void (*check_bugs)(void);
/* /*
* Disable any processor specifics * Disable any processor specifics
*/ */
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
void check_other_bugs(void) void check_other_bugs(void)
{ {
#ifdef MULTI_CPU
if (processor.check_bugs)
processor.check_bugs();
#endif
} }
void __init check_bugs(void) void __init check_bugs(void)
......
...@@ -273,13 +273,14 @@ ...@@ -273,13 +273,14 @@
mcr p15, 0, ip, c7, c10, 4 @ data write barrier mcr p15, 0, ip, c7, c10, 4 @ data write barrier
.endm .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 .type \name\()_processor_functions, #object
.align 2 .align 2
ENTRY(\name\()_processor_functions) ENTRY(\name\()_processor_functions)
.word \dabort .word \dabort
.word \pabort .word \pabort
.word cpu_\name\()_proc_init .word cpu_\name\()_proc_init
.word \bugs
.word cpu_\name\()_proc_fin .word cpu_\name\()_proc_fin
.word cpu_\name\()_reset .word cpu_\name\()_reset
.word cpu_\name\()_do_idle .word cpu_\name\()_do_idle
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment