]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
6 weeks agotests/functional/test_aarch64_device_passthrough: update image
Pierrick Bouvier [Tue, 26 Aug 2025 10:21:27 +0000 (11:21 +0100)] 
tests/functional/test_aarch64_device_passthrough: update image

TF-A needs to be patched to enable support for FEAT_TCR2 and
FEAT_SCTLR2. This new image contains updated firmware.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250727074202.83141-2-richard.henderson@linaro.org
Message-ID: <20250719035838.2284029-2-pierrick.bouvier@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 weeks agotarget/arm: Clean up of register field definitions
Gustavo Romero [Tue, 26 Aug 2025 10:21:27 +0000 (11:21 +0100)] 
target/arm: Clean up of register field definitions

Clean up the definitions of NSW and NSA fields in the VTCR register.
These two fields are already defined properly using FIELD() so they are
actually duplications. Also, define the NSW and NSA fields in the
VSTCR register using FIELD() and remove their definitions based on VTCR
fields.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Message-id: 20250725014755.2122579-1-gustavo.romero@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 weeks agoMerge tag 'pull-lu-20250830' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Fri, 29 Aug 2025 22:24:48 +0000 (08:24 +1000)] 
Merge tag 'pull-lu-20250830' of https://gitlab.com/rth7680/qemu into staging

linux-user: Finish elfload.c split
linux-user: Drop deprecated -p option
linux-user: Tidy print_socket_protocol
hw/core: Dump cpu_reset in the reset.exit phase
hw/core: Use qemu_log_trylock/unlock in cpu_common_reset_exit

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmiyKFIdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/LBggAgMBSVMz1BwkPvckY
# paakdAwuOqRE5yF2YxQAHALJa3aH18Vqk06ENqM9R5iyqvHBGnvrw8fshIBVZnDP
# eQDjNFwnCtSrXuSMdfr0r8jZc+y9R8foQKs9j+KL0ESOi+4VNhORfzFe/yrIEu0y
# XM5XhBjBH0kK9+S20uy5x3WXhRkfqq2CZiUt1izqTOwtbdzYENxdvDj8iDk48FwL
# fkrXUSnlBBsdsltQCsjbrUbWi1Wqj7skswRIzI8KXsj+psy0JJL2kHthaWzm8tTS
# KIXVaOtxtU7LQWhTaknmpcNIkHpnjmEw2ZijxYT29V8WnZtstihVoqqCLbCv6u+7
# JwwQhQ==
# =kHx+
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 30 Aug 2025 08:23:14 AM AEST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-lu-20250830' of https://gitlab.com/rth7680/qemu: (91 commits)
  linux-user: Remove target_pt_regs from target_syscall.h
  linux-user/sparc: Create target_ptrace.h
  linux-user: Remove a.out declarations from elfload.c
  linux-user: Move arch_parse_elf_property to aarch64/elfload.c
  linux-user: Remove MAP_DENYWRITE from elfload.c
  linux-user: Remove ELIBBAD from elfload.c
  linux-user: Rename elf_check_arch
  linux-user: Standardize on ELF_MACHINE not ELF_ARCH
  linux-user: Move elf parameters to hexagon/target_elf.h
  linux-user: Move elf parameters to xtensa/target_elf.h
  linux-user: Move elf parameters to hppa/target_elf.h
  linux-user: Move elf parameters to riscv/target_elf.h
  linux-user: Move elf parameters to s390x/target_elf.h
  linux-user: Move elf parameters to alpha/target_elf.h
  linux-user: Move elf parameters to m68k/target_elf.h
  linux-user: Move elf parameters to sh4/target_elf.h
  linux-user: Move elf parameters to openrisc/target_elf.h
  linux-user: Move elf parameters to microblaze/target_elf.h
  linux-user: Move elf parameters to {mips,mips64}/target_elf.h
  linux-user: Move elf parameters to loongarch64/target_elf.h
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove target_pt_regs from target_syscall.h
Richard Henderson [Thu, 28 Aug 2025 11:55:01 +0000 (21:55 +1000)] 
linux-user: Remove target_pt_regs from target_syscall.h

