Commit 1a7f67e6 authored by Catalin Marinas's avatar Catalin Marinas

Merge branch 'for-next/entry' into for-next/core

* for-next/entry:
  : More entry.S clean-ups and conversion to C.
  arm64: entry: call exit_to_user_mode() from C
  arm64: entry: move bulk of ret_to_user to C
  arm64: entry: clarify entry/exit helpers
  arm64: entry: consolidate entry/exit helpers
parents 622909e5 e130338e
...@@ -55,8 +55,8 @@ asmlinkage void el0t_32_error_handler(struct pt_regs *regs); ...@@ -55,8 +55,8 @@ asmlinkage void el0t_32_error_handler(struct pt_regs *regs);
asmlinkage void call_on_irq_stack(struct pt_regs *regs, asmlinkage void call_on_irq_stack(struct pt_regs *regs,
void (*func)(struct pt_regs *)); void (*func)(struct pt_regs *));
asmlinkage void enter_from_user_mode(void); asmlinkage void asm_exit_to_user_mode(struct pt_regs *regs);
asmlinkage void exit_to_user_mode(void);
void do_mem_abort(unsigned long far, unsigned int esr, struct pt_regs *regs); void do_mem_abort(unsigned long far, unsigned int esr, struct pt_regs *regs);
void do_undefinstr(struct pt_regs *regs); void do_undefinstr(struct pt_regs *regs);
void do_bti(struct pt_regs *regs); void do_bti(struct pt_regs *regs);
...@@ -73,6 +73,7 @@ void do_el0_svc(struct pt_regs *regs); ...@@ -73,6 +73,7 @@ void do_el0_svc(struct pt_regs *regs);
void do_el0_svc_compat(struct pt_regs *regs); void do_el0_svc_compat(struct pt_regs *regs);
void do_ptrauth_fault(struct pt_regs *regs, unsigned int esr); void do_ptrauth_fault(struct pt_regs *regs, unsigned int esr);
void do_serror(struct pt_regs *regs, unsigned int esr); void do_serror(struct pt_regs *regs, unsigned int esr);
void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags);
void panic_bad_stack(struct pt_regs *regs, unsigned int esr, unsigned long far); void panic_bad_stack(struct pt_regs *regs, unsigned int esr, unsigned long far);
#endif /* __ASM_EXCEPTION_H */ #endif /* __ASM_EXCEPTION_H */
This diff is collapsed.
...@@ -29,16 +29,6 @@ ...@@ -29,16 +29,6 @@
#include <asm/asm-uaccess.h> #include <asm/asm-uaccess.h>
#include <asm/unistd.h> #include <asm/unistd.h>
/*
* Context tracking and irqflag tracing need to instrument transitions between
* user and kernel mode.
*/
.macro user_enter_irqoff
#if defined(CONFIG_CONTEXT_TRACKING) || defined(CONFIG_TRACE_IRQFLAGS)
bl exit_to_user_mode
#endif
.endm
.macro clear_gp_regs .macro clear_gp_regs
.irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 .irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
mov x\n, xzr mov x\n, xzr
...@@ -492,18 +482,6 @@ SYM_CODE_END(__swpan_exit_el0) ...@@ -492,18 +482,6 @@ SYM_CODE_END(__swpan_exit_el0)
/* GPRs used by entry code */ /* GPRs used by entry code */
tsk .req x28 // current thread_info tsk .req x28 // current thread_info
/*
* Interrupt handling.
*/
.macro gic_prio_kentry_setup, tmp:req
#ifdef CONFIG_ARM64_PSEUDO_NMI
alternative_if ARM64_HAS_IRQ_PRIO_MASKING
mov \tmp, #(GIC_PRIO_PSR_I_SET | GIC_PRIO_IRQON)
msr_s SYS_ICC_PMR_EL1, \tmp
alternative_else_nop_endif
#endif
.endm
.text .text
/* /*
...@@ -605,35 +583,13 @@ SYM_CODE_START_LOCAL(ret_to_kernel) ...@@ -605,35 +583,13 @@ SYM_CODE_START_LOCAL(ret_to_kernel)
kernel_exit 1 kernel_exit 1
SYM_CODE_END(ret_to_kernel) SYM_CODE_END(ret_to_kernel)
/*
* "slow" syscall return path.
*/
SYM_CODE_START_LOCAL(ret_to_user) SYM_CODE_START_LOCAL(ret_to_user)
disable_daif ldr x19, [tsk, #TSK_TI_FLAGS] // re-check for single-step
gic_prio_kentry_setup tmp=x3
#ifdef CONFIG_TRACE_IRQFLAGS
bl trace_hardirqs_off
#endif
ldr x19, [tsk, #TSK_TI_FLAGS]
and x2, x19, #_TIF_WORK_MASK
cbnz x2, work_pending
finish_ret_to_user:
user_enter_irqoff
enable_step_tsk x19, x2 enable_step_tsk x19, x2
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK #ifdef CONFIG_GCC_PLUGIN_STACKLEAK
bl stackleak_erase bl stackleak_erase
#endif #endif
kernel_exit 0 kernel_exit 0
/*
* Ok, we need to do extra processing, enter the slow path.
*/
work_pending:
mov x0, sp // 'regs'
mov x1, x19
bl do_notify_resume
ldr x19, [tsk, #TSK_TI_FLAGS] // re-check for single-step
b finish_ret_to_user
SYM_CODE_END(ret_to_user) SYM_CODE_END(ret_to_user)
.popsection // .entry.text .popsection // .entry.text
...@@ -799,6 +755,8 @@ SYM_CODE_START(ret_from_fork) ...@@ -799,6 +755,8 @@ SYM_CODE_START(ret_from_fork)
mov x0, x20 mov x0, x20
blr x19 blr x19
1: get_current_task tsk 1: get_current_task tsk
mov x0, sp
bl asm_exit_to_user_mode
b ret_to_user b ret_to_user
SYM_CODE_END(ret_from_fork) SYM_CODE_END(ret_from_fork)
NOKPROBE(ret_from_fork) NOKPROBE(ret_from_fork)
......
...@@ -929,8 +929,7 @@ static bool cpu_affinity_invalid(struct pt_regs *regs) ...@@ -929,8 +929,7 @@ static bool cpu_affinity_invalid(struct pt_regs *regs)
system_32bit_el0_cpumask()); system_32bit_el0_cpumask());
} }
asmlinkage void do_notify_resume(struct pt_regs *regs, void do_notify_resume(struct pt_regs *regs, unsigned long thread_flags)
unsigned long thread_flags)
{ {
do { do {
if (thread_flags & _TIF_NEED_RESCHED) { if (thread_flags & _TIF_NEED_RESCHED) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment