From: rmk+kernel@armlinux.org.uk (Russell King)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 04/15] ARM: bugs: add support for per-processor bug checking
Date: Tue, 29 May 2018 10:09:17 +0100 [thread overview]
Message-ID: <E1fNad3-0000fj-20@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20180529090756.GG17671@n2100.armlinux.org.uk>
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>
---
arch/arm/include/asm/proc-fns.h | 4 ++++
arch/arm/kernel/bugs.c | 4 ++++
arch/arm/mm/proc-macros.S | 3 ++-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h
index f2e1af45bd6f..e25f4392e1b2 100644
--- a/arch/arm/include/asm/proc-fns.h
+++ b/arch/arm/include/asm/proc-fns.h
@@ -37,6 +37,10 @@ extern struct processor {
*/
void (*_proc_init)(void);
/*
+ * Check for processor bugs
+ */
+ void (*check_bugs)(void);
+ /*
* Disable any processor specifics
*/
void (*_proc_fin)(void);
diff --git a/arch/arm/kernel/bugs.c b/arch/arm/kernel/bugs.c
index 16e7ba2a9cc4..7be511310191 100644
--- a/arch/arm/kernel/bugs.c
+++ b/arch/arm/kernel/bugs.c
@@ -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)
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index f10e31d0730a..81d0efb055c6 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -273,13 +273,14 @@
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
--
2.7.4
next prev parent reply other threads:[~2018-05-29 9:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 9:07 [PATCH v4 00/15] ARM Spectre variant 2 fixes Russell King - ARM Linux
2018-05-29 9:09 ` [PATCH v4 01/15] ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs Russell King
2018-05-29 9:09 ` [PATCH v4 02/15] ARM: bugs: prepare processor bug infrastructure Russell King
2018-05-29 9:09 ` [PATCH v4 03/15] ARM: bugs: hook processor bug checking into SMP and suspend paths Russell King
2018-05-29 9:09 ` Russell King [this message]
2018-05-29 9:09 ` [PATCH v4 05/15] ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre Russell King
2018-05-29 9:09 ` [PATCH v4 06/15] ARM: spectre-v2: harden branch predictor on context switches Russell King
2018-05-29 9:09 ` [PATCH v4 07/15] ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit Russell King
2018-05-29 9:09 ` [PATCH v4 08/15] ARM: spectre-v2: harden user aborts in kernel space Russell King
2018-05-29 9:09 ` [PATCH v4 09/15] ARM: spectre-v2: add firmware based hardening Russell King
2018-05-29 9:09 ` [PATCH v4 10/15] ARM: spectre-v2: warn about incorrect context switching functions Russell King
2018-05-29 9:09 ` [PATCH v4 11/15] ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17 Russell King
2018-05-29 9:09 ` [PATCH v4 12/15] ARM: KVM: invalidate icache on guest exit for Cortex-A15 Russell King
2018-05-29 9:10 ` [PATCH v4 13/15] ARM: spectre-v2: KVM: invalidate icache on guest exit for Brahma B15 Russell King
2018-05-29 9:10 ` [PATCH v4 14/15] ARM: KVM: Add SMCCC_ARCH_WORKAROUND_1 fast handling Russell King
2018-05-29 9:10 ` [PATCH v4 15/15] ARM: KVM: report support for SMCCC_ARCH_WORKAROUND_1 Russell King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1fNad3-0000fj-20@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox