Skip to content

arm64: Convert entry.S synchronous exception handling to C

James Morse linux-arm-kernel 2 versions – Applied

Status from this message: Queued for 5.5. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 1 replyApplied
  2. v18 patches 14 repliesSuperseded

Changes in v2 from the cover letter

* Removed commit message typo in patch 2.
* Fixed do_debug_exception argument name.
* Moved ptrace.h to an earlier patch.
* Renamed addr_if_watchpoint far, and left a comment.
* Header include order
* Moved is_ttbr1_addr() into headers for symmetry
* Rebased to rc3, removing v1's patch 1 that was taken as a fix
---

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7arm64: remove __exception annotationsarch/arm64/include/asm/exception.h arch/arm64/include/asm/traps.h arch/arm64/kernel/probes/kprobes.c +3 more+26 -390 replies
2/7arm64: Add prototypes for functions called by entry.Sarch/arm64/include/asm/exception.h+22 -00 replies
3/7arm64: add local_daif_inherit()arch/arm64/include/asm/daifflags.h+16 -00 replies
4/7arm64: entry: convert el1_sync to Carch/arm64/kernel/Makefile arch/arm64/kernel/entry-common.c arch/arm64/kernel/entry.S+102 -710 replies
5/7arm64: entry: convert el0_sync to Carch/arm64/include/asm/asm-uaccess.h arch/arm64/kernel/entry-common.c arch/arm64/kernel/entry.S+227 -2110 replies
6/7arm64: Remove asmlinkage from updated functionsarch/arm64/include/asm/exception.h arch/arm64/kernel/fpsimd.c arch/arm64/kernel/syscall.c +2 more+32 -380 replies
7/7arm64: entry-common: don't touch daif before bp-hardeningarch/arm64/include/asm/processor.h arch/arm64/kernel/entry-common.c arch/arm64/mm/fault.c+30 -380 replies

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchMark RutlandMasami Hiramatsu
1/7A-b A-b
2/7A-b
3/7
4/7R-b
5/7R-b
6/7A-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] arm64: Convert entry.S synchronous exception handling to C

Hi folks,

---
Changes since v1:
* Removed commit message typo in patch 2.
* Fixed do_debug_exception argument name.
* Moved ptrace.h to an earlier patch.
* Renamed addr_if_watchpoint far, and left a comment.
* Header include order
* Moved is_ttbr1_addr() into headers for symmetry
* Rebased to rc3, removing v1's patch 1 that was taken as a fix
---

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/v2

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/[email protected]/

James Morse (4):
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   |  14 ++
 arch/arm64/include/asm/traps.h       |  10 -
 arch/arm64/kernel/Makefile           |   6 +-
 arch/arm64/kernel/entry-common.c     | 332 +++++++++++++++++++++++++++
 arch/arm64/kernel/entry.S            | 275 +---------------------
 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                |  62 ++---
 14 files changed, 417 insertions(+), 359 deletions(-)
 create mode 100644 arch/arm64/kernel/entry-common.c
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel