Thread (15 messages) 15 messages, 8 authors, 2021-09-14

Re: [PATCH 1/2] mips: convert syscall to generic entry

From: Feiyang Chen <hidden>
Date: 2021-09-14 01:30:49
Also in: linux-arch

On Wed, 8 Sept 2021 at 17:28, Thomas Bogendoerfer
[off-list ref] wrote:
On Wed, Sep 08, 2021 at 10:08:47AM +0800, 陈飞扬 wrote:
quoted
On Tue, 7 Sept 2021 at 21:49, Jiaxun Yang [off-list ref] wrote:
quoted

在 2021/9/7 14:16, FreeFlyingSheep 写道:
quoted
From: Feiyang Chen <redacted>

Convert mips syscall to use the generic entry infrastructure from
kernel/entry/*.

There are a few special things on mips:

- There is one type of syscall on mips32 (scall32-o32) and three types
of syscalls on mips64 (scall64-o32, scall64-n32 and scall64-n64). Now
convert to C code to handle different types of syscalls.

- For some special syscalls (e.g. fork, clone, clone3 and sysmips),
save_static_function() wrapper is used to save static registers. Now
SAVE_STATIC is used in handle_sys before calling do_syscall(), so the
save_static_function() wrapper can be removed.

- For sigreturn/rt_sigreturn and sysmips, inline assembly is used to
jump to syscall_exit directly for skipping setting the error flag and
restoring all registers. Now use regs->regs[27] to mark whether to
handle the error flag and always restore all registers in handle_sys,
so these functions can return normally as other architecture.
Hmm, that would give us overhead of register context on these syscalls.

I guess it's worthy?
Hi, Jiaxun,

Saving and restoring registers against different system calls can be
difficult due to the use of generic entry.
To avoid a lot of duplicate code, I think the overhead is worth it.
could you please provide numbers for that ? This code still runs
on low end MIPS CPUs for which overhead might mean a different
ballpark than some highend Loongson CPUs.
Hi, Thomas, Jiaxun, Yanjie, Nikolaus,

Thank you for your help. The impact on performance seems somewhat
significant, I will make improvements in the v2 of the patchset.

Thanks,
Feiyang
Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help