aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/kernel/entry.S
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-02-01 11:48:58 +0000
committerMister Oyster <oysterized@gmail.com>2018-01-15 22:49:15 +0100
commit2ce612f1bf210b32b98e95ed3d64b4b4a4dd529d (patch)
tree201453135ff8844778977699f521d44a003303f0 /arch/arm64/kernel/entry.S
parentad746344214b9f5da9167490bb1d3903f2d638ce (diff)
BACKPORT: arm64: Add CNTVCT_EL0 trap handler
Since people seem to make a point in breaking the userspace visible counter, we have no choice but to trap the access. Add the required handler. Bug: 68266545 Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> (cherry picked from commit 6126ce0588eb5a0752d5c8b5796a7fca324fd887) Change-Id: I0705f47c85a78040df38df18f51a4a22500b904d
Diffstat (limited to 'arch/arm64/kernel/entry.S')
-rw-r--r--arch/arm64/kernel/entry.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 499d1667d..c653ffdfd 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -481,7 +481,7 @@ el0_sync:
cmp x24, #ESR_EL1_EC_FP_EXC64 // FP/ASIMD exception
b.eq el0_fpsimd_exc
cmp x24, #ESR_EL1_EC_SYS64 // configurable trap
- b.eq el0_undef
+ b.eq el0_sys
cmp x24, #ESR_EL1_EC_SP_ALIGN // stack alignment exception
b.eq el0_sp_pc
cmp x24, #ESR_EL1_EC_PC_ALIGN // pc alignment exception
@@ -607,6 +607,15 @@ el0_undef:
*/
mov x0, sp
b do_undefinstr
+el0_sys:
+ /*
+ * System instructions, for trapped cache maintenance instructions
+ */
+ enable_dbg
+ enable_irq
+ mov x0, x25
+ mov x1, sp
+ b do_sysinstr
el0_dbg:
/*
* Debug exception handling