qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 1703eb: block/fuse: Let PUNCH_HOLE write zero


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 1703eb: block/fuse: Let PUNCH_HOLE write zeroes
Date: Sun, 12 Mar 2023 10:42:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 1703eb1c27a6010ff33d5add2d76aadc9b2777bd
      
https://github.com/qemu/qemu/commit/1703eb1c27a6010ff33d5add2d76aadc9b2777bd
  Author: Hanna Czenczek <hreitz@redhat.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M block/export/fuse.c

  Log Message:
  -----------
  block/fuse: Let PUNCH_HOLE write zeroes

fallocate(2) says about PUNCH_HOLE: "After a successful call, subsequent
reads from this range will return zeros."  As it is, PUNCH_HOLE is
implemented as a call to blk_pdiscard(), which does not guarantee this.

We must call blk_pwrite_zeroes() instead.  The difference to ZERO_RANGE
is that we pass the `BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK` flags to
the call -- the storage is supposed to be unmapped, and a slow fallback
by actually writing zeroes as data is not allowed.

Closes: https://gitlab.com/qemu-project/qemu/-/issues/1507
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230227104725.33511-2-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 27e0d8b508068c16e8f846428eb1d4e70ae11218
      
https://github.com/qemu/qemu/commit/27e0d8b508068c16e8f846428eb1d4e70ae11218
  Author: Hanna Czenczek <hreitz@redhat.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M tests/qemu-iotests/308
    M tests/qemu-iotests/308.out

  Log Message:
  -----------
  iotests/308: Add test for 'write -zu'

Try writing zeroes to a FUSE export while allowing the area to be
unmapped; block/file-posix.c generally implements writing zeroes with
BDRV_REQ_MAY_UNMAP ('write -zu') by calling fallocate(PUNCH_HOLE).  This
used to lead to a blk_pdiscard() in the FUSE export, which may or may
not lead to the area being zeroed.  HEAD^ fixed this to use
blk_pwrite_zeroes() instead (again with BDRV_REQ_MAY_UNMAP), so verify
that running `qemu-io 'write -zu'` on a FUSE exports always results in
zeroes being written.

Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230227104725.33511-3-hreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: ecf8191314798391b1df80bcb829c0ead4f8acc9
      
https://github.com/qemu/qemu/commit/ecf8191314798391b1df80bcb829c0ead4f8acc9
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M block/qed.c

  Log Message:
  -----------
  qed: remove spurious BDRV_POLL_WHILE()

This looks like a copy-paste or merge error. BDRV_POLL_WHILE() is
already called above. It's not needed in the qemu_in_coroutine() case.

Fixes: 9fb4dfc570ce ("qed: make bdrv_qed_do_open a coroutine_fn")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230309163134.398707-1-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 258bec39f3e58fcdb006028e5c5a1801136ef04a
      
https://github.com/qemu/qemu/commit/258bec39f3e58fcdb006028e5c5a1801136ef04a
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/main.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix access to /proc/self/exe

When accsssing /proc/self/exe from a userspace program, linux-user tries
to resolve the name via realpath(), which may fail if the process
changed the working directory in the meantime.

An example:
- a userspace program ist started with ./testprogram
- the program runs chdir("/tmp")
- then the program calls readlink("/proc/self/exe")
- linux-user tries to run realpath("./testprogram") which fails
  because ./testprogram isn't in /tmp
- readlink() will return -ENOENT back to the program

Avoid this issue by resolving the full path name of the started process
at startup of linux-user and store it in real_exec_path[]. This then
simplifies the emulation of readlink() and readlinkat() as well, because
they can simply copy the path string to userspace.

I noticed this bug because the testsuite of the debian package "pandoc"
failed on linux-user while it succeeded on real hardware.  The full log
is here:
https://buildd.debian.org/status/fetch.php?pkg=pandoc&arch=hppa&ver=2.17.1.1-1.1%2Bb1&stamp=1670153210&raw=0

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


  Commit: d759a62b122dcdf76d6ea10c56c5dff1d04d731d
      
https://github.com/qemu/qemu/commit/d759a62b122dcdf76d6ea10c56c5dff1d04d731d
  Author: Mathis Marion <mathis.marion@silabs.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/fd-trans.c
    M linux-user/fd-trans.h
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix timerfd read endianness conversion

When reading the expiration count from a timerfd, the endianness of the
64bit value read is the one of the host, just as for eventfds.

