All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next v5 00/22] arm64: entry: Convert to generic entry
@ 2024-12-06 10:17 Jinjie Ruan
  2024-12-06 10:17 ` [PATCH -next v5 01/22] arm64: ptrace: Replace interrupts_enabled() with regs_irqs_disabled() Jinjie Ruan
                   ` (22 more replies)
  0 siblings, 23 replies; 39+ messages in thread
From: Jinjie Ruan @ 2024-12-06 10:17 UTC (permalink / raw)
  To: catalin.marinas, will, oleg, sstabellini, tglx, peterz, luto,
	mingo, juri.lelli, vincent.guittot, dietmar.eggemann, rostedt,
	bsegall, mgorman, vschneid, kees, wad, akpm, samitolvanen,
	masahiroy, hca, aliceryhl, rppt, xur, paulmck, arnd, mbenes,
	puranjay, mark.rutland, ruanjinjie, pcc, ardb, sudeep.holla,
	guohanjun, rafael, liuwei09, dwmw, Jonathan.Cameron, liaochang1,
	kristina.martsenko, ptosi, broonie, thiago.bauermann,
	kevin.brodsky, joey.gouly, liuyuntao12, leobras, linux-kernel,
	linux-arm-kernel, xen-devel

Currently, x86, Riscv, Loongarch use the generic entry. Convert arm64
to use the generic entry infrastructure from kernel/entry/*. The generic
entry makes maintainers' work easier and codes more elegant, which aslo
removed a lot of duplicate code.

The main steps are as follows:
- Make arm64 easier to use irqentry_enter/exit().
- Make arm64 closer to the PREEMPT_DYNAMIC code of generic entry.
- Split generic entry into generic irq entry and generic syscall to
  make the single patch more concentrated in switching to one thing.
- Switch to generic irq entry.
- Make arm64 closer to the generic syscall code.
- Switch to generic entry completely.

Changes in v5:
- Not change arm32 and keep inerrupts_enabled() macro for gicv3 driver.
- Move irqentry_state definition into arch/arm64/kernel/entry-common.c.
- Avoid removing the __enter_from_*() and __exit_to_*() wrappers.
- Update "irqentry_state_t ret/irq_state" to "state"
  to keep it consistently.
- Use generic irq entry header for PREEMPT_DYNAMIC after split
  the generic entry.
- Also refactor the ARM64 syscall code.
- Introduce arch_ptrace_report_syscall_entry/exit(), instead of
  arch_pre/post_report_syscall_entry/exit() to simplify code.
- Make the syscall patches clear separation.
- Update the commit message.

Changes in v4:
- Rework/cleanup split into a few patches as Mark suggested.
- Replace interrupts_enabled() macro with regs_irqs_disabled(), instead
  of left it here.
- Remove rcu and lockdep state in pt_regs by using temporary
  irqentry_state_t as Mark suggested.
- Remove some unnecessary intermediate functions to make it clear.
- Rework preempt irq and PREEMPT_DYNAMIC code
  to make the switch more clear.
- arch_prepare_*_entry/exit() -> arch_pre_*_entry/exit().
- Expand the arch functions comment.
- Make arch functions closer to its caller.
- Declare saved_reg in for block.
- Remove arch_exit_to_kernel_mode_prepare(), arch_enter_from_kernel_mode().
- Adjust "Add few arch functions to use generic entry" patch to be
  the penultimate.
- Update the commit message.
- Add suggested-by.

Changes in v3:
- Test the MTE test cases.
- Handle forget_syscall() in arch_post_report_syscall_entry()
- Make the arch funcs not use __weak as Thomas suggested, so move
  the arch funcs to entry-common.h, and make arch_forget_syscall() folded
  in arch_post_report_syscall_entry() as suggested.
- Move report_single_step() to thread_info.h for arm64
- Change __always_inline() to inline, add inline for the other arch funcs.
- Remove unused signal.h for entry-common.h.
- Add Suggested-by.
- Update the commit message.

Changes in v2:
- Add tested-by.
- Fix a bug that not call arch_post_report_syscall_entry() in
  syscall_trace_enter() if ptrace_report_syscall_entry() return not zero.
- Refactor report_syscall().
- Add comment for arch_prepare_report_syscall_exit().
- Adjust entry-common.h header file inclusion to alphabetical order.
- Update the commit message.

Jinjie Ruan (22):
  arm64: ptrace: Replace interrupts_enabled() with regs_irqs_disabled()
  arm64: entry: Refactor the entry and exit for exceptions from EL1
  arm64: entry: Move arm64_preempt_schedule_irq() into
    __exit_to_kernel_mode()
  arm64: entry: Rework arm64_preempt_schedule_irq()
  arm64: entry: Use preempt_count() and need_resched() helper
  arm64: entry: Expand the need_irq_preemption() macro ahead
  arm64: entry: preempt_schedule_irq() only if PREEMPTION enabled
  arm64: entry: Use different helpers to check resched for
    PREEMPT_DYNAMIC
  entry: Split generic entry into irq and syscall
  entry: Add arch_irqentry_exit_need_resched() for arm64
  arm64: entry: Switch to generic IRQ entry
  arm64/ptrace: Split report_syscall() function
  arm64/ptrace: Refactor syscall_trace_enter()
  arm64/ptrace: Refactor syscall_trace_exit()
  arm64/ptrace: Refator el0_svc_common()
  entry: Make syscall_exit_to_user_mode_prepare() not static
  arm64/ptrace: Return early for ptrace_report_syscall_entry() error
  arm64/ptrace: Expand secure_computing() in place
  arm64/ptrace: Use syscall_get_arguments() heleper
  entry: Add arch_ptrace_report_syscall_entry/exit()
  entry: Add has_syscall_work() helepr
  arm64: entry: Convert to generic entry

 MAINTAINERS                           |   1 +
 arch/Kconfig                          |   8 +
 arch/arm64/Kconfig                    |   1 +
 arch/arm64/include/asm/daifflags.h    |   2 +-
 arch/arm64/include/asm/entry-common.h | 134 +++++++++
 arch/arm64/include/asm/preempt.h      |   2 -
 arch/arm64/include/asm/ptrace.h       |  11 +-
 arch/arm64/include/asm/syscall.h      |   6 +-
 arch/arm64/include/asm/thread_info.h  |  23 +-
 arch/arm64/include/asm/xen/events.h   |   2 +-
 arch/arm64/kernel/acpi.c              |   2 +-
 arch/arm64/kernel/debug-monitors.c    |   9 +-
 arch/arm64/kernel/entry-common.c      | 377 ++++++++-----------------
 arch/arm64/kernel/ptrace.c            |  90 ------
 arch/arm64/kernel/sdei.c              |   2 +-
 arch/arm64/kernel/signal.c            |   3 +-
 arch/arm64/kernel/syscall.c           |  31 +-
 include/linux/entry-common.h          | 384 +------------------------
 include/linux/irq-entry-common.h      | 389 ++++++++++++++++++++++++++
 kernel/entry/Makefile                 |   3 +-
 kernel/entry/common.c                 | 176 ++----------
 kernel/entry/syscall-common.c         | 198 +++++++++++++
 kernel/sched/core.c                   |   8 +-
 23 files changed, 909 insertions(+), 953 deletions(-)
 create mode 100644 arch/arm64/include/asm/entry-common.h
 create mode 100644 include/linux/irq-entry-common.h
 create mode 100644 kernel/entry/syscall-common.c

-- 
2.34.1



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-02-11 12:42 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06 10:17 [PATCH -next v5 00/22] arm64: entry: Convert to generic entry Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 01/22] arm64: ptrace: Replace interrupts_enabled() with regs_irqs_disabled() Jinjie Ruan
2025-02-10 11:04   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 02/22] arm64: entry: Refactor the entry and exit for exceptions from EL1 Jinjie Ruan
2025-02-10 11:08   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 03/22] arm64: entry: Move arm64_preempt_schedule_irq() into __exit_to_kernel_mode() Jinjie Ruan
2025-02-10 11:26   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 04/22] arm64: entry: Rework arm64_preempt_schedule_irq() Jinjie Ruan
2025-02-10 11:33   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 05/22] arm64: entry: Use preempt_count() and need_resched() helper Jinjie Ruan
2025-02-10 11:40   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 06/22] arm64: entry: Expand the need_irq_preemption() macro ahead Jinjie Ruan
2025-02-10 11:48   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 07/22] arm64: entry: preempt_schedule_irq() only if PREEMPTION enabled Jinjie Ruan
2025-02-10 11:52   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 08/22] arm64: entry: Use different helpers to check resched for PREEMPT_DYNAMIC Jinjie Ruan
2025-02-10 11:54   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 09/22] entry: Split generic entry into irq and syscall Jinjie Ruan
2025-02-10 12:04   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 10/22] entry: Add arch_irqentry_exit_need_resched() for arm64 Jinjie Ruan
2025-02-10 12:05   ` Mark Rutland
2024-12-06 10:17 ` [PATCH -next v5 11/22] arm64: entry: Switch to generic IRQ entry Jinjie Ruan
2025-02-10 12:24   ` Mark Rutland
2025-02-11 11:32     ` Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 12/22] arm64/ptrace: Split report_syscall() function Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 13/22] arm64/ptrace: Refactor syscall_trace_enter() Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 14/22] arm64/ptrace: Refactor syscall_trace_exit() Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 15/22] arm64/ptrace: Refator el0_svc_common() Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 16/22] entry: Make syscall_exit_to_user_mode_prepare() not static Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 17/22] arm64/ptrace: Return early for ptrace_report_syscall_entry() error Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 18/22] arm64/ptrace: Expand secure_computing() in place Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 19/22] arm64/ptrace: Use syscall_get_arguments() heleper Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 20/22] entry: Add arch_ptrace_report_syscall_entry/exit() Jinjie Ruan
2024-12-06 14:33   ` kernel test robot
2024-12-06 10:17 ` [PATCH -next v5 21/22] entry: Add has_syscall_work() helepr Jinjie Ruan
2024-12-06 10:17 ` [PATCH -next v5 22/22] arm64: entry: Convert to generic entry Jinjie Ruan
2025-02-08  1:15 ` [PATCH -next v5 00/22] " Jinjie Ruan
2025-02-10 12:30   ` Mark Rutland
2025-02-11 11:43     ` Jinjie Ruan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.