All target_pt_regs which have not been broken out to
target_ptrace.h by this point are unused.  Remove them.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/sparc: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 11:51:46 +0000 (21:51 +1000)] 
linux-user/sparc: Create target_ptrace.h

Move target_pt_regs to target_ptrace.h.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove a.out declarations from elfload.c
Richard Henderson [Tue, 29 Jul 2025 21:45:13 +0000 (11:45 -1000)] 
linux-user: Remove a.out declarations from elfload.c

These should have been removed with the rest of the stub a.out
support in b9329d4b5321, though they were not in use even then.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move arch_parse_elf_property to aarch64/elfload.c
Richard Henderson [Tue, 29 Jul 2025 21:43:27 +0000 (11:43 -1000)] 
linux-user: Move arch_parse_elf_property to aarch64/elfload.c

Rename the controlling macro to HAVE_ELF_GNU_PROPERTY to
match the other HAVE_* macros.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove MAP_DENYWRITE from elfload.c
Richard Henderson [Tue, 29 Jul 2025 21:33:58 +0000 (11:33 -1000)] 
linux-user: Remove MAP_DENYWRITE from elfload.c

The last use of this fallback was removed in bf858897b769.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove ELIBBAD from elfload.c
Richard Henderson [Tue, 29 Jul 2025 21:30:26 +0000 (11:30 -1000)] 
linux-user: Remove ELIBBAD from elfload.c

The last use of this fallback was removed in 8e62a71738bc.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Rename elf_check_arch
Richard Henderson [Tue, 29 Jul 2025 21:26:43 +0000 (11:26 -1000)] 
linux-user: Rename elf_check_arch

Rename to elf_check_machine to match ELF_MACHINE.
Remove the unnecessary definition for loongarch64.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Standardize on ELF_MACHINE not ELF_ARCH
Richard Henderson [Tue, 29 Jul 2025 21:23:31 +0000 (11:23 -1000)] 
linux-user: Standardize on ELF_MACHINE not ELF_ARCH

PowerPC was the one outlier that defined both ELF_ARCH and
ELF_MACHINE; ELF_ARCH was defined incorrectly, necessitating
the definition of elf_check_arch.

However, the elf file header field in question is called
e_machine, so ELF_MACHINE is in fact the better name.

Mechanically change most target/target_elf.h files,
then adjust ppc/target_elf.h manually.

Do not provide a default for ELF_MACHINE.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to hexagon/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 21:14:14 +0000 (11:14 -1000)] 
linux-user: Move elf parameters to hexagon/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to xtensa/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 21:13:03 +0000 (11:13 -1000)] 
linux-user: Move elf parameters to xtensa/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to hppa/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 21:11:36 +0000 (11:11 -1000)] 
linux-user: Move elf parameters to hppa/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to riscv/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 21:03:31 +0000 (11:03 -1000)] 
linux-user: Move elf parameters to riscv/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to s390x/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:55:36 +0000 (10:55 -1000)] 
linux-user: Move elf parameters to s390x/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to alpha/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:53:00 +0000 (10:53 -1000)] 
linux-user: Move elf parameters to alpha/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to m68k/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:43:03 +0000 (10:43 -1000)] 
linux-user: Move elf parameters to m68k/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to sh4/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:42:01 +0000 (10:42 -1000)] 
linux-user: Move elf parameters to sh4/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to openrisc/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:40:21 +0000 (10:40 -1000)] 
linux-user: Move elf parameters to openrisc/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to microblaze/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:38:04 +0000 (10:38 -1000)] 
linux-user: Move elf parameters to microblaze/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to {mips,mips64}/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:30:44 +0000 (10:30 -1000)] 
linux-user: Move elf parameters to {mips,mips64}/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to loongarch64/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:26:37 +0000 (10:26 -1000)] 
linux-user: Move elf parameters to loongarch64/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to ppc/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:24:56 +0000 (10:24 -1000)] 
linux-user: Move elf parameters to ppc/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to sparc/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:19:10 +0000 (10:19 -1000)] 
linux-user: Move elf parameters to sparc/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to {arm,aarch64}/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:17:19 +0000 (10:17 -1000)] 
linux-user: Move elf parameters to {arm,aarch64}/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move elf parameters to {i386,x86_64}/target_elf.h
Richard Henderson [Tue, 29 Jul 2025 20:14:24 +0000 (10:14 -1000)] 
linux-user: Move elf parameters to {i386,x86_64}/target_elf.h

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove redundant ELF_DATA definitons
Richard Henderson [Sat, 2 Aug 2025 21:21:46 +0000 (07:21 +1000)] 
linux-user: Remove redundant ELF_DATA definitons

