csky updates for 5.7-rc8
Another 4 fixups for csky: - fixup req_syscall debug - fixup abiv2 syscall_trace - fixup preempt enable - Cleanup regs usage in entry.S -----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEE2KAv+isbWR/viAKHAXH1GYaIxXsFAl7PCfgSHHJlbl9ndW9A Yy1za3kuY29tAAoJEAFx9RmGiMV7O5EP/iEpB1KVPXuDIMlSd4WxlmomGbVN9oqp 3sdTk/ICq8zHe1nTgch+fxWKrcrC1x1cvt8L71DbvvzwKK93xqfuqNooMIlSNtfY eAxHNoHqc3Sq/tDL4/+c3QnO6Jk0doWbgRLznmkdqTZovQcLh+OKzOlaA8hcDVXW lOoveNRX339VBG8bhWr1ZH0P+ZscGNdoAE6gXUPcZpY0ryLQYFzvykXqne1QvSa3 OzNaW+RQdfFUBIrIZqmmjxpsXzxaxyDFH6vTOMUEOg37RtbgQCNr+G74reNK2jW3 W3vvktXWSSgQ+31pciJ1skAIoYaeGsQu4Gd4EZygu4Jyo6DaSsdXuOhGtoWnY/VF Iro96sK7pj4VQcJLryCmSWOcccoCDm3QXT0umYQ/rAM3JPXyddr65v4HegFC+UFV ZuwCcGu8o9V5foP66kogpYde9YJquo+MVI+JdGV9GFaG+6XwkPS6qZQd3dwxoVsR IHiXVISbb4IOh/hvymU4zyZUafraSmChnRuf4e5qZ/mZZrBxWOt0HLEQOPy20Rhx /IMLL/2adfxtaodQv6tFSusp/3iZkiIL7SkPsEKNOeP8uKPxfH61xdd/BDw+nnZV 8aHUFS4poNwZuMCIc2sOSGwXw2bAOZcFAwUg0RC8lBaAE92NGB5C/mOk+hQsbrnr ZLOTO38175TF =UjPD -----END PGP SIGNATURE----- Merge tag 'csky-for-linus-5.7-rc8' of git://github.com/c-sky/csky-linux Pull csky fixes from Guo Ren: "Another four fixes for csky: - fix req_syscall debug - fix abiv2 syscall_trace - fix preempt enable - clean up regs usage in entry.S" * tag 'csky-for-linus-5.7-rc8' of git://github.com/c-sky/csky-linux: csky: Fixup CONFIG_DEBUG_RSEQ csky: Coding convention in entry.S csky: Fixup abiv2 syscall_trace break a4 & a5 csky: Fixup CONFIG_PREEMPT panic
This commit is contained in:
commit
6b5f25909b
@ -80,7 +80,6 @@
|
||||
.endm
|
||||
|
||||
.macro RESTORE_ALL
|
||||
psrclr ie
|
||||
ldw lr, (sp, 4)
|
||||
ldw a0, (sp, 8)
|
||||
mtcr a0, epc
|
||||
@ -175,9 +174,4 @@
|
||||
movi r6, 0
|
||||
cpwcr r6, cpcr31
|
||||
.endm
|
||||
|
||||
.macro ANDI_R3 rx, imm
|
||||
lsri \rx, 3
|
||||
andi \rx, (\imm >> 3)
|
||||
.endm
|
||||
#endif /* __ASM_CSKY_ENTRY_H */
|
||||
|
@ -13,6 +13,8 @@
|
||||
#define LSAVE_A1 28
|
||||
#define LSAVE_A2 32
|
||||
#define LSAVE_A3 36
|
||||
#define LSAVE_A4 40
|
||||
#define LSAVE_A5 44
|
||||
|
||||
#define KSPTOUSP
|
||||
#define USPTOKSP
|
||||
@ -63,7 +65,6 @@
|
||||
.endm
|
||||
|
||||
.macro RESTORE_ALL
|
||||
psrclr ie
|
||||
ldw tls, (sp, 0)
|
||||
ldw lr, (sp, 4)
|
||||
ldw a0, (sp, 8)
|
||||
@ -301,9 +302,4 @@
|
||||
jmpi 3f /* jump to va */
|
||||
3:
|
||||
.endm
|
||||
|
||||
.macro ANDI_R3 rx, imm
|
||||
lsri \rx, 3
|
||||
andi \rx, (\imm >> 3)
|
||||
.endm
|
||||
#endif /* __ASM_CSKY_ENTRY_H */
|
||||
|
@ -81,4 +81,10 @@ static inline struct thread_info *current_thread_info(void)
|
||||
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
|
||||
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
|
||||
|
||||
#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
|
||||
_TIF_NOTIFY_RESUME | _TIF_UPROBE)
|
||||
|
||||
#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
|
||||
_TIF_SYSCALL_TRACEPOINT)
|
||||
|
||||
#endif /* _ASM_CSKY_THREAD_INFO_H */
|
||||
|
@ -128,39 +128,41 @@ tlbop_end 1
|
||||
ENTRY(csky_systemcall)
|
||||
SAVE_ALL TRAP0_SIZE
|
||||
zero_fp
|
||||
#ifdef CONFIG_RSEQ_DEBUG
|
||||
mov a0, sp
|
||||
jbsr rseq_syscall
|
||||
#endif
|
||||
psrset ee, ie
|
||||
|
||||
lrw r11, __NR_syscalls
|
||||
cmphs syscallid, r11 /* Check nr of syscall */
|
||||
bt ret_from_exception
|
||||
lrw r9, __NR_syscalls
|
||||
cmphs syscallid, r9 /* Check nr of syscall */
|
||||
bt 1f
|
||||
|
||||
lrw r13, sys_call_table
|
||||
ixw r13, syscallid
|
||||
ldw r11, (r13)
|
||||
cmpnei r11, 0
|
||||
lrw r9, sys_call_table
|
||||
ixw r9, syscallid
|
||||
ldw syscallid, (r9)
|
||||
cmpnei syscallid, 0
|
||||
bf ret_from_exception
|
||||
|
||||
mov r9, sp
|
||||
bmaski r10, THREAD_SHIFT
|
||||
andn r9, r10
|
||||
ldw r12, (r9, TINFO_FLAGS)
|
||||
ANDI_R3 r12, (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
|
||||
cmpnei r12, 0
|
||||
ldw r10, (r9, TINFO_FLAGS)
|
||||
lrw r9, _TIF_SYSCALL_WORK
|
||||
and r10, r9
|
||||
cmpnei r10, 0
|
||||
bt csky_syscall_trace
|
||||
#if defined(__CSKYABIV2__)
|
||||
subi sp, 8
|
||||
stw r5, (sp, 0x4)
|
||||
stw r4, (sp, 0x0)
|
||||
jsr r11 /* Do system call */
|
||||
jsr syscallid /* Do system call */
|
||||
addi sp, 8
|
||||
#else
|
||||
jsr r11
|
||||
jsr syscallid
|
||||
#endif
|
||||
stw a0, (sp, LSAVE_A0) /* Save return value */
|
||||
1:
|
||||
#ifdef CONFIG_DEBUG_RSEQ
|
||||
mov a0, sp
|
||||
jbsr rseq_syscall
|
||||
#endif
|
||||
jmpi ret_from_exception
|
||||
|
||||
csky_syscall_trace:
|
||||
@ -173,18 +175,23 @@ csky_syscall_trace:
|
||||
ldw a3, (sp, LSAVE_A3)
|
||||
#if defined(__CSKYABIV2__)
|
||||
subi sp, 8
|
||||
stw r5, (sp, 0x4)
|
||||
stw r4, (sp, 0x0)
|
||||
ldw r9, (sp, LSAVE_A4)
|
||||
stw r9, (sp, 0x0)
|
||||
ldw r9, (sp, LSAVE_A5)
|
||||
stw r9, (sp, 0x4)
|
||||
jsr syscallid /* Do system call */
|
||||
addi sp, 8
|
||||
#else
|
||||
ldw r6, (sp, LSAVE_A4)
|
||||
ldw r7, (sp, LSAVE_A5)
|
||||
#endif
|
||||
jsr r11 /* Do system call */
|
||||
#if defined(__CSKYABIV2__)
|
||||
addi sp, 8
|
||||
jsr syscallid /* Do system call */
|
||||
#endif
|
||||
stw a0, (sp, LSAVE_A0) /* Save return value */
|
||||
|
||||
#ifdef CONFIG_DEBUG_RSEQ
|
||||
mov a0, sp
|
||||
jbsr rseq_syscall
|
||||
#endif
|
||||
mov a0, sp /* right now, sp --> pt_regs */
|
||||
jbsr syscall_trace_exit
|
||||
br ret_from_exception
|
||||
@ -200,18 +207,20 @@ ENTRY(ret_from_fork)
|
||||
mov r9, sp
|
||||
bmaski r10, THREAD_SHIFT
|
||||
andn r9, r10
|
||||
ldw r12, (r9, TINFO_FLAGS)
|
||||
ANDI_R3 r12, (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT)
|
||||
cmpnei r12, 0
|
||||
ldw r10, (r9, TINFO_FLAGS)
|
||||
lrw r9, _TIF_SYSCALL_WORK
|
||||
and r10, r9
|
||||
cmpnei r10, 0
|
||||
bf ret_from_exception
|
||||
mov a0, sp /* sp = pt_regs pointer */
|
||||
jbsr syscall_trace_exit
|
||||
|
||||
ret_from_exception:
|
||||
ld syscallid, (sp, LSAVE_PSR)
|
||||
btsti syscallid, 31
|
||||
bt 1f
|
||||
psrclr ie
|
||||
ld r9, (sp, LSAVE_PSR)
|
||||
btsti r9, 31
|
||||
|
||||
bt 1f
|
||||
/*
|
||||
* Load address of current->thread_info, Then get address of task_struct
|
||||
* Get task_needreshed in task_struct
|
||||
@ -220,11 +229,24 @@ ret_from_exception:
|
||||
bmaski r10, THREAD_SHIFT
|
||||
andn r9, r10
|
||||
|
||||
ldw r12, (r9, TINFO_FLAGS)
|
||||
andi r12, (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | _TIF_UPROBE)
|
||||
cmpnei r12, 0
|
||||
ldw r10, (r9, TINFO_FLAGS)
|
||||
lrw r9, _TIF_WORK_MASK
|
||||
and r10, r9
|
||||
cmpnei r10, 0
|
||||
bt exit_work
|
||||
1:
|
||||
#ifdef CONFIG_PREEMPTION
|
||||
mov r9, sp
|
||||
bmaski r10, THREAD_SHIFT
|
||||
andn r9, r10
|
||||
|
||||
ldw r10, (r9, TINFO_PREEMPT)
|
||||
cmpnei r10, 0
|
||||
bt 2f
|
||||
jbsr preempt_schedule_irq /* irq en/disable is done inside */
|
||||
2:
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TRACE_IRQFLAGS
|
||||
ld r10, (sp, LSAVE_PSR)
|
||||
btsti r10, 6
|
||||
@ -235,14 +257,15 @@ ret_from_exception:
|
||||
RESTORE_ALL
|
||||
|
||||
exit_work:
|
||||
lrw syscallid, ret_from_exception
|
||||
mov lr, syscallid
|
||||
lrw r9, ret_from_exception
|
||||
mov lr, r9
|
||||
|
||||
btsti r12, TIF_NEED_RESCHED
|
||||
btsti r10, TIF_NEED_RESCHED
|
||||
bt work_resched
|
||||
|
||||
psrset ie
|
||||
mov a0, sp
|
||||
mov a1, r12
|
||||
mov a1, r10
|
||||
jmpi do_notify_resume
|
||||
|
||||
work_resched:
|
||||
@ -291,34 +314,10 @@ ENTRY(csky_irq)
|
||||
jbsr trace_hardirqs_off
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PREEMPTION
|
||||
mov r9, sp /* Get current stack pointer */
|
||||
bmaski r10, THREAD_SHIFT
|
||||
andn r9, r10 /* Get thread_info */
|
||||
|
||||
/*
|
||||
* Get task_struct->stack.preempt_count for current,
|
||||
* and increase 1.
|
||||
*/
|
||||
ldw r12, (r9, TINFO_PREEMPT)
|
||||
addi r12, 1
|
||||
stw r12, (r9, TINFO_PREEMPT)
|
||||
#endif
|
||||
|
||||
mov a0, sp
|
||||
jbsr csky_do_IRQ
|
||||
|
||||
#ifdef CONFIG_PREEMPTION
|
||||
subi r12, 1
|
||||
stw r12, (r9, TINFO_PREEMPT)
|
||||
cmpnei r12, 0
|
||||
bt 2f
|
||||
ldw r12, (r9, TINFO_FLAGS)
|
||||
btsti r12, TIF_NEED_RESCHED
|
||||
bf 2f
|
||||
jbsr preempt_schedule_irq /* irq en/disable is done inside */
|
||||
#endif
|
||||
2:
|
||||
jmpi ret_from_exception
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user