diff options
author | Jon Medhurst <tixy@linaro.org> | 2017-03-02 13:04:09 +0000 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2017-03-21 16:24:19 +0000 |
commit | 974310d047f3c7788a51d10c8d255eebdb1fa857 (patch) | |
tree | 77d6b6625aee34f7616532e2adce8623a44acc21 /arch/arm/mach-vexpress | |
parent | 06553175f585b52509c7df37d6f4a50aacb7b211 (diff) |
arm: kprobes: Align stack to 8-bytes in test code
kprobes test cases need to have a stack that is aligned to an 8-byte
boundary because they call other functions (and the ARM ABI mandates
that alignment) and because test cases include 64-bit accesses to the
stack. Unfortunately, GCC doesn't ensure this alignment for inline
assembler and for the code in question seems to always misalign it by
pushing just the LR register onto the stack. We therefore need to
explicitly perform stack alignment at the start of each test case.
Without this fix, some test cases will generate alignment faults on
systems where alignment is enforced. Even if the kernel is configured to
handle these faults in software, triggering them is ugly. It also
exposes limitations in the fault handling code which doesn't cope with
writes to the stack. E.g. when handling this instruction
strd r6, [sp, #-64]!
the fault handling code will write to a stack location below the SP
value at the point the fault occurred, which coincides with where the
exception handler has pushed the saved register context. This results in
corruption of those registers.
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'arch/arm/mach-vexpress')
0 files changed, 0 insertions, 0 deletions