qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 80f0fe: linux-user: Fix syscall parameter han


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 80f0fe: linux-user: Fix syscall parameter handling for MIP...
Date: Thu, 24 Mar 2022 13:08:37 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 80f0fe3a854081e6d2e3a35275eeec1e2e9a7794
      
https://github.com/qemu/qemu/commit/80f0fe3a854081e6d2e3a35275eeec1e2e9a7794
  Author: WANG Xuerui <xen0n@gentoo.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/user-internals.h

  Log Message:
  -----------
  linux-user: Fix syscall parameter handling for MIPS n32

The MIPS n32 ABI is basically n64 with the address space (i.e. pointer
width) shrinked to 32 bits. Meanwhile the current code treats it as
o32-like based on TARGET_ABI_BITS, which causes problems with n32
syscalls utilizing 64-bit offsets, like pread64, affecting most (if not
all) recently built n32 binaries.

This partially solves issue #909 ("qemu-mipsn32(el) user mode emulator
fails to execute any recently built n32 binaries"); with this change
applied, the built qemu-mipsn32el is able to progress beyond the
pread64, and finish _dl_start_user for the "getting ld.so load libc.so"
case. The program later dies with SIGBUS, though, due to _dl_start_user
not maintaining stack alignment after removing ld.so itself from argv,
and qemu-user starting to enforce alignment recently, but that is
orthogonal to the issue here; the more common case of chrooting is
working, verified with my own-built Gentoo n32 sysroot. (Depending on
the exact ISA used, one may have to explicitly specify QEMU_CPU, which
is the case for my chroot.)

Buglink: https://gitlab.com/qemu-project/qemu/-/issues/909
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220320052259.1610883-1-xen0n@gentoo.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 7fb5ef350bb434644fe1ac8eeb973543e017c932
      
https://github.com/qemu/qemu/commit/7fb5ef350bb434644fe1ac8eeb973543e017c932
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user/alpha: Fix sigsuspend for big-endian hosts

On alpha, the sigset argument for sigsuspend is in a register.
When we drop that into memory that happens in host-endianness,
but target_to_host_old_sigset will treat it as target-endianness.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-2-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 0a99f09383a0f08e5b7cd0c187166f7eff6014ad
      
https://github.com/qemu/qemu/commit/0a99f09383a0f08e5b7cd0c187166f7eff6014ad
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/signal-common.h
    M linux-user/signal.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Split out helpers for sigsuspend

Two new functions: process_sigsuspend_mask and finish_sigsuspend_mask.
Move the size check and copy-from-user code.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-3-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: cb22603444a262cd4d7d07c2ac1301a3df64769f
      
https://github.com/qemu/qemu/commit/cb22603444a262cd4d7d07c2ac1301a3df64769f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Properly handle sigset arg to pselect

Unblocked signals are never delivered, because we
didn't record the new mask for process_pending_signals.
Handle this with the same mechanism as sigsuspend.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/834
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-4-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: cd0e31a49a1af452b8abf1efa38d035b500c9d0a
      
https://github.com/qemu/qemu/commit/cd0e31a49a1af452b8abf1efa38d035b500c9d0a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Properly handle sigset arg to epoll_pwait

Unblocked signals are never delivered, because we
didn't record the new mask for process_pending_signals.
Handle this with the same mechanism as sigsuspend.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-5-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: db36aa7daab77a0780be6c044ad7144ac741043e
      
https://github.com/qemu/qemu/commit/db36aa7daab77a0780be6c044ad7144ac741043e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Properly handle sigset arg to ppoll

Unblocked signals are never delivered, because we
didn't record the new mask for process_pending_signals.
Handle this with the same mechanism as sigsuspend.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220315084308.433109-6-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 879667433a2cd8a62f436c937575f6dcdb187a18
      
https://github.com/qemu/qemu/commit/879667433a2cd8a62f436c937575f6dcdb187a18
  Author: Fergus Henderson <fergus@google.com>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Fix missing space in error message

Signed-off-by: Fergus Henderson <fergus@google.com>
Signed-off-by: Patrick Venture <venture@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220310192148.1696486-1-venture@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 6e05e7047c7271aa27e0cdd243a20dfd6c8cada2
      
https://github.com/qemu/qemu/commit/6e05e7047c7271aa27e0cdd243a20dfd6c8cada2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-23 (Wed, 23 Mar 2022)

  Changed paths:
    M linux-user/arm/cpu_loop.c

  Log Message:
  -----------
  linux-user/arm: Implement __kernel_memory_barrier

This fallback syscall was stubbed out.
It would only matter for emulating pre-armv6.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220323005839.94327-2-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 7f4f0d9ea87097a31b36bcc52b7368efed35593c
      
https://github.com/qemu/qemu/commit/7f4f0d9ea87097a31b36bcc52b7368efed35593c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-23 (Wed, 23 Mar 2022)

  Changed paths:
    M linux-user/arm/cpu_loop.c

  Log Message:
  -----------
  linux-user/arm: Implement __kernel_cmpxchg with host atomics

The existing implementation using start/end_exclusive
does not provide atomicity across processes.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220323005839.94327-3-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 330ea9d1d819680ac7501457220b8cd1c29f9d2f
      
https://github.com/qemu/qemu/commit/330ea9d1d819680ac7501457220b8cd1c29f9d2f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-03-23 (Wed, 23 Mar 2022)

  Changed paths:
    M linux-user/arm/cpu_loop.c

  Log Message:
  -----------
  linux-user/arm: Implement __kernel_cmpxchg64 with host atomics

If CONFIG_ATOMIC64, we can use a host cmpxchg and provide
atomicity across processes; otherwise we have no choice but
to continue using start/end_exclusive.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220323005839.94327-4-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 9c721291506c037d934900a6167dc3bf4a8f51a6
      
https://github.com/qemu/qemu/commit/9c721291506c037d934900a6167dc3bf4a8f51a6
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-03-24 (Thu, 24 Mar 2022)

  Changed paths:
    M linux-user/arm/cpu_loop.c
    M linux-user/elfload.c
    M linux-user/signal-common.h
    M linux-user/signal.c
    M linux-user/syscall.c
    M linux-user/user-internals.h

  Log Message:
  -----------
  Merge tag 'linux-user-for-7.0-pull-request' of 
https://gitlab.com/laurent_vivier/qemu into staging

linux-user pull request 20220324

Fix MIPS n32
Fix ppoll, epoll_wait, pselect
Fix error message in elfload.c
Implement ARM __kernel_memory_barrier/__kernel_cmpxchg/__kernel_cmpxchg64

# gpg: Signature made Thu 24 Mar 2022 08:19:57 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" 
[full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'linux-user-for-7.0-pull-request' of 
https://gitlab.com/laurent_vivier/qemu:
  linux-user/arm: Implement __kernel_cmpxchg64 with host atomics
  linux-user/arm: Implement __kernel_cmpxchg with host atomics
  linux-user/arm: Implement __kernel_memory_barrier
  linux-user: Fix missing space in error message
  linux-user: Properly handle sigset arg to ppoll
  linux-user: Properly handle sigset arg to epoll_pwait
  linux-user: Properly handle sigset arg to pselect
  linux-user: Split out helpers for sigsuspend
  linux-user/alpha: Fix sigsuspend for big-endian hosts
  linux-user: Fix syscall parameter handling for MIPS n32

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/e309ce90a23b...9c721291506c



reply via email to

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