We already provide ELF_DATA based on TARGET_BIG_ENDIAN.
Remove the extra definitions from openrisc and s390x.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Remove ELF_EXEC_PAGESIZE
Richard Henderson [Tue, 29 Jul 2025 19:40:47 +0000 (09:40 -1000)] 
linux-user: Remove ELF_EXEC_PAGESIZE

Use TARGET_PAGE_SIZE instead.  If the target page size may vary,
using a different fixed size is wrong.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move get_vdso_image_info to arm/elfload.c
Richard Henderson [Tue, 29 Jul 2025 19:33:51 +0000 (09:33 -1000)] 
linux-user: Move get_vdso_image_info to arm/elfload.c

Rename from vdso_image_info to avoid a symbol clash.
Define HAVE_VDSO_IMAGE_INFO to signal the external definition exists.
Provide fallback versions for other targets.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Replace init_guest_commpage macro with function
Richard Henderson [Tue, 29 Jul 2025 19:16:37 +0000 (09:16 -1000)] 
linux-user: Replace init_guest_commpage macro with function

Turn the fallback macro into a function.  This will produce
a link error if the other macros are set up incorrectly.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move init_guest_commpage to hppa/elfload.c
Richard Henderson [Tue, 29 Jul 2025 19:13:54 +0000 (09:13 -1000)] 
linux-user: Move init_guest_commpage to hppa/elfload.c

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move init_guest_commpage to arm/elfload.c
Richard Henderson [Tue, 29 Jul 2025 19:11:12 +0000 (09:11 -1000)] 
linux-user: Move init_guest_commpage to arm/elfload.c

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Move init_guest_commpage to x86_64/elfload.c
Richard Henderson [Tue, 29 Jul 2025 19:06:15 +0000 (09:06 -1000)] 
linux-user: Move init_guest_commpage to x86_64/elfload.c

Rename INIT_GUEST_COMMPAGE to HAVE_GUEST_COMMPAGE
to match the other HAVE_* defines.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/xtensa: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 03:44:40 +0000 (13:44 +1000)] 
linux-user/xtensa: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/xtensa: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 11:35:33 +0000 (21:35 +1000)] 
linux-user/xtensa: Create target_ptrace.h

Remove the target_pt_regs; add target_user_pt_regs to
target_ptrace.h, which matches what is actually used.
Remove xtensa_reg_t and xtregs_opt_t.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/sh4: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 03:34:12 +0000 (13:34 +1000)] 
linux-user/sh4: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/sh4: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 11:22:08 +0000 (21:22 +1000)] 
linux-user/sh4: Create target_ptrace.h

Move target_pt_regs to target_ptrace.h.
Convert to abi_foo types.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/s390x: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 02:31:49 +0000 (12:31 +1000)] 
linux-user/s390x: Expand target_elf_gregset_t

Make use of the fact that target_elf_gregset_t is a proper structure.
This lets us drop the ugly cast to uint32_t* in the middle.

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>
6 weeks agolinux-user/s390x: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 11:13:03 +0000 (21:13 +1000)] 
linux-user/s390x: Create target_ptrace.h

Move target_psw_t to target_ptrace.h.  Note that abi_ulong already
has an attribute for 8-byte alignment, so there's no need to carry
another on target_psw_t.

