qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/33] linux-user/nios2: Trim target_pc_regs to sp and pc


From: Richard Henderson
Subject: Re: [PATCH v4 07/33] linux-user/nios2: Trim target_pc_regs to sp and pc
Date: Tue, 8 Mar 2022 09:34:24 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/8/22 00:00, Peter Maydell wrote:
On Tue, 8 Mar 2022 at 07:20, Richard Henderson
<richard.henderson@linaro.org> wrote:

The only thing this struct is used for is passing startup values
from elfload.c to the cpu.  We do not need all registers to be
represented, we do not need the kernel internal stack slots.

The userland argc, argv, and envp values are passed on
the stack, so only SP and PC need updating.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
  linux-user/nios2/target_syscall.h | 25 ++-----------------------
  linux-user/elfload.c              |  3 +--
  linux-user/nios2/cpu_loop.c       | 24 +-----------------------
  3 files changed, 4 insertions(+), 48 deletions(-)

Well, I guess we're not using it for anything else currently,
but if you do this then it's not the target arch's pt_regs
struct any more. And all our other target archs seem to define
the struct to follow the kernel definition even if we don't
happen to use it all.

Yes, something I've meant to clean up for ages.

My real goal here was removing the reference to estatus, which then does not need to be converted to a different form in the coming patches.

(Assigning to estatus is unusable in user-mode, because rdctl and eret are supervisor insns. This code appears to be mirroring the kernel code in which it is trying to get the right bits ready for the context switch to user-mode. For qemu, we've done that for user-only during reset, and with proper symbolic constants, so no need to do it again here.)

I could just remove the two mentions of estatus in init_thread and copy_regs, if that seems better. Leave the target_pt_regs cleanup to a larger patch set touching them all.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]