You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/bsd-user/x86_64
Ilya Leoshkevich 1f31243a8c bsd-user/x86_64/target_arch_thread.h: Align stack
bsd-user qemu-x86_64 almost immediately dies with:

    qemu: 0x4002201a68: unhandled CPU exception 0xd - aborting

on FreeBSD 14.1-RELEASE. This is an instruction that requires
alignment:

    (gdb) x/i 0x4002201a68
       0x4002201a68:        movaps %xmm0,-0x40(%rbp)

and the argument is not aligned:

    (gdb) p/x env->regs[5]
    $1 = 0x822443b58

A quick experiment shows that the userspace entry point expects
misaligned rsp:

    (gdb) starti
    (gdb) p/x $rsp
    $1 = 0x7fffffffeaa8

Emulate this behavior in bsd-user.

[[ applied Richard's suggestion ]]

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Warner Losh <imp@bsdimp.com>
4 weeks ago
..
signal.c bsd-user: Clean up includes 2 years ago
target.h Clean up decorations and whitespace around header guards 3 years ago
target_arch.h Clean up ill-advised or unusual header guards 3 years ago
target_arch_cpu.c bsd-user: Clean up includes 2 years ago
target_arch_cpu.h Clean up ill-advised or unusual header guards 3 years ago
target_arch_elf.h bsd-user: Remove ELF_START_MMAP and image_info.start_mmap 1 year ago
target_arch_reg.h Clean up ill-advised or unusual header guards 3 years ago
target_arch_signal.h bsd-user: Define TARGET_SIGSTACK_ALIGN and use it to round stack 4 months ago
target_arch_sigtramp.h Clean up ill-advised or unusual header guards 3 years ago
target_arch_sysarch.h Clean up header guards that don't match their file name 3 years ago
target_arch_thread.h bsd-user/x86_64/target_arch_thread.h: Align stack 4 weeks ago
target_arch_vmparam.h Clean up ill-advised or unusual header guards 3 years ago
target_syscall.h bsd-user: move strace OS/arch dependent code to host/arch dirs 4 years ago