[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 28/31] common-user: Add safe syscall handling for loongarc
From: |
Peter Maydell |
Subject: |
Re: [PATCH v9 28/31] common-user: Add safe syscall handling for loongarch64 hosts |
Date: |
Tue, 14 Dec 2021 20:49:33 +0000 |
On Tue, 14 Dec 2021 at 19:29, Richard Henderson
<richard.henderson@linaro.org> wrote:
> For loongarch64, according to glibc,
>
> #define __SYSCALL_CLOBBERS \
> "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8", "memory"
>
> which does suggest that a6 is unused, saved across the syscall, and also
> call-clobbered
> (so we don't have to allocate a stack frame).
>
> I've had a browse through the loongarch kernel code and that seems to be all
> true.
> (Curiously, loongarch restores more registers than it saves on the way out of
> handle_syscall. There may be a subtle reason for that, or room for
> improvement.)
Sadly most of the kernel architectures don't document the "which registers
are clobbered" part of their ABI. It would be helpful if they did. (I did
nudge a local arm kernel dev to have a look at doing that for arm...)
-- PMM
- [PATCH v9 26/31] tcg/loongarch64: Implement tcg_target_init, (continued)
- [PATCH v9 26/31] tcg/loongarch64: Implement tcg_target_init, WANG Xuerui, 2021/12/14
- [PATCH v9 27/31] tcg/loongarch64: Register the JIT, WANG Xuerui, 2021/12/14
- [PATCH v9 23/31] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops, WANG Xuerui, 2021/12/14
- [PATCH v9 30/31] configure, meson.build: Mark support for loongarch64 hosts, WANG Xuerui, 2021/12/14
- [PATCH v9 29/31] linux-user: Implement CPU-specific signal handler for loongarch64 hosts, WANG Xuerui, 2021/12/14
- [PATCH v9 28/31] common-user: Add safe syscall handling for loongarch64 hosts, WANG Xuerui, 2021/12/14
- Re: [PATCH v9 28/31] common-user: Add safe syscall handling for loongarch64 hosts, Richard Henderson, 2021/12/14