mbox series

[0/8] arm64: Convert entry.S synchronous exception handling to C

Message ID 20191003171642.135652-1-james.morse@arm.com (mailing list archive)
Headers show
Series arm64: Convert entry.S synchronous exception handling to C | expand

Message

James Morse Oct. 3, 2019, 5:16 p.m. UTC
Hi folks,

This series is based on Mark Rutland's 'deasm' series here[0]. This is
just the parts that related to Synchronous Exceptions.

To handle v8.2 RAS errors directly in the kernel, we need to read from
some CPU system registers immediately after taking a synchronous external
abort.
Just to be awkward, the entry assembly calls 'inherit_daif', so if we
took an external abort from a pre-emptible context, we become pre-emptible
again before calling C code. If we moved to another CPU, we can't read the
the system registers.

Ideally, for an external abort, the entry code would increase the
preempt count. Doing this in assembly isn't going to improve entry.S
readability.


Bite the bullet, and move the synchronous exception paths into C.


This series can be retrieved from:
git://linux-arm.org/linux-jm.git deasm_sync_only/v1

(which has been force-pushed since the end of the merge-window...)

Patch one has already been posted as a fix here:
https://lore.kernel.org/linux-arm-kernel/20191003170127.127278-1-james.morse@arm.com/


Bugs welcome.


Thanks,

James


[0] https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/entry-deasm
[1] https://lore.kernel.org/linux-acpi/1562086280-5351-1-git-send-email-baicar@os.amperecomputing.com/


James Morse (5):
  arm64: Fix incorrect irqflag restore for priority masking for compat
  arm64: remove __exception annotations
  arm64: Add prototypes for functions called by entry.S
  arm64: Remove asmlinkage from updated functions
  arm64: entry-common: don't touch daif before bp-hardening

Mark Rutland (3):
  arm64: add local_daif_inherit()
  arm64: entry: convert el1_sync to C
  arm64: entry: convert el0_sync to C

 arch/arm64/include/asm/asm-uaccess.h |  10 -
 arch/arm64/include/asm/daifflags.h   |  16 ++
 arch/arm64/include/asm/exception.h   |  22 +-
 arch/arm64/include/asm/processor.h   |   7 +
 arch/arm64/include/asm/traps.h       |  10 -
 arch/arm64/kernel/Makefile           |   6 +-
 arch/arm64/kernel/entry-common.c     | 331 +++++++++++++++++++++++++++
 arch/arm64/kernel/entry.S            | 274 +---------------------
 arch/arm64/kernel/fpsimd.c           |   6 +-
 arch/arm64/kernel/probes/kprobes.c   |   4 -
 arch/arm64/kernel/syscall.c          |   4 +-
 arch/arm64/kernel/traps.c            |  12 +-
 arch/arm64/kernel/vmlinux.lds.S      |   3 -
 arch/arm64/mm/fault.c                |  55 ++---
 14 files changed, 409 insertions(+), 351 deletions(-)
 create mode 100644 arch/arm64/kernel/entry-common.c