Signed-off-by: Mathis Marion <mathis.marion@silabs.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20230220085822.626798-2-Mathis.Marion@silabs.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fa2229dbf8e529f767d86db9e39b7e829c6759ed
      
https://github.com/qemu/qemu/commit/fa2229dbf8e529f767d86db9e39b7e829c6759ed
  Author: Mathis Marion <mathis.marion@silabs.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/fd-trans.c

  Log Message:
  -----------
  linux-user: add target to host netlink conversions

Added conversions for:
- IFLA_MTU
- IFLA_TXQLEN
- IFLA_AF_SPEC AF_INET6 IFLA_INET6_ADDR_GEN_MODE
These relate to the libnl functions rtnl_link_set_mtu,
rtnl_link_set_txqlen, and rtnl_link_inet6_set_addr_gen_mode.

Signed-off-by: Mathis Marion <mathis.marion@silabs.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20230220085822.626798-4-Mathis.Marion@silabs.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 9c1da8b5ee7f6e80e6b683e7fb73df1029a7cbbe
      
https://github.com/qemu/qemu/commit/9c1da8b5ee7f6e80e6b683e7fb73df1029a7cbbe
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user: Fix unaligned memory access in prlimit64 syscall

target_rlimit64 contains uint64_t fields, so it's 8-byte aligned on
some hosts, while some guests may align their respective type on a
4-byte boundary. This may lead to an unaligned access, which is an UB.

Fix by defining the fields as abi_ullong. This makes the host alignment
match that of the guest, and lets the compiler know that it should emit
code that can deal with the guest alignment.

While at it, also use __get_user() and __put_user() instead of
tswap64().

Fixes: 163a05a8398b ("linux-user: Implement prlimit64 syscall")
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20230224003907.263914-2-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: d2796be69d7c14b8675e87af54b1e469bf509fe3
      
https://github.com/qemu/qemu/commit/d2796be69d7c14b8675e87af54b1e469bf509fe3
  Author: Max Filippov <jcmvbkbc@gmail.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M include/elf.h
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: add support for xtensa FDPIC

Define xtensa-specific info_is_fdpic and fill in FDPIC-specific
registers in the xtensa version of init_thread.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Message-Id: <20230205061230.544451-1-jcmvbkbc@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 25bb27c715f6ea7cd68561112cbfc1dba4ff46bd
      
https://github.com/qemu/qemu/commit/25bb27c715f6ea7cd68561112cbfc1dba4ff46bd
  Author: Andreas Schwab <schwab@suse.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fill out task state in /proc/self/stat

Some programs want to match an actual task state character.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <mvmedq2kxoe.fsf@suse.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 86f04735ac2088d5c069c3d1712212ec7428c562
      
https://github.com/qemu/qemu/commit/86f04735ac2088d5c069c3d1712212ec7428c562
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Fix brk() to release pages

The current brk() implementation does not de-allocate pages if a lower
address is given compared to earlier brk() calls.
But according to the manpage, brk() shall deallocate memory in this case
and currently it breaks a real-world application, specifically building
the debian gcl package in qemu-user.

Fix this issue by reworking the qemu brk() implementation.

Tested with the C-code testcase included in qemu commit 4d1de87c750, and
by building debian package of gcl in a hppa-linux guest on a x86-64
host.

Signed-off-by: Helge Deller <deller@gmx.de>
Message-Id: <Y6gId80ek49TK1xB@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 8e0f5c1b10e18538083e96c0dddbd78c83d5b2fa
      
https://github.com/qemu/qemu/commit/8e0f5c1b10e18538083e96c0dddbd78c83d5b2fa
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/strace.c

  Log Message:
  -----------
  linux-user: Provide print_raw_param64() for 64-bit values

Add a new function print_raw_param64() to print 64-bit values in the
same way as print_raw_param(). This prevents that qemu_log() is used to
work around the problem that print_raw_param() can only print 32-bit
values when compiled for 32-bit targets.

Additionally convert the existing 64-bit users in print_timespec64(),
print_rlimit64() and print_preadwrite64() over to this new function and
drop some unneccessary spaces.

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

Message-Id: <Y9lNbFNyRSUhhrHa@p100>
[lvivier: remove print_preadwrite64 and print_rlimit64 part]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: dae81a083b13fe1607d369f103b0357a610a3167
      
