aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/entry.S
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-06-28 13:07:32 -0400
committerCatalin Marinas <catalin.marinas@arm.com>2016-07-01 06:46:00 -0400
commit7dd01aef055792260287c6708daf75aac3918f66 (patch)
treef064a41ff4949170f335e4fd495cdafb9d810903 /arch/arm64/kernel/entry.S
parent390bf1773c7eba3b45df62ae82b3d2be911185b7 (diff)
arm64: trap userspace "dc cvau" cache operation on errata-affected core
The ARM errata 819472, 826319, 827319 and 824069 for affected Cortex-A53 cores demand to promote "dc cvau" instructions to "dc civac". Since we allow userspace to also emit those instructions, we should make sure that "dc cvau" gets promoted there too. So lets grasp the nettle here and actually trap every userland cache maintenance instruction once we detect at least one affected core in the system. We then emulate the instruction by executing it on behalf of userland, promoting "dc cvau" to "dc civac" on the way and injecting access fault back into userspace. Signed-off-by: Andre Przywara <andre.przywara@arm.com> [catalin.marinas@arm.com: s/set_segfault/arm64_notify_segfault/] Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/entry.S')
-rw-r--r--arch/arm64/kernel/entry.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index eefffa81c6df..3eca5d34f7a6 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -451,7 +451,7 @@ el0_sync:
451 cmp x24, #ESR_ELx_EC_FP_EXC64 // FP/ASIMD exception 451 cmp x24, #ESR_ELx_EC_FP_EXC64 // FP/ASIMD exception
452 b.eq el0_fpsimd_exc 452 b.eq el0_fpsimd_exc
453 cmp x24, #ESR_ELx_EC_SYS64 // configurable trap 453 cmp x24, #ESR_ELx_EC_SYS64 // configurable trap
454 b.eq el0_undef 454 b.eq el0_sys
455 cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception 455 cmp x24, #ESR_ELx_EC_SP_ALIGN // stack alignment exception
456 b.eq el0_sp_pc 456 b.eq el0_sp_pc
457 cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception 457 cmp x24, #ESR_ELx_EC_PC_ALIGN // pc alignment exception
@@ -579,6 +579,16 @@ el0_undef:
579 mov x0, sp 579 mov x0, sp
580 bl do_undefinstr 580 bl do_undefinstr
581 b ret_to_user 581 b ret_to_user
582el0_sys:
583 /*
584 * System instructions, for trapped cache maintenance instructions
585 */
586 enable_dbg_and_irq
587 ct_user_exit
588 mov x0, x25
589 mov x1, sp
590 bl do_sysinstr
591 b ret_to_user
582el0_dbg: 592el0_dbg:
583 /* 593 /*
584 * Debug exception handling 594 * Debug exception handling