qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] af5526: linux-user/mips64: Restore setup_fram


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] af5526: linux-user/mips64: Restore setup_frame() for o32 ABI
Date: Mon, 15 Feb 2021 06:11:42 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: af552644a7a2c5a4d57ae158d831bf8ef79d12dc
      
https://github.com/qemu/qemu/commit/af552644a7a2c5a4d57ae158d831bf8ef79d12dc
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/mips64/target_signal.h

  Log Message:
  -----------
  linux-user/mips64: Restore setup_frame() for o32 ABI

64-bit MIPS targets lost setup_frame() during the refactor in commit
8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be
able to build the o32 ABI target.

Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips 
directory")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20201119161710.1985083-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 0b72da03001c8c9f077fc019b9651c19a32c4600
      
https://github.com/qemu/qemu/commit/0b72da03001c8c9f077fc019b9651c19a32c4600
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/mips64/syscall_nr.h

  Log Message:
  -----------
  linux-user/mips64: Support o32 ABI syscalls

o32 ABI syscalls start at offset 4000.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20201119161710.1985083-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 1c3dfb506ea3decd17ec69ed6eaf611a885b9f59
      
https://github.com/qemu/qemu/commit/1c3dfb506ea3decd17ec69ed6eaf611a885b9f59
  Author: Alistair Francis <alistair.francis@wdc.com>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/signal.c

  Log Message:
  -----------
  linux-user/signal: Decode waitid si_code

When mapping the host waitid status to the target status we previously
just used decoding information in the status value. This doesn't follow
what the waitid documentation describes, which instead suggests using
the si_code value for the decoding. This results in the incorrect values
seen when calling waitid. This is especially apparent on RV32 where all
wait calls use waitid (see the bug case).

This patch just passes the waitid status directly back to the guest.

Buglink: https://bugs.launchpad.net/qemu/+bug/1906193
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: 
<1fb2d56aa23a81f4473e638abe9e2d78c09a3d5b.1611080607.git.alistair.francis@wdc.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 23b311155078bdd5bacc016ff3b3ebb5462b10c0
      
https://github.com/qemu/qemu/commit/23b311155078bdd5bacc016ff3b3ebb5462b10c0
  Author: Helge Deller <deller@gmx.de>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/alpha/target_fcntl.h
    M linux-user/hppa/target_fcntl.h

  Log Message:
  -----------
  linux-user: Add missing TARGET___O_TMPFILE for hppa and alpha

The hppa and alpha targets miss the #define of the TARGET___O_TMPFILE
and as such fail to run a trivial symlink command like

    ln -s /bin/bash /tmp

which results in an -EINVAL return code.

Adding the define fixes the problem.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210201155922.GA18291@ls3530.fritz.box>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 2bdc74f3d7c4cacb65dbde910471c62992640275
      
https://github.com/qemu/qemu/commit/2bdc74f3d7c4cacb65dbde910471c62992640275
  Author: Helge Deller <deller@gmx.de>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/hppa/target_fcntl.h

  Log Message:
  -----------
  linux-user: fix O_NONBLOCK usage for hppa target

Historically the parisc linux port tried to be compatible with HP-UX
userspace and as such defined the O_NONBLOCK constant to 0200004 to
emulate separate NDELAY & NONBLOCK values.

Since parisc was the only Linux platform which had two bits set, this
produced various userspace issues. Finally it was decided to drop the
(never completed) HP-UX compatibilty, which is why O_NONBLOCK was
changed upstream to only have one bit set in future with this commit:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75ae04206a4d0e4f541c1d692b7febd1c0fdb814

This patch simply adjusts the value for qemu-user too.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210201220551.GA8015@ls3530.fritz.box>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 78721301138114cf37fb179a6cf73a27c1b3a927
      
https://github.com/qemu/qemu/commit/78721301138114cf37fb179a6cf73a27c1b3a927
  Author: Helge Deller <deller@gmx.de>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/hppa/target_fcntl.h
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls

On the hppa target userspace binaries may call signalfd4() and
eventfd2() with an old TARGET_O_NONBLOCK value of 000200004 instead of
000200000 for the "mask" syscall parameter, in which case the current
emulation doesn't handle the translation to the native O_NONBLOCK value
correctly.