https://github.com/qemu/qemu/commit/dae81a083b13fe1607d369f103b0357a610a3167
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/strace.c
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add strace for prlimit64() syscall

Add proper prlimit64() strace output.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20221222190639.124078-1-deller@gmx.de>
[lvivier: use print_raw_param64()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 44cf6731d6b9a48bcd57392e8cd6f0f712aaa677
      
https://github.com/qemu/qemu/commit/44cf6731d6b9a48bcd57392e8cd6f0f712aaa677
  Author: Mathis Marion <mathis.marion@silabs.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix sockaddr_in6 endianness

The sin6_scope_id field uses the host byte order, so there is a
conversion to be made when host and target endianness differ.

Signed-off-by: Mathis Marion <mathis.marion@silabs.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230307154256.101528-2-Mathis.Marion@silabs.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 2fe8ed6fe9dd8c50f06c16921b42d6f0e17f9f7c
      
https://github.com/qemu/qemu/commit/2fe8ed6fe9dd8c50f06c16921b42d6f0e17f9f7c
  Author: Mathis Marion <mathis.marion@silabs.com>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/fd-trans.c

  Log Message:
  -----------
  linux-user: handle netlink flag NLA_F_NESTED

Newer kernel versions require this flag to be present contrary to older
ones. Depending on the libnl version it is added or not.

Typically when using rtnl_link_inet6_set_addr_gen_mode, the netlink
packet generated may contain the following attribute:

with libnl 3.4

  {nla_len=16, nla_type=IFLA_AF_SPEC},
  [
    {nla_len=12, nla_type=AF_INET6},
    [{nla_len=5, nla_type=IFLA_INET6_ADDR_GEN_MODE}, IN6_ADDR_GEN_MODE_NONE]
  ]

with libnl 3.7

  {nla_len=16, nla_type=NLA_F_NESTED|IFLA_AF_SPEC},
  [
    {nla_len=12, nla_type=NLA_F_NESTED|AF_INET6},
    [{nla_len=5, nla_type=IFLA_INET6_ADDR_GEN_MODE}, IN6_ADDR_GEN_MODE_NONE]]
  ]

Masking the type is likely needed in other places. Only the above cases
are implemented in this patch.

Signed-off-by: Mathis Marion <mathis.marion@silabs.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20230307154256.101528-3-Mathis.Marion@silabs.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fe080593dd4f2c2763f7c27a3ba6e69b64fe3b0c
      
https://github.com/qemu/qemu/commit/fe080593dd4f2c2763f7c27a3ba6e69b64fe3b0c
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/alpha/target_mman.h
    M linux-user/generic/target_mman.h
    M linux-user/hppa/target_mman.h
    M linux-user/strace.list
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Add translation for argument of msync()

msync() uses the flags MS_ASYNC, MS_INVALIDATE and MS_SYNC, which differ
between platforms, specifcally on alpha and hppa.

Add a target to host translation for those and wire up a nicer strace
output.

This fixes the testsuite of the macaulay2 debian package with a hppa-linux
guest on a x86-64 host.

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

Message-Id: <Y5rMcts4qe15RaVN@p100>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 895ce8bb534e66ca418dea62ae67a92dccafb2e1
      
https://github.com/qemu/qemu/commit/895ce8bb534e66ca418dea62ae67a92dccafb2e1
  Author: Helge Deller <deller@gmx.de>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/strace.c
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Emulate CLONE_PIDFD flag in clone()

Add emulation for the CLONE_PIDFD flag of the clone() syscall.
This flag was added in Linux kernel 5.2.

Successfully tested on a x86-64 Linux host with hppa-linux target.
Can be verified by running the testsuite of the qcoro debian package,
which breaks hard and kills the currently logged-in user without this
patch.

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

Message-Id: <Y4XoJCpvUA1JD7Sj@p100>
[lv: define CLONE_PIDFD if it is not]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 3116f020d455a0bff7bdc86c20dfc1a63a36f729
      
https://github.com/qemu/qemu/commit/3116f020d455a0bff7bdc86c20dfc1a63a36f729
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Tidy syscall trap

Use TT_TRAP.

For sparc32, 0x88 is the "Slowaris" system call, currently BAD_TRAP
in the kernel's ttable_32.S.  For sparc64, 0x110 is tl0_linux32, the
sparc32 trap, now folded into the TARGET_ABI32 case via TT_TRAP.