Remove the target_pt_regs; add target_s390x_reg to target_ptrace.h,
which matches what is actually used.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/ppc: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 02:22:55 +0000 (12:22 +1000)] 
linux-user/ppc: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/ppc: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 11:02:35 +0000 (21:02 +1000)] 
linux-user/ppc: Create target_ptrace.h

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>
6 weeks agolinux-user/openrisc: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 02:09:26 +0000 (12:09 +1000)] 
linux-user/openrisc: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/openrisc: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 05:47:43 +0000 (15:47 +1000)] 
linux-user/openrisc: Create target_ptrace.h

Move the target_pt_regs structure from target_syscall.h and
rename to target_user_regs_struct, obviating the comment.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/mips: Use target_ulong for target_elf_greg_t
Richard Henderson [Thu, 28 Aug 2025 02:05:05 +0000 (12:05 +1000)] 
linux-user/mips: Use target_ulong for target_elf_greg_t

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>
6 weeks agolinux-user/mips: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 05:34:41 +0000 (15:34 +1000)] 
linux-user/mips: Create target_ptrace.h

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>
6 weeks agolinux-user/microblaze: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:55:27 +0000 (11:55 +1000)] 
linux-user/microblaze: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/microblaze: Fold target_pt_regs.r* to an array
Richard Henderson [Thu, 28 Aug 2025 05:28:11 +0000 (15:28 +1000)] 
linux-user/microblaze: Fold target_pt_regs.r* to an array

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>
6 weeks agolinux-user/microblaze: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 05:22:14 +0000 (15:22 +1000)] 
linux-user/microblaze: Create target_ptrace.h

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>
6 weeks agolinux-user/m68k: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:44:40 +0000 (11:44 +1000)] 
linux-user/m68k: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/loongarch64: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:37:08 +0000 (11:37 +1000)] 
linux-user/loongarch64: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/loongarch64: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 05:03:40 +0000 (15:03 +1000)] 
linux-user/loongarch64: Create target_ptrace.h

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>
6 weeks agolinux-user/arm: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:30:59 +0000 (11:30 +1000)] 
linux-user/arm: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/arm: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 04:56:57 +0000 (14:56 +1000)] 
linux-user/arm: Create target_ptrace.h

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>
6 weeks agolinux-user/aarch64: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:24:05 +0000 (11:24 +1000)] 
linux-user/aarch64: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/aarch64: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 04:50:33 +0000 (14:50 +1000)] 
linux-user/aarch64: Create target_ptrace.h

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>
6 weeks agolinux-user/x86_64: Fix dump of fs_base, gs_base
Richard Henderson [Thu, 28 Aug 2025 04:50:12 +0000 (14:50 +1000)] 
linux-user/x86_64: Fix dump of fs_base, gs_base

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>
6 weeks agolinux-user/x86_64: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:17:02 +0000 (11:17 +1000)] 
linux-user/x86_64: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/x86_64: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 04:41:40 +0000 (14:41 +1000)] 
linux-user/x86_64: Create target_ptrace.h

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>
6 weeks agolinux-user/i386: Expand target_elf_gregset_t
Richard Henderson [Thu, 28 Aug 2025 01:09:03 +0000 (11:09 +1000)] 
linux-user/i386: Expand target_elf_gregset_t

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>
6 weeks agolinux-user/i386: Create target_ptrace.h
Richard Henderson [Thu, 28 Aug 2025 04:19:04 +0000 (14:19 +1000)] 
linux-user/i386: Create target_ptrace.h

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>
6 weeks agolinux-user: Remove target_elf_greg_t, tswapreg from elfload.c
Richard Henderson [Thu, 28 Aug 2025 00:53:13 +0000 (10:53 +1000)] 
linux-user: Remove target_elf_greg_t, tswapreg from elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to xtensa/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:17:52 +0000 (06:17 -1000)] 
linux-user: Move elf_core_copy_regs to xtensa/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to s390x/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:16:07 +0000 (06:16 -1000)] 
linux-user: Move elf_core_copy_regs to s390x/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to m68k/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:14:26 +0000 (06:14 -1000)] 
linux-user: Move elf_core_copy_regs to m68k/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to sh4/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:12:27 +0000 (06:12 -1000)] 
linux-user: Move elf_core_copy_regs to sh4/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to openrisc/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:12:01 +0000 (06:12 -1000)] 
linux-user: Move elf_core_copy_regs to openrisc/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to microblaze/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:06:03 +0000 (06:06 -1000)] 
linux-user: Move elf_core_copy_regs to microblaze/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to mips/elfload.c
Richard Henderson [Tue, 29 Jul 2025 16:03:38 +0000 (06:03 -1000)] 
linux-user: Move elf_core_copy_regs to mips/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to loongarch64/elfload.c
Richard Henderson [Tue, 29 Jul 2025 15:58:48 +0000 (05:58 -1000)] 
linux-user: Move elf_core_copy_regs to loongarch64/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to ppc/elfload.c
Richard Henderson [Tue, 29 Jul 2025 15:55:56 +0000 (05:55 -1000)] 
linux-user: Move elf_core_copy_regs to ppc/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to aarch64/elfload.c
Richard Henderson [Tue, 29 Jul 2025 15:53:29 +0000 (05:53 -1000)] 
linux-user: Move elf_core_copy_regs to aarch64/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to arm/elfload.c
Richard Henderson [Tue, 29 Jul 2025 15:51:30 +0000 (05:51 -1000)] 
linux-user: Move elf_core_copy_regs to arm/elfload.c

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>
6 weeks agolinux-user: Move elf_core_copy_regs to {i386,x86_64}/elfload.c
Richard Henderson [Wed, 27 Aug 2025 23:48:07 +0000 (09:48 +1000)] 
linux-user: Move elf_core_copy_regs to {i386,x86_64}/elfload.c

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>
6 weeks agolinux-user: Rename USE_ELF_CORE_DUMP to HAVE_ELF_CORE_DUMP
Richard Henderson [Wed, 27 Aug 2025 23:46:08 +0000 (09:46 +1000)] 
linux-user: Rename USE_ELF_CORE_DUMP to HAVE_ELF_CORE_DUMP

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>
6 weeks agolinux-user: Declare elf_core_copy_regs in loader.h
Richard Henderson [Sat, 2 Aug 2025 09:38:28 +0000 (19:38 +1000)] 
linux-user: Declare elf_core_copy_regs in loader.h