The 0x04 bit is not masked out before the new O_NONBLOCK bit is set and
as such when calling the native syscall errors out with EINVAL.

Fix this by introducing TARGET_O_NONBLOCK_MASK which is used to mask off
all possible bits. This define defaults to TARGET_O_NONBLOCK when not
defined otherwise, so for all other targets the implementation will
behave as before.

This patch needs to be applied on top of my previous two patches.

Bug was found and patch was verified by using qemu-hppa as debian buildd
server on x86_64.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Message-Id: <20210210061214.GA221322@ls3530.fritz.box>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 22d113b52f410d345c3a50a00d2eafa64138e427
      
https://github.com/qemu/qemu/commit/22d113b52f410d345c3a50a00d2eafa64138e427
  Author: Giuseppe Musacchio <thatlemon@gmail.com>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Fix loading of BSS segments

Some ELF binaries encode the .bss section as an extension of the data
ones by setting the segment p_memsz > p_filesz. Some other binaries take
a different route and encode it as a stand-alone PT_LOAD segment with
p_filesz = 0 and p_memsz > 0.

Both the encodings are actually correct per ELF specification but the
ELF loader had some troubles in handling the former: with the old logic
it was very likely to get Qemu to crash in zero_bss when trying to
access unmapped memory.

zero_bss isn't meant to allocate whole zero-filled segments but to
"complete" a previously mapped segment with the needed zero bits.

The fix is pretty simple, if the segment is completely zero-filled we
simply allocate one or more pages (according to p_memsz) and avoid
calling zero_bss altogether.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Message-Id: <c9106487-dc4d-120a-bd48-665b3c617287@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: ccc5ccc17f8cfbfd87d9aede5d12a2d47c56e712
      
https://github.com/qemu/qemu/commit/ccc5ccc17f8cfbfd87d9aede5d12a2d47c56e712
  Author: Richard Purdie <richard.purdie@linuxfoundation.org>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user/mmap: Avoid asserts for out of range mremap calls

If mremap() is called without the MREMAP_MAYMOVE flag with a start address
just before the end of memory (reserved_va) where new_size would exceed
it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in 
page_set_flags() would trigger.

Add an extra guard to the guest_range_valid() checks to prevent this and
avoid asserting binaries when reserved_va is set.

This meant a bug I was seeing locally now gives the same behaviour 
regardless of whether reserved_va is set or not.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
Reviewed-by: Laurent Vivier <laurent@vivier.eu>

Message-Id: <70c46e7b999bafbb01d54bfafd44b420d0b782e9.camel@linuxfoundation.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 4df7b7fac84ba570bb33970659296555896232b6
      
https://github.com/qemu/qemu/commit/4df7b7fac84ba570bb33970659296555896232b6
  Author: Stefan <stefan-guix@vodafonemail.de>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user/syscall: Fix do_ioctl_ifconf() for 64 bit targets.

The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit architectures.
This structure contains a union of other structures, of which struct ifmap
is the biggest for 64 bit architectures. Calling ioclt(…, SIOCGIFCONF, …)
fills a struct sockaddr of that union, and do_ioctl_ifconf() only considered
that struct sockaddr for the size of the union, which has the same size as
struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a wrong
size of 32 for struct ifreq instead of the correct size of 40 on 64 bit
architectures.

The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part of
the union, treating struct ifreq with the correct size.

Signed-off-by: Stefan <stefan-guix@vodafonemail.de>
Message-Id: <60AA0765-53DD-43D1-A3D2-75F1778526F6@vodafonemail.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: ec63e06ef7edd8fb048fe41b901d68c888df9e6c
      
https://github.com/qemu/qemu/commit/ec63e06ef7edd8fb048fe41b901d68c888df9e6c
  Author: Jason A. Donenfeld <Jason@zx2c4.com>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/generic/sockbits.h
    M linux-user/mips/sockbits.h
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}

These were defined for other platforms but mistakenly left out of mips
and generic, so this commit adds them to the places missing. Then it
makes them be translated in getsockopt.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210204153925.2030606-1-Jason@zx2c4.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fba087458d3ca6f5470e0cdec82aaefe0854ddb2
      