For sparc64, there does still exist trap 0x111 as tl0_oldlinux64,
which was replaced by 0x16d as tl0_linux64 in 1998.  Since no one
has noticed, don't bother implementing it now.

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


  Commit: 9cee640a444a5b861d15178a19a26065d77aae8b
      
https://github.com/qemu/qemu/commit/9cee640a444a5b861d15178a19a26065d77aae8b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Tidy syscall error return

Reduce ifdefs with #define syscall_cc.

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


  Commit: 88cdb6032f7ff1fb3bab7c517c53cf20095f1e30
      
https://github.com/qemu/qemu/commit/88cdb6032f7ff1fb3bab7c517c53cf20095f1e30
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Use TT_TRAP for flush windows

The v9 and pre-v9 code can be unified with this macro.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230216054516.1267305-5-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 6f772241e6d0b154c4a99c8f4c55e9ebe5173a09
      
https://github.com/qemu/qemu/commit/6f772241e6d0b154c4a99c8f4c55e9ebe5173a09
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Tidy window spill/fill traps

Add some macros to localize the hw difference between v9 and pre-v9.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230216054516.1267305-6-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: d6b036378004c27579aa68bf0174e4e8fbfff726
      
https://github.com/qemu/qemu/commit/d6b036378004c27579aa68bf0174e4e8fbfff726
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/sparc/cpu_loop.c
    M linux-user/sparc/signal.c

  Log Message:
  -----------
  linux-user/sparc: Fix sparc64_{get, set}_context traps

These traps are present for sparc64 with ilp32, aka sparc32plus.
Enabling them means adjusting the defines over in signal.c,
and fixing an incorrect usage of abi_ulong when we really meant
the full register, target_ulong.

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


  Commit: 52d104a5a5eaf0440369c20757ff5d170fd0ebc2
      
https://github.com/qemu/qemu/commit/52d104a5a5eaf0440369c20757ff5d170fd0ebc2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle software breakpoint trap

This is 'ta 1' for both v9 and pre-v9.

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


  Commit: 0908007f76bd3af297e6abdf6edb83a18b0938e0
      
https://github.com/qemu/qemu/commit/0908007f76bd3af297e6abdf6edb83a18b0938e0
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle division by zero traps

In addition to the hw trap vector, there is a software trap
assigned for older sparc without hw division instructions.

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


  Commit: 6abc58eb9772aad23d12c4c43dda7713576b58ac
      
https://github.com/qemu/qemu/commit/6abc58eb9772aad23d12c4c43dda7713576b58ac
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle getcc, setcc, getpsr traps

These are really only meaningful for sparc32, but they're
still present for backward compatibility for sparc64.

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


  Commit: 97ff1478d2783b8c0e71540085aec66a70f2d52b
      
https://github.com/qemu/qemu/commit/97ff1478d2783b8c0e71540085aec66a70f2d52b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle priviledged opcode trap

For the most part priviledged opcodes are ifdefed out of the
user-only sparc translator, which will then incorrectly produce
illegal opcode traps.  But there are some code paths that
properly raise TT_PRIV_INSN, so we must handle it.

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


  Commit: 235f33b81834c5e60a53de47e4907da888448be7
      
https://github.com/qemu/qemu/commit/235f33b81834c5e60a53de47e4907da888448be7
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle privilidged action trap

This is raised by using an %asi < 0x80 in user-mode.

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


  Commit: c47d7c87bf1cc164306a6bf51d550e5f10bcca02
      
https://github.com/qemu/qemu/commit/c47d7c87bf1cc164306a6bf51d550e5f10bcca02
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle coprocessor disabled trap

Since qemu does not implement a sparc coprocessor, all such
instructions raise this trap.  Because of that, we never raise
the coprocessor exception trap, which would be vector 0x28.

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


  Commit: 81f04cd34ccd3dab6c796a5fbc439a8061b04ef3
      
https://github.com/qemu/qemu/commit/81f04cd34ccd3dab6c796a5fbc439a8061b04ef3
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

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

  Log Message:
  -----------
  linux-user/sparc: Handle unimplemented flush trap

For sparc64, TT_UNIMP_FLUSH == TT_ILL_INSN, so this is
already handled.  For sparc32, the kernel uses SKIP_TRAP.

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


  Commit: 4ea3af392f85dc2e66059855266b3817b321dc90
      
https://github.com/qemu/qemu/commit/4ea3af392f85dc2e66059855266b3817b321dc90
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/sparc/cpu_loop.c
    M target/sparc/cpu.h

  Log Message:
  -----------
  linux-user/sparc: Handle floating-point exceptions

