Skip to content

[WIP] [Deepin-Kernel-SIG] [linux 6.6-y] [Deepin] Loongarch: optimize syscall reg save #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: linux-6.6.y
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/loongarch/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ SYM_CODE_START(handle_syscall)
addi.d sp, sp, -PT_SIZE
cfi_st t2, PT_R3
cfi_rel_offset sp, PT_R3
st.d zero, sp, PT_R0
# Note it will be set in do_syscall regs->regs[0] = 0;
# st.d zero, sp, PT_R0
csrrd t2, LOONGARCH_CSR_PRMD
st.d t2, sp, PT_PRMD
csrrd t2, LOONGARCH_CSR_CRMD
Expand Down
2 changes: 2 additions & 0 deletions arch/loongarch/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ void noinstr do_syscall(struct pt_regs *regs)
sys_call_fn syscall_fn;

nr = regs->regs[11];
// Move from handle_syscall macro to save a memio
regs->regs[0] = 0;
/* Set for syscall restarting */
if (nr < NR_syscalls)
regs->regs[0] = nr + 1;
Expand Down
Loading