diff options
author | James Morse <james.morse@arm.com> | 2019-06-18 11:17:33 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2019-07-05 08:03:29 -0400 |
commit | 2b68a2a963a157f024c67c0697b16f5f792c8a35 (patch) | |
tree | fb83b9c73f83ab18a025a435eb057b0715f67bec | |
parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) |
arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS
The ESB-instruction is a nop on CPUs that don't implement the RAS
extensions. This lets us use it in places like the vectors without
having to use alternatives.
If someone disables CONFIG_ARM64_RAS_EXTN, this instruction still has
its RAS extensions behaviour, but we no longer read DISR_EL1 as this
register does depend on alternatives.
This could go wrong if we want to synchronize an SError from a KVM
guest. On a CPU that has the RAS extensions, but the KConfig option
was disabled, we consume the pending SError with no chance of ever
reading it.
Hide the ESB-instruction behind the CONFIG_ARM64_RAS_EXTN option,
outputting a regular nop if the feature has been disabled.
Reported-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm64/include/asm/assembler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 570d195a184d..e3a15c751b13 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h | |||
@@ -96,7 +96,11 @@ | |||
96 | * RAS Error Synchronization barrier | 96 | * RAS Error Synchronization barrier |
97 | */ | 97 | */ |
98 | .macro esb | 98 | .macro esb |
99 | #ifdef CONFIG_ARM64_RAS_EXTN | ||
99 | hint #16 | 100 | hint #16 |
101 | #else | ||
102 | nop | ||
103 | #endif | ||
100 | .endm | 104 | .endm |
101 | 105 | ||
102 | /* | 106 | /* |