Raise SIGFPE for ieee exceptions.

The other types, such as FSR_FTT_UNIMPFPOP, should not appear,
because we enable normal emulation of missing insns at the
start of sparc_cpu_realizefn().

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


  Commit: e64c6d42b652b4acf10d83e1bc86d4fd4ce28ef2
      
https://github.com/qemu/qemu/commit/e64c6d42b652b4acf10d83e1bc86d4fd4ce28ef2
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/sparc/cpu_loop.c
    M linux-user/sparc/target_signal.h
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  linux-user/sparc: Handle tag overflow traps

This trap is raised by taddcctv and tsubcctv insns.

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


  Commit: 2732c739d846fc7a1972e984d71a3de0d3eef77b
      
https://github.com/qemu/qemu/commit/2732c739d846fc7a1972e984d71a3de0d3eef77b
  Author: fanwj@mail.ustc.edu.cn <fanwj@mail.ustc.edu.cn>
  Date:   2023-03-10 (Fri, 10 Mar 2023)

  Changed paths:
    M linux-user/i386/cpu_loop.c
    M linux-user/main.c

  Log Message:
  -----------
  linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64

On linux user mode, CPUX86State::gdt::base from Different CPUX86State
Objects have same value, It is incorrect! Every CPUX86State::gdt::base
Must points to independent memory space.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1405
Signed-off-by: fanwenjie <fanwj@mail.ustc.edu.cn>
Message-Id: <4172b90.58b08.18631b77860.Coremail.fanwj@mail.ustc.edu.cn>
[lv: remove unnecessary casts, split overlong line]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 0d622f8b320fe5d2e6102da2721ae47156146baf
      
https://github.com/qemu/qemu/commit/0d622f8b320fe5d2e6102da2721ae47156146baf
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-03-12 (Sun, 12 Mar 2023)

  Changed paths:
    M block/export/fuse.c
    M block/qed.c
    M tests/qemu-iotests/308
    M tests/qemu-iotests/308.out

  Log Message:
  -----------
  Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging

Block layer patches

- fuse: Fix fallocate(PUNCH_HOLE) to zero out the range
- qed: remove spurious BDRV_POLL_WHILE()

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmQLbtURHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9YekQ//SvVXzKbQCNoKJtbkmx9RYSVZt3C19Nfy
# +E3vUauBMvO1RA38J+ff3pBp7R2rWu1QQXZCVu0a5bg7R2cYSKs82Ua5Z6SG9KxZ
# TZSGw2vsYk5pcRJwUS+4lGkvV4zrUsm7gru5h+aL51YS20AaPfSaa/kKKMuWWabm
# O/7ct/gQdiH+8I3d1WpXTE69ZJoH6WK87TUg9HgdQWPwDgam0gbNEjsGjKioCKIz
# xuz28v1UufXL2PRIWmPh4X+XSvD81q3adgf+vM5tWOaeAL87Q0eLeyiAI0UrvE64
# X9IGsiDcbM3PaLSlZPborg/yDatWjnnBimbxAMuT7d4pbZXjbYPBOeLR7zPJQ2qQ
# x/sFgiAVGiR6pgWIC85E2rIsWfBIEAla/YowZRdNmCO7ar82wBhoGdUQx6nHP18U
# eJg50EhX9Fhf5kMt3tZf4AaJzn48QsBA+O7PKbc/DZBLrthOLKzyLM6SusbpBG8g
# jFsdlDYMy9dIB6g3BC6fwZAqQNqbEMlU63ZvQzeq5yPpjFyS5H3IGHLzDiYg/9m6
# WdRUM/wQKkq0YwF1OumQ+Uu8ClTJPDi/177+hOyQeIFZao3NgznDtA12rNroYOU2
# pDIff9K9gwOFFNmDDtsjm8h967pF7RJMZylvNilT+7xkMy2kwYdCo76TBYDyN8Kk
# aYBIDpWtPps=
# =PUFU
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 10 Mar 2023 17:54:29 GMT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* tag 'for-upstream' of https://repo.or.cz/qemu/kevin:
  qed: remove spurious BDRV_POLL_WHILE()
  iotests/308: Add test for 'write -zu'
  block/fuse: Let PUNCH_HOLE write zeroes

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


  Commit: 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517
      
