Commit 9f4f6943 authored by Russell King's avatar Russell King Committed by Stefan Bader

ARM: bugs: hook processor bug checking into SMP and suspend paths

BugLink: https://bugs.launchpad.net/bugs/1852110

Commit 26602161 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: 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>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent e96af199
...@@ -14,8 +14,10 @@ extern void check_writebuffer_bugs(void); ...@@ -14,8 +14,10 @@ extern void check_writebuffer_bugs(void);
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
extern void check_bugs(void); extern void check_bugs(void);
extern void check_other_bugs(void);
#else #else
#define check_bugs() do { } while (0) #define check_bugs() do { } while (0)
#define check_other_bugs() do { } while (0)
#endif #endif
#endif #endif
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
#include <asm/bugs.h> #include <asm/bugs.h>
#include <asm/proc-fns.h> #include <asm/proc-fns.h>
void check_other_bugs(void)
{
}
void __init check_bugs(void) void __init check_bugs(void)
{ {
check_writebuffer_bugs(); check_writebuffer_bugs();
check_other_bugs();
} }
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/irq_work.h> #include <linux/irq_work.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/bugs.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cpu.h> #include <asm/cpu.h>
...@@ -396,6 +397,9 @@ asmlinkage void secondary_start_kernel(void) ...@@ -396,6 +397,9 @@ asmlinkage void secondary_start_kernel(void)
* before we continue - which happens after __cpu_up returns. * before we continue - which happens after __cpu_up returns.
*/ */
set_cpu_online(cpu, true); set_cpu_online(cpu, true);
check_other_bugs();
complete(&cpu_running); complete(&cpu_running);
local_irq_enable(); local_irq_enable();
......
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/bugs.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/idmap.h> #include <asm/idmap.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
...@@ -34,6 +35,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) ...@@ -34,6 +35,7 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
cpu_switch_mm(mm->pgd, mm); cpu_switch_mm(mm->pgd, mm);
local_flush_bp_all(); local_flush_bp_all();
local_flush_tlb_all(); local_flush_tlb_all();
check_other_bugs();
} }
return ret; return ret;
......
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