aboutsummaryrefslogtreecommitdiff
path: root/linux-user
AgeCommit message (Collapse)AuthorFilesLines
2025-08-30linux-user/mips: Use target_ulong for target_elf_greg_tRichard Henderson3-50/+22
Make use of the fact that target_elf_gregset_t is a proper structure. The target_ulong type matches the abi_ulong/abi_ullong selection within mips64/target_elf.h. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/mips: Create target_ptrace.hRichard Henderson4-35/+33
Move the target_pt_regs structure from target_syscall.h. Fix the incorrect ordering of the fields. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/microblaze: Expand target_elf_gregset_tRichard Henderson2-13/+12
Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/microblaze: Fold target_pt_regs.r* to an arrayRichard Henderson2-96/+8
Separately enumerating all 32 registers is not helpful. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/microblaze: Create target_ptrace.hRichard Henderson3-44/+51
Move the target_pt_regs structure from target_syscall.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/m68k: Expand target_elf_gregset_tRichard Henderson2-27/+39
Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/loongarch64: Expand target_elf_gregset_tRichard Henderson2-14/+7
Make use of the fact that target_elf_gregset_t is a proper structure. Note that the kernel's uses an array, and then it has a bunch of defines to create symbolic offsets. Modulo some reserved fields, which we do not implement here, this is the same layout as struct user_pt_regs. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/loongarch64: Create target_ptrace.hRichard Henderson2-23/+15
Remove the target_pt_regs structure from target_syscall.h. Add target_user_pt_regs to target_ptrace.h, which matches what is actually used on loongarch64. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/arm: Expand target_elf_gregset_tRichard Henderson2-9/+10
Make use of the fact that target_elf_gregset_t is a proper structure. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/arm: Create target_ptrace.hRichard Henderson2-8/+16
Move the target_pt_regs structure from target_syscall.h. Replace the array with proper structure fields. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/aarch64: Expand target_elf_gregset_tRichard Henderson2-10/+12
Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_pt_regs. Drop ELF_NREG, target_elf_greg_t, and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/aarch64: Create target_ptrace.hRichard Henderson2-7/+14
Move the target_pt_regs structure from target_syscall.h, and rename to target_user_pt_regs, to match what's in ptrace.h. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/x86_64: Fix dump of fs_base, gs_baseRichard Henderson1-2/+2
We were storing the selector, not the base. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/x86_64: Expand target_elf_gregset_tRichard Henderson2-38/+32
The comment re ELF_NREG is incorrect or out-of-date. Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_regs_struct. Drop target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/x86_64: Create target_ptrace.hRichard Henderson2-28/+40
Remove the target_pt_regs structure from target_syscall.h. Add target_user_regs_struct to target_ptrace.h, which matches what is actually used on x86_64. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/i386: Expand target_elf_gregset_tRichard Henderson2-28/+22
The comment re ELF_NREG is incorrect or out-of-date. Make use of the fact that target_elf_gregset_t is a proper structure by using target_user_regs_struct. Drop target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/i386: Create target_ptrace.hRichard Henderson2-18/+32
Remove the target_pt_regs structure from target_syscall.h. Add target_user_regs_struct to target_ptrace.h, which is what is actually used by ELF_CORE_COPY_REGS; the layout of the two structure definitions is identical. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Remove target_elf_greg_t, tswapreg from elfload.cRichard Henderson1-8/+0
These are no longer used within the generic file. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to xtensa/elfload.cRichard Henderson3-39/+45
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to s390x/elfload.cRichard Henderson3-32/+37
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to m68k/elfload.cRichard Henderson3-31/+37
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to sh4/elfload.cRichard Henderson3-33/+38
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to openrisc/elfload.cRichard Henderson3-16/+22
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to microblaze/elfload.cRichard Henderson3-21/+26
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to mips/elfload.cRichard Henderson4-46/+68
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to loongarch64/elfload.cRichard Henderson3-25/+30
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to ppc/elfload.cRichard Henderson3-26/+31
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to aarch64/elfload.cRichard Henderson3-15/+20
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to arm/elfload.cRichard Henderson3-15/+20
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Move elf_core_copy_regs to {i386,x86_64}/elfload.cRichard Henderson5-77/+88
Move elf_core_copy_regs to elfload.c. Move HAVE_ELF_CORE_DUMP, ELF_NREGS, target_elf_gregset_t to target_elf.h. For now, duplicate the definitions of target_elf_greg_t and tswapreg. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Rename USE_ELF_CORE_DUMP to HAVE_ELF_CORE_DUMPRichard Henderson1-19/+19
The other knobs in target_elf.h are all HAVE_*. Rename this USE_ELF_CORE_DUMP to match. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Declare elf_core_copy_regs in loader.hRichard Henderson2-19/+17
Drop the static from all implementations. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Update comment for target_elf_gregset_tRichard Henderson1-6/+2
The only thing now used by generic core dump code is target_elf_gregset_t; ELF_NREG and target_elf_greg_t are now private to the implementation. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/xtensa: Convert target_elf_gregset_t to a structRichard Henderson1-12/+14
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/s390x: Convert target_elf_gregset_t to a structRichard Henderson1-7/+9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/m68k: Convert target_elf_gregset_t to a structRichard Henderson1-23/+25
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/sh4: Convert target_elf_gregset_t to a structRichard Henderson1-14/+13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/openrisc: Convert target_elf_gregset_t to a structRichard Henderson1-8/+8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/microblaze: Convert target_elf_gregset_t to a structRichard Henderson1-12/+12
While we're at it, drop "pos++" and simply open-code indexes. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/mips: Convert target_elf_gregset_t to a structRichard Henderson1-15/+15
While we're at it, merge the store of TARGET_EF_R0 into the loop over all R0 registers. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/loongarch64: Convert target_elf_gregset_t to a structRichard Henderson1-9/+9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/ppc: Convert target_elf_gregset_t to a structRichard Henderson1-9/+11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/aarch64: Convert target_elf_gregset_t to a structRichard Henderson1-9/+8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/arm: Convert target_elf_gregset_t to a structRichard Henderson1-22/+10
While we're at it, loop over the general registers rather than open-code them. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/i386: Convert target_elf_gregset_t to a structRichard Henderson1-20/+22
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user/x86_64: Convert target_elf_gregset_t to a structRichard Henderson1-30/+32
A structure typedef may be abstract, while an array typedef cannot. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-30linux-user: Drop deprecated -p optionPeter Maydell1-12/+0
The user-mode '-p' option has been deprecated since 9.0 and doesn't do anything except emit a warning. We are well past our minimum deprecation period, so drop the option. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250828162012.3307647-1-peter.maydell@linaro.org>
2025-08-30linux-user: Tidy print_socket_protocolRichard Henderson1-47/+49
Sink all of the qemu_log calls to the end, collecting only a string for the name, if identified. Merge separate if blocks into one switch. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2025-08-28linux-user: do not print IP socket options by defaultŁukasz Stelmach1-16/+20
IP protocols should not be printed unless the socket is an IPv4 or IPv6 one. Current arrangement erroneously prints IPPROTO_IP for Unix domain sockets. Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250827095412.2348821-1-l.stelmach@samsung.com>
2025-08-28linux-user: Add strace for rseqJoel Stanley1-0/+3
build/qemu-riscv64 -cpu rv64,v=on -d strace build/tests/tcg/riscv64-linux-user/test-vstart-overflow 1118081 riscv_hwprobe(0xffffbc038200,1,0,0,0,0) = 0 1118081 brk(NULL) = 0x0000000000085000 1118081 brk(0x0000000000085b00) = 0x0000000000085b00 1118081 set_tid_address(0x850f0) = 1118081 1118081 set_robust_list(0x85100,24) = -1 errno=38 (Function not implemented) 1118081 rseq(0x857c0,32,0,0xf1401073) = -1 errno=38 (Function not implemented) Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250826060341.1118670-1-joel@jms.id.au>