qemu-patch-raspberry4/linux-user/sparc
Peter Maydell 266b41582e linux-user/sparc: Correct set/get_context handling of fp and i7
Because QEMU's user-mode emulation just directly accesses guest CPU
state, for SPARC the guest register window state is not the same in
the sparc64_get_context() and sparc64_set_context() functions as it
is for the real kernel's versions of those functions.  Specifically,
for the kernel it has saved the user space state such that the O*
registers go into a pt_regs struct as UREG_I*, and the I* registers
have been spilled onto the userspace stack.  For QEMU, we haven't
done that, so the guest's O* registers are still in WREG_O* and the
I* registers in WREG_I*.

The code was already accessing the O* registers correctly for QEMU,
but had copied the kernel code for accessing the I* registers off the
userspace stack.  Replace this with direct accesses to fp and i7 in
the CPU state, and add a comment explaining why we differ from the
kernel code here.

This fix is sufficient to get bash to a shell prompt.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201105212314.9628-3-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-11-10 07:53:39 +01:00
..
cpu_loop.c linux-user/sparc64: Fix the handling of window spill trap 2020-06-29 13:00:23 +02:00
meson.build meson: linux-user 2020-08-21 06:30:38 -04:00
signal.c linux-user/sparc: Correct set/get_context handling of fp and i7 2020-11-10 07:53:39 +01:00
sockbits.h linux-user: copy sparc/sockbits.h definitions from linux 2018-05-25 10:10:55 +02:00
syscall.tbl linux-user: update syscall.tbl to Linux 5.9-rc7 2020-10-26 11:39:23 +01:00
syscallhdr.sh linux-user, sparc, sparc64: add syscall table generation support 2020-03-20 16:02:00 +01:00
target_cpu.h linux-user/sparc: Fix cpu_clone_regs_* 2019-11-06 13:44:19 +01:00
target_elf.h linux-user: Move CPU type name selection to a function 2018-02-25 17:27:41 +01:00
target_errno.h linux-user: add sparc/sparc64 specific errno 2018-05-11 19:05:31 +02:00
target_fcntl.h linux-user: move sparc/sparc64 fcntl definitions to sparc/target_fcntl.h 2018-06-04 01:30:44 +02:00
target_signal.h linux-user: move sparc signal definitions to sparc/target_signal.h 2018-06-04 01:30:44 +02:00
target_structs.h linux-user: Clean up target_structs.h header guards 2016-07-12 16:19:16 +02:00
target_syscall.h linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory 2020-08-27 12:29:50 +02:00
termbits.h linux-user: Add missing termbits types and values definitions 2020-08-27 12:29:50 +02:00