Drop the static from all implementations.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: Update comment for target_elf_gregset_t
Richard Henderson [Wed, 27 Aug 2025 22:37:17 +0000 (08:37 +1000)] 
linux-user: Update comment for target_elf_gregset_t

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>
6 weeks agolinux-user/xtensa: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:32:11 +0000 (08:32 +1000)] 
linux-user/xtensa: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/s390x: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:30:25 +0000 (08:30 +1000)] 
linux-user/s390x: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/m68k: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:19:30 +0000 (08:19 +1000)] 
linux-user/m68k: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/sh4: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:17:40 +0000 (08:17 +1000)] 
linux-user/sh4: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/openrisc: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:15:44 +0000 (08:15 +1000)] 
linux-user/openrisc: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/microblaze: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:13:46 +0000 (08:13 +1000)] 
linux-user/microblaze: Convert target_elf_gregset_t to a struct

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>
6 weeks agolinux-user/mips: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:10:05 +0000 (08:10 +1000)] 
linux-user/mips: Convert target_elf_gregset_t to a struct

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>
6 weeks agolinux-user/loongarch64: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:07:32 +0000 (08:07 +1000)] 
linux-user/loongarch64: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/ppc: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:05:47 +0000 (08:05 +1000)] 
linux-user/ppc: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/aarch64: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:03:45 +0000 (08:03 +1000)] 
linux-user/aarch64: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/arm: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 22:02:18 +0000 (08:02 +1000)] 
linux-user/arm: Convert target_elf_gregset_t to a struct

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>
6 weeks agolinux-user/i386: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 21:57:31 +0000 (07:57 +1000)] 
linux-user/i386: Convert target_elf_gregset_t to a struct

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user/x86_64: Convert target_elf_gregset_t to a struct
Richard Henderson [Wed, 27 Aug 2025 21:55:10 +0000 (07:55 +1000)] 
linux-user/x86_64: Convert target_elf_gregset_t to a struct

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>
6 weeks agolinux-user: Drop deprecated -p option
Peter Maydell [Thu, 28 Aug 2025 16:20:12 +0000 (17:20 +0100)] 
linux-user: Drop deprecated -p option

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>