https://github.com/qemu/qemu/commit/29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2023-03-12 (Sun, 12 Mar 2023)

  Changed paths:
    M include/elf.h
    M linux-user/alpha/target_mman.h
    M linux-user/elfload.c
    M linux-user/fd-trans.c
    M linux-user/fd-trans.h
    M linux-user/generic/target_mman.h
    M linux-user/generic/target_resource.h
    M linux-user/hppa/target_mman.h
    M linux-user/i386/cpu_loop.c
    M linux-user/main.c
    M linux-user/sparc/cpu_loop.c
    M linux-user/sparc/signal.c
    M linux-user/sparc/target_signal.h
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c
    M linux-user/syscall_defs.h
    M target/sparc/cpu.h

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

Pull request linux-user 20230308-v2

Fix gdt on i386/x86_64
Handle traps on sparc
Add translation for argument of msync
Emulate CLONE_PIDFD flag in clone
handle netlink flag NLA_F_NESTED
fix sockaddr_in6 endianness
Fix brk() to release pages
fill out task state in /proc/self/stat
add support for xtensa FDPIC
Fix unaligned memory access in prlimit64 syscall
add target to host netlink conversions
fix timerfd read endianness conversion
Fix access to /proc/self/exe
Add strace for prlimit64() syscall

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmQLqmMSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748e+cP/3XYMvPbExNi09idDvgzzBrFFHgnkCnK
# WAV/laxjHSJkzRNK06jD5KN/G2Osy587GXAWLaN76Y8mYMNJs5x3wwlBrJm0RyeJ
# mWeETJOjxsFjW1+5LKhYv6fwiDxQcyJUoRKzJI27fYgDS+H+zIpa+uhy82Ah543z
# i/HPyerp25TWAuVyR6mQICt7cne+4yjhtcjg0GXmnvm2+UVp54FGjesjwpSdbALl
# OKdCre/JaNOkKoaRSsxm0UhNEyQarJIEf/dv0fTjsEpvNX2SMuLUGCm+n23wjXGN
# fdnSGkoVe8hHxBtG80Zx8AMfKEmJoVsQw9rSg4HwQKOyrYPnLhHjb8ln43X+f3MN
# gq9lDBIxH82LH2Q5JqQQe7S2UJycpYb+qj0xm7llH7Wl9VVKG6hRX/Cd7I1PQLEv
# baPIrtye5TuR6uo0kn6HBB+Hd9RNu2PPHelmEFIGEuNaAPkyOt4FhKFIE/j0BTcg
# mFVCNj6Os805ks0sjIBvpTU1DBtuqpLxdvvHOwxYKCNThTl70wfHJJEjumfvZ4qT
# T+me7hRsd+8v1rRjxYGuJn2gqC7JL8miuJCYlZkn2DfMAunmF00U5ULe9KiCJ8V3
# kDfvO+CdnIN4MSlbtwt+eRSFCmJGGkzZ/jshVxPF3ZVirFu/undphYQnaEZDH+Xd
# KsPOh8MekMgJ
# =e55j
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 10 Mar 2023 22:08:35 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-8.0-pull-request' of 
https://gitlab.com/laurent_vivier/qemu: (28 commits)
  linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64
  linux-user/sparc: Handle tag overflow traps
  linux-user/sparc: Handle floating-point exceptions
  linux-user/sparc: Handle unimplemented flush trap
  linux-user/sparc: Handle coprocessor disabled trap
  linux-user/sparc: Handle privilidged action trap
  linux-user/sparc: Handle priviledged opcode trap
  linux-user/sparc: Handle getcc, setcc, getpsr traps
  linux-user/sparc: Handle division by zero traps
  linux-user/sparc: Handle software breakpoint trap
  linux-user/sparc: Fix sparc64_{get, set}_context traps
  linux-user/sparc: Tidy window spill/fill traps
  linux-user/sparc: Use TT_TRAP for flush windows
  linux-user/sparc: Tidy syscall error return
  linux-user/sparc: Tidy syscall trap
  linux-user: Emulate CLONE_PIDFD flag in clone()
  linux-user: Add translation for argument of msync()
  linux-user: handle netlink flag NLA_F_NESTED
  linux-user: fix sockaddr_in6 endianness
  linux-user: Add strace for prlimit64() syscall
  ...

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


Compare: https://github.com/qemu/qemu/compare/ee41280a9300...29c8a9e31a98



reply via email to

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