Skip to content

Commit 6cf61e0

Browse files
committed
Merge branch 'for-next/entry' into for-next/core
The never-ending entry.S refactoring continues, putting us in a much better place wrt compiler instrumentation whilst moving more of the code into C. * for-next/entry: arm64: idle: don't instrument idle code with KCOV arm64: entry: don't instrument entry code with KCOV arm64: entry: make NMI entry/exit functions static arm64: entry: split SDEI entry arm64: entry: split bad stack entry arm64: entry: fold el1_inv() into el1h_64_sync_handler() arm64: entry: handle all vectors with C arm64: entry: template the entry asm functions arm64: entry: improve bad_mode() arm64: entry: move bad_mode() to entry-common.c arm64: entry: consolidate EL1 exception returns arm64: entry: organise entry vectors consistently arm64: entry: organise entry handlers consistently arm64: entry: convert IRQ+FIQ handlers to C arm64: entry: add a call_on_irq_stack helper arm64: entry: move NMI preempt logic to C arm64: entry: move arm64_preempt_schedule_irq to entry-common.c arm64: entry: convert SError handlers to C arm64: entry: unmask IRQ+FIQ after EL0 handling arm64: remove redundant local_daif_mask() in bad_mode()
2 parents aeb3e82 + b5df5b8 commit 6cf61e0

11 files changed

Lines changed: 417 additions & 438 deletions

File tree

arch/arm64/include/asm/exception.h

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,35 @@ static inline u32 disr_to_esr(u64 disr)
3131
return esr;
3232
}
3333

34-
asmlinkage void el1_sync_handler(struct pt_regs *regs);
35-
asmlinkage void el0_sync_handler(struct pt_regs *regs);
36-
asmlinkage void el0_sync_compat_handler(struct pt_regs *regs);
34+
asmlinkage void handle_bad_stack(struct pt_regs *regs);
3735

38-
asmlinkage void noinstr enter_el1_irq_or_nmi(struct pt_regs *regs);
39-
asmlinkage void noinstr exit_el1_irq_or_nmi(struct pt_regs *regs);
36+
asmlinkage void el1t_64_sync_handler(struct pt_regs *regs);
37+
asmlinkage void el1t_64_irq_handler(struct pt_regs *regs);
38+
asmlinkage void el1t_64_fiq_handler(struct pt_regs *regs);
39+
asmlinkage void el1t_64_error_handler(struct pt_regs *regs);
40+
41+
asmlinkage void el1h_64_sync_handler(struct pt_regs *regs);
42+
asmlinkage void el1h_64_irq_handler(struct pt_regs *regs);
43+
asmlinkage void el1h_64_fiq_handler(struct pt_regs *regs);
44+
asmlinkage void el1h_64_error_handler(struct pt_regs *regs);
45+
46+
asmlinkage void el0t_64_sync_handler(struct pt_regs *regs);
47+
asmlinkage void el0t_64_irq_handler(struct pt_regs *regs);
48+
asmlinkage void el0t_64_fiq_handler(struct pt_regs *regs);
49+
asmlinkage void el0t_64_error_handler(struct pt_regs *regs);
50+
51+
asmlinkage void el0t_32_sync_handler(struct pt_regs *regs);
52+
asmlinkage void el0t_32_irq_handler(struct pt_regs *regs);
53+
asmlinkage void el0t_32_fiq_handler(struct pt_regs *regs);
54+
asmlinkage void el0t_32_error_handler(struct pt_regs *regs);
55+
56+
asmlinkage void call_on_irq_stack(struct pt_regs *regs,
57+
void (*func)(struct pt_regs *));
4058
asmlinkage void enter_from_user_mode(void);
4159
asmlinkage void exit_to_user_mode(void);
42-
void arm64_enter_nmi(struct pt_regs *regs);
43-
void arm64_exit_nmi(struct pt_regs *regs);
4460
void do_mem_abort(unsigned long far, unsigned int esr, struct pt_regs *regs);
4561
void do_undefinstr(struct pt_regs *regs);
4662
void do_bti(struct pt_regs *regs);
47-
asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr);
4863
void do_debug_exception(unsigned long addr_if_watchpoint, unsigned int esr,
4964
struct pt_regs *regs);
5065
void do_fpsimd_acc(unsigned int esr, struct pt_regs *regs);
@@ -57,4 +72,7 @@ void do_cp15instr(unsigned int esr, struct pt_regs *regs);
5772
void do_el0_svc(struct pt_regs *regs);
5873
void do_el0_svc_compat(struct pt_regs *regs);
5974
void do_ptrauth_fault(struct pt_regs *regs, unsigned int esr);
75+
void do_serror(struct pt_regs *regs, unsigned int esr);
76+
77+
void panic_bad_stack(struct pt_regs *regs, unsigned int esr, unsigned long far);
6078
#endif /* __ASM_EXCEPTION_H */

arch/arm64/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ void set_task_sctlr_el1(u64 sctlr);
257257
extern struct task_struct *cpu_switch_to(struct task_struct *prev,
258258
struct task_struct *next);
259259

260-
asmlinkage void arm64_preempt_schedule_irq(void);
261-
262260
#define task_pt_regs(p) \
263261
((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
264262

arch/arm64/include/asm/sdei.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ struct sdei_registered_event;
3737
asmlinkage unsigned long __sdei_handler(struct pt_regs *regs,
3838
struct sdei_registered_event *arg);
3939

40+
unsigned long do_sdei_event(struct pt_regs *regs,
41+
struct sdei_registered_event *arg);
42+
4043
unsigned long sdei_arch_get_entry_point(int conduit);
4144
#define sdei_arch_get_entry_point(x) sdei_arch_get_entry_point(x)
4245

arch/arm64/kernel/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE)
1414
CFLAGS_REMOVE_syscall.o = -fstack-protector -fstack-protector-strong
1515
CFLAGS_syscall.o += -fno-stack-protector
1616

17+
# It's not safe to invoke KCOV when portions of the kernel environment aren't
18+
# available or are out-of-sync with HW state. Since `noinstr` doesn't always
19+
# inhibit KCOV instrumentation, disable it for the entire compilation unit.
20+
KCOV_INSTRUMENT_entry.o := n
21+
KCOV_INSTRUMENT_idle.o := n
22+
1723
# Object file lists.
1824
obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
1925
entry-common.o entry-fpsimd.o process.o ptrace.o \
@@ -22,7 +28,7 @@ obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
2228
return_address.o cpuinfo.o cpu_errata.o \
2329
cpufeature.o alternative.o cacheinfo.o \
2430
smp.o smp_spin_table.o topology.o smccc-call.o \
25-
syscall.o proton-pack.o idreg-override.o
31+
syscall.o proton-pack.o idreg-override.o idle.o
2632

2733
targets += efi-entry.o
2834

0 commit comments

Comments
 (0)