https://github.com/qemu/qemu/commit/fba087458d3ca6f5470e0cdec82aaefe0854ddb2
  Author: Chen Gang <chengang@emindsoft.com.cn>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M linux-user/alpha/target_signal.h
    M linux-user/generic/signal.h
    M linux-user/hppa/target_signal.h
    M linux-user/mips/target_signal.h
    M linux-user/mips64/target_signal.h
    M linux-user/sparc/target_signal.h

  Log Message:
  -----------
  linux-user: target: signal: Support TARGET_SS_AUTODISARM

Add definitions to pass building.

Signed-off-by: Chen Gang <chengang@emindsoft.com.cn>
Message-Id: <20201008043105.21058-1-chengang@emindsoft.com.cn>
[lv: added the definitions in linux-user/generic/signal.h too]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 5b30c53041d8f4c26ed3cf8434c08cdc9858ec87
      
https://github.com/qemu/qemu/commit/5b30c53041d8f4c26ed3cf8434c08cdc9858ec87
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-02-15 (Mon, 15 Feb 2021)

  Changed paths:
    M docs/user/main.rst

  Log Message:
  -----------
  docs/user: Remove outdated 'Quick Start' section

The 'Quick Start' section of the userspace emulator documentation is
very old and outdated. In particular:
 - it suggests running x86-on-x86 emulation, which is the least
   interesting possible use case
 - it recommends that users download tarballs of guest binaries
   from the QEMU web page which we no longer provide there

There's nothing salvageable here; delete it all.

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


  Commit: b8f91fd49c5c6993e06f0cd7bf024d176051320e
      
https://github.com/qemu/qemu/commit/b8f91fd49c5c6993e06f0cd7bf024d176051320e
  Author: Fredrik Noring <noring@nocrew.org>
  Date:   2021-02-15 (Mon, 15 Feb 2021)

  Changed paths:
    M linux-user/mips64/target_elf.h

  Log Message:
  -----------
  linux-user/mips: Support the n32 ABI for the R5900

Recognise the R5900, which reports itself as MIPS III, as a 64-bit CPU
supporting the n32 ABI.

Signed-off-by: Fredrik Noring <noring@nocrew.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: 
<5bea109f0c140da6a821aa7f9705d4b3717e86dc.1541701393.git.noring@nocrew.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 3ea856094cb77fe3087f607fa75382073963254b
      
https://github.com/qemu/qemu/commit/3ea856094cb77fe3087f607fa75382073963254b
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-02-15 (Mon, 15 Feb 2021)

  Changed paths:
    M docs/user/main.rst
    M linux-user/alpha/target_fcntl.h
    M linux-user/alpha/target_signal.h
    M linux-user/elfload.c
    M linux-user/generic/signal.h
    M linux-user/generic/sockbits.h
    M linux-user/hppa/target_fcntl.h
    M linux-user/hppa/target_signal.h
    M linux-user/mips/sockbits.h
    M linux-user/mips/target_signal.h
    M linux-user/mips64/syscall_nr.h
    M linux-user/mips64/target_elf.h
    M linux-user/mips64/target_signal.h
    M linux-user/mmap.c
    M linux-user/signal.c
    M linux-user/sparc/target_signal.h
    M linux-user/syscall.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging

Pull request

# gpg: Signature made Mon 15 Feb 2021 12:51:38 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

* remotes/vivier2/tags/linux-user-for-6.0-pull-request:
  linux-user/mips: Support the n32 ABI for the R5900
  docs/user: Remove outdated 'Quick Start' section
  linux-user: target: signal: Support TARGET_SS_AUTODISARM
  linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
  linux-user/syscall: Fix do_ioctl_ifconf() for 64 bit targets.
  linux-user/mmap: Avoid asserts for out of range mremap calls
  linux-user: Fix loading of BSS segments
  linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls
  linux-user: fix O_NONBLOCK usage for hppa target
  linux-user: Add missing TARGET___O_TMPFILE for hppa and alpha
  linux-user/signal: Decode waitid si_code
  linux-user/mips64: Support o32 ABI syscalls
  linux-user/mips64: Restore setup_frame() for o32 ABI

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


Compare: https://github.com/qemu/qemu/compare/0280396a33c7...3ea856094cb7



reply via email to

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