6 weeks agolinux-user: Tidy print_socket_protocol
Richard Henderson [Wed, 27 Aug 2025 21:36:25 +0000 (07:36 +1000)] 
linux-user: Tidy print_socket_protocol

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>
6 weeks agohw/core: Use qemu_log_trylock/unlock in cpu_common_reset_exit
Richard Henderson [Wed, 27 Aug 2025 05:34:35 +0000 (15:34 +1000)] 
hw/core: Use qemu_log_trylock/unlock in cpu_common_reset_exit

Ensure that the "CPU Reset" message won't be separated
from the cpu_dump_state output.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agohw/core: Dump cpu_reset in the reset.exit phase
Richard Henderson [Wed, 27 Aug 2025 05:27:50 +0000 (15:27 +1000)] 
hw/core: Dump cpu_reset in the reset.exit phase

During reset.hold, the cpu is in an inconsistent state,
where the leaf class has not had a chance to initialize
state at all.

This is visible as a SIGSEGV in "qemu-system-sparc64 -d cpu_reset".

Move the dump to the exit phase, where all initialization
is certain to be complete.

Reported-by: Henk van der Laak <henk@laaksoft.nl>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agoMerge tag 'pull-loongarch-20250828' of https://github.com/gaosong715/qemu into staging
Richard Henderson [Thu, 28 Aug 2025 21:44:50 +0000 (07:44 +1000)] 
Merge tag 'pull-loongarch-20250828' of https://github.com/gaosong715/qemu into staging

pull-loongarch-20250828

# -----BEGIN PGP SIGNATURE-----
#
# iLMEAAEIAB0WIQTKRzxE1qCcGJoZP81FK5aFKyaCFgUCaLBJawAKCRBFK5aFKyaC
# FhiGBACdQ1hkGp79sFrwi0h6GaP4NdbG8jx0vNGwPOqvbIc6Frn4bSyATNZI76k+
# /B2KTGLe4fU95QeXCJ937N1mNqcbagxFVeCaqSS71wuSfVKZBWLvGi8CckCqWU57
# GeUCQTOgA+E94C93G0pdgtyi2r7ambPnqTNifghkdoSN52Ta1Q==
# =pUq/
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 28 Aug 2025 10:19:55 PM AEST
# gpg:                using RSA key CA473C44D6A09C189A193FCD452B96852B268216
# gpg: Good signature from "Song Gao <gaosong@loongson.cn>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: CA47 3C44 D6A0 9C18 9A19  3FCD 452B 9685 2B26 8216

* tag 'pull-loongarch-20250828' of https://github.com/gaosong715/qemu:
  hw/intc/loongarch_pch_pic: Fix ubsan warning and endianness issue
  target/loongarch: Guard 64-bit-only insn translation with TRANS64 macro

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agohw/intc/loongarch_pch_pic: Fix ubsan warning and endianness issue
Thomas Huth [Fri, 1 Aug 2025 06:01:52 +0000 (08:01 +0200)] 
hw/intc/loongarch_pch_pic: Fix ubsan warning and endianness issue

When booting the Linux kernel from tests/functional/test_loongarch64_virt.py
with a QEMU that has been compiled with --enable-ubsan, there is
a warning like this:

 .../hw/intc/loongarch_pch_pic.c:171:46: runtime error: index 512 out of
  bounds for type 'uint8_t[64]' (aka 'unsigned char[64]')
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
  .../hw/intc/loongarch_pch_pic.c:171:46
 .../hw/intc/loongarch_pch_pic.c:175:45: runtime error: index 256 out of
  bounds for type 'uint8_t[64]' (aka 'unsigned char[64]')
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
  .../hw/intc/loongarch_pch_pic.c:175:45

It happens because "addr" is added first before substracting the base
(PCH_PIC_HTMSI_VEC or PCH_PIC_ROUTE_ENTRY).
Additionally, this code looks like it is not endianness safe, since
it uses a 64-bit pointer to write values into an array of 8-bit values.

Thus rework the code to use the stq_le_p / ldq_le_p helpers here
and make sure that we do not create pointers with undefined behavior
by accident.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
6 weeks agotarget/loongarch: Guard 64-bit-only insn translation with TRANS64 macro
WANG Rui [Fri, 25 Jul 2025 03:12:32 +0000 (11:12 +0800)] 
target/loongarch: Guard 64-bit-only insn translation with TRANS64 macro

This patch replaces uses of the generic TRANS macro with TRANS64 for
instructions that are only valid when 64-bit support is available.

This improves correctness and avoids potential assertion failures or
undefined behavior during translation on 32-bit-only configurations.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
6 weeks agoMerge tag 'pull-lu-20250828' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Wed, 27 Aug 2025 23:24:36 +0000 (09:24 +1000)] 
Merge tag 'pull-lu-20250828' of https://gitlab.com/rth7680/qemu into staging

linux-user: do not print IP socket options by default
linux-user: Add strace for rseq
linux-user: Move get_elf_cpu_model to target/elfload.c
linux-user: Move get_elf_hwcap to target/elfload.c
linux-user: Move get_elf_hwcap2 to target/elfload.c
linux-user: Move get_elf_platform to target/elfload.c
linux-user: Move get_elf_base_platform to target/elfload.c
linux-user: Create init_main_thread in target/cpu_loop.c
semihosting: Retrieve stack top from image_info
semihosting: Initialize heap once per process

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmive68dHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV+LwwgAsjSjc5Bjal0mc+UI
# Qmb7qbNM7YDhJ4o9eJoT7AfEo3AlR8vhA01/ayfBEKMxYStl4tkZU1jthb7LLTyS
# TfPBsZEBF/ZuTYLV56dfQ/6AJZ2g5OhqJbeVeD8Ef93JK60qgBerCK/D5SfphSfh
# TQtOG0LU2BXzGt8K3WghFxsFQeYcTrNeT5JdtIXYrmGQmDnPh3dOnQrFcO1leFLa
# khUfj7l7bE1Rgqo5h5pveaee4AD3VndYe10zvSVKHKjBL4Zd3hxf3MypNRpDFC0v
# ua9xt4qXtWgEYSkKPj/mipcd9fsb+RKs6kPA3oojwb8DCkFAZ0UogIwmd9/7lz8u
# FMp+iQ==
# =Nu63
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 28 Aug 2025 07:42:07 AM AEST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-lu-20250828' of https://gitlab.com/rth7680/qemu: (46 commits)
  linux-user: do not print IP socket options by default
  linux-user: Add strace for rseq
  linux-user: Remove do_init_main_thread
  linux-user/hexagon: Create init_main_thread
  linux-user/xtensa: Create init_main_thread
  linux-user/hppa: Create init_main_thread
  linux-user/riscv: Create init_main_thread
  linux-user/s390x: Create init_main_thread
  linux-user/alpha: Create init_main_thread
  linux-user/m68k: Create init_main_thread
  linux-user/sh4: Create init_main_thread
  linux-user/openrisc: Create init_main_thread
  linux-user/microblaze: Create init_main_thread
  linux-user/mips: Create init_main_thread
  linux-user/loongarch64: Create init_main_thread
  linux-user/ppc: Create init_main_thread
  linux-user/sparc: Create init_main_thread
  linux-user/aarch64: Create init_main_thread
  linux-user/arm: Remove a.out startup remenents
  linux-user/arm: Create init_main_thread
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agolinux-user: do not print IP socket options by default
Łukasz Stelmach [Wed, 27 Aug 2025 09:54:12 +0000 (11:54 +0200)] 
linux-user: do not print IP socket options by default

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>

6 weeks agolinux-user: Add strace for rseq
Joel Stanley [Tue, 26 Aug 2025 06:03:40 +0000 (15:33 +0930)] 
linux-user: Add strace for rseq

 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>