qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d135f7: linux-user: use 'max' instead of 'qem


From: Paolo Bonzini
Subject: [Qemu-commits] [qemu/qemu] d135f7: linux-user: use 'max' instead of 'qemu32' / 'qemu6...
Date: Thu, 29 Sep 2022 14:47:47 +0000 (UTC)

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d135f781405f7c78153aa65e0327b05a4aa72e50
      
https://github.com/qemu/qemu/commit/d135f781405f7c78153aa65e0327b05a4aa72e50
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2022-09-23 (Fri, 23 Sep 2022)

  Changed paths:
    M linux-user/i386/target_elf.h
    M linux-user/x86_64/target_elf.h

  Log Message:
  -----------
  linux-user: use 'max' instead of 'qemu32' / 'qemu64' by default

The 'qemu64' CPU model implements the least featureful x86_64 CPU that's
possible. Historically this hasn't been an issue since it was rare for
OS distros to build with a higher mandatory CPU baseline.

With RHEL-9, however, the entire distro is built for the x86_64-v2 ABI
baseline:

  
https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level

It is likely that other distros may take similar steps in the not too
distant future. For example, it has been suggested for Fedora on a
number of occasions.

This new baseline is not compatible with the qemu64 CPU model though.
While it is possible to pass a '-cpu xxx' flag to qemu-x86_64, the
usage of QEMU doesn't always allow for this. For example, the args
are typically controlled via binfmt rules that the user has no ability
to change. This impacts users who are trying to use podman on aarch64
platforms, to run containers with x86_64 content. There's no arg to
podman that can be used to change the qemu-x86_64 args, and a non-root
user of podman can not change binfmt rules without elevating privileges:

  https://github.com/containers/podman/issues/15456#issuecomment-1228210973

Changing to the 'max' CPU model gives 'qemu-x86_64' maximum
compatibility with binaries it is likely to encounter in the wild,
and not likely to have a significant downside for existing usage.

Most other architectures already use an 'any' CPU model, which is
often mapped to 'max' (or similar) already, rather than the oldest
possible CPU model.

For the sake of consistency the 'i386' architecture is also changed
from using 'qemu32' to 'max'.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220923110413.70593-1-berrange@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 65d4830dac7d88059ba77f1d31ec0c2f8f65ae28
      
https://github.com/qemu/qemu/commit/65d4830dac7d88059ba77f1d31ec0c2f8f65ae28
  Author: Jameson Nash <vtjnash@gmail.com>
  Date:   2022-09-23 (Fri, 23 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix readlinkat handling with magic exe symlink

Exactly the same as f17f4989fa193fa8279474c5462289a3cfe69aea before was
for readlink. I suppose this was simply missed at the time.

Signed-off-by: Jameson Nash <vtjnash@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220808190727.875155-1-vtjnash@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 7b72aa1d81d263c9d84bc02b89ea10892a08b451
      
https://github.com/qemu/qemu/commit/7b72aa1d81d263c9d84bc02b89ea10892a08b451
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Add missing signals in strace output

Some of the guest signal numbers are currently not converted to
their representative names in the strace output, e.g. SIGVTALRM.

This patch introduces a smart way to generate and keep in sync the
host-to-guest and guest-to-host signal conversion tables for usage in
the qemu signal and strace code. This ensures that any signals
will now show up in both tables.

There is no functional change in this patch - with the exception that yet
missing signal names now show up in the strace code too.

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


  Commit: aad43d15422c358ece148e39887fbd0821bca657
      
https://github.com/qemu/qemu/commit/aad43d15422c358ece148e39887fbd0821bca657
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Add missing clock_gettime64() syscall strace

Allow linux-user to strace the clock_gettime64() syscall.
This syscall is used a lot on 32-bit guest architectures which use newer
glibc versions.

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


  Commit: cc054c6f139cf54ce8fbefd6fd536f50b4cba694
      
https://github.com/qemu/qemu/commit/cc054c6f139cf54ce8fbefd6fd536f50b4cba694
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

I noticed those were missing when running the glib2.0 testsuite.
Add the syscalls including the strace output.

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


  Commit: 35dffc568164f08ebdb42bc8eb6307fed9af0ffe
      
https://github.com/qemu/qemu/commit/35dffc568164f08ebdb42bc8eb6307fed9af0ffe
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/cpu_loop-common.h

  Log Message:
  -----------
  linux-user: Log failing executable in EXCP_DUMP()

Enhance the EXCP_DUMP() macro to print out the failing program too.
During debugging it's sometimes hard to track down the actual failing
program if you are e.g. building a whole debian package.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220918194555.83535-5-deller@gmx.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 12640b4fe96fe23dc344b03378dda1eea5b7a191
      
https://github.com/qemu/qemu/commit/12640b4fe96fe23dc344b03378dda1eea5b7a191
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

Enhance the hppa linux-user cpu_loop() to show more debugging info
on hard errors.

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


  Commit: 770525f8eac9a2d048896fd54e4c596af747f238
      
https://github.com/qemu/qemu/commit/770525f8eac9a2d048896fd54e4c596af747f238
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M target/hppa/helper.c

  Log Message:
  -----------
  linux-user/hppa: Dump IIR on register dump

Include the IIR register (which holds the opcode of the failing
instruction) when dumping the hppa registers.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220918194555.83535-7-deller@gmx.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 105d599a33462bd64529bc3bacc68e2d0fbb876b
      
https://github.com/qemu/qemu/commit/105d599a33462bd64529bc3bacc68e2d0fbb876b
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/strace.c

  Log Message:
  -----------
  linux-user: Fix strace of chmod() if mode == 0

If the mode parameter of chmod() is zero, this value isn't shown
when stracing a program:
    chmod("filename",)
This patch fixes it up to show the zero-value as well:
    chmod("filename",000)

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220918194555.83535-8-deller@gmx.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 9c9b5d7b9220d2f52a2df24373c8f35604f444fc
      
https://github.com/qemu/qemu/commit/9c9b5d7b9220d2f52a2df24373c8f35604f444fc
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch

On the parisc architecture the stack grows upwards.
Move the TASK_UNMAPPED_BASE to high memory area as it's done by the
kernel on physical machines.

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


  Commit: 05f3adc982caf4d10128f087775385decc7fb3b3
      
https://github.com/qemu/qemu/commit/05f3adc982caf4d10128f087775385decc7fb3b3
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Add strace for clock_nanosleep()

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


  Commit: 811ee5cfc5da2e0b94eb11192ce2700fcd7063d1
      
https://github.com/qemu/qemu/commit/811ee5cfc5da2e0b94eb11192ce2700fcd7063d1
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/strace.c

  Log Message:
  -----------
  linux-user: Show timespec on strace for futex()

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


  Commit: 9f22020b91ae235be2b27c47d11e842872ec5e85
      
https://github.com/qemu/qemu/commit/9f22020b91ae235be2b27c47d11e842872ec5e85
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    A linux-user/aarch64/target_mman.h
    A linux-user/alpha/target_mman.h
    A linux-user/arm/target_mman.h
    A linux-user/cris/target_mman.h
    A linux-user/generic/target_mman.h
    A linux-user/hexagon/target_mman.h
    A linux-user/hppa/target_mman.h
    A linux-user/i386/target_mman.h
    A linux-user/loongarch64/target_mman.h
    A linux-user/m68k/target_mman.h
    A linux-user/microblaze/target_mman.h
    A linux-user/mips/target_mman.h
    A linux-user/mips64/target_mman.h
    A linux-user/nios2/target_mman.h
    A linux-user/openrisc/target_mman.h
    A linux-user/ppc/target_mman.h
    A linux-user/riscv/target_mman.h
    A linux-user/s390x/target_mman.h
    A linux-user/sh4/target_mman.h
    A linux-user/sparc/target_mman.h
    A linux-user/x86_64/target_mman.h
    A linux-user/xtensa/target_mman.h

  Log Message:
  -----------
  linux-user: Provide MADV_* definitions

Provide MADV_* definitions using target_mman.h header, similar to what
kernel does. Most architectures use the same values, with the exception
of alpha and hppa.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-2-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 8655b4c7099dd198836610bdfb22f09d332b28d3
      
https://github.com/qemu/qemu/commit/8655b4c7099dd198836610bdfb22f09d332b28d3
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Fix madvise(MADV_DONTNEED) on alpha

MADV_DONTNEED has a different value on alpha, compared to all the other
architectures. Fix by using TARGET_MADV_DONTNEED instead of
MADV_DONTNEED.

Fixes: 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-3-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 375ce49be285c5ff73674674350cc99807dfac83
      
https://github.com/qemu/qemu/commit/375ce49be285c5ff73674674350cc99807dfac83
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Implement stracing madvise()

The default implementation has several problems: the first argument is
not displayed as a pointer, making it harder to grep; the third
argument is not symbolized; and there are several extra unused
arguments.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-4-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: f93b76958a358e82bfdd1474598fe75184afeb4d
      
https://github.com/qemu/qemu/commit/f93b76958a358e82bfdd1474598fe75184afeb4d
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M accel/tcg/translate-all.c
    M include/exec/cpu-all.h
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user: Passthrough MADV_DONTNEED for certain file mappings

This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial
support for MADV_DONTNEED"), which added passthrough for anonymous
mappings. File mappings can be handled in a similar manner.

In order to do that, mark pages, for which mmap() was passed through,
with PAGE_PASSTHROUGH, and then allow madvise() passthrough for these
pages. Drop the explicit PAGE_ANON check, since anonymous mappings are
expected to have PAGE_PASSTHROUGH anyway.

Add PAGE_PASSTHROUGH to PAGE_STICKY in order to keep it on mprotect().

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220725125043.43048-1-iii@linux.ibm.com>
Message-Id: <20220906000839.1672934-5-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 38b870cc8c5e9d079649d8769c8f271f28953d24
      
https://github.com/qemu/qemu/commit/38b870cc8c5e9d079649d8769c8f271f28953d24
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    A tests/tcg/multiarch/linux/linux-madvise.c

  Log Message:
  -----------
  tests/tcg/linux-test: Add linux-madvise test

Add a test that checks madvise(MADV_DONTNEED) behavior with anonymous
and file mappings in order to prevent regressions.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220906000839.1672934-6-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: d124853bd73057cd6a60c810413f1a416bd04d34
      
https://github.com/qemu/qemu/commit/d124853bd73057cd6a60c810413f1a416bd04d34
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall_defs.h

  Log Message:
  -----------
  linux-user: Fix TARGET_PROT_SEM for XTENSA

The xtensa platform has a value of 0x10 for PROT_SEM.

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


  Commit: 785783bab1ae879817a26f6757a997ebdc5e89c5
      
https://github.com/qemu/qemu/commit/785783bab1ae879817a26f6757a997ebdc5e89c5
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add proper strace format strings for getdents()/getdents64()

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


  Commit: 47393189ce9e23b560865e361f4ab8fb93a904d0
      
https://github.com/qemu/qemu/commit/47393189ce9e23b560865e361f4ab8fb93a904d0
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/hppa/signal.c
    M linux-user/hppa/target_signal.h

  Log Message:
  -----------
  linux-user/hppa: Add signal trampoline for hppa target

In Linux kernel v5.18 the vDSO for signal trampoline was added.
This code mimiks the bare minimum of this vDSO and thus avoids that the
parisc emulation needs executable stacks.

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


  Commit: f43882052f330ce5f5a1a2553466df5aa0808fa0
      
https://github.com/qemu/qemu/commit/f43882052f330ce5f5a1a2553466df5aa0808fa0
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/hppa: Drop stack guard page on hppa target

The stack-overflow check when building the "grep" debian package fails
on the debian hppa target. Reason is, that the guard page at the top
of the stack (which is added by qemu) prevents the fault handler in the
grep program to properly detect the stack overflow.

The Linux kernel on a physical machine doesn't install a guard page
either, so drop it and as such fix the build of "grep".

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


  Commit: 0a3346b5938530178e20abea5219e80130cf0204
      
https://github.com/qemu/qemu/commit/0a3346b5938530178e20abea5219e80130cf0204
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user/hppa: Increase guest stack size to 80MB for hppa target

The hppa target requires a much bigger stack than many other targets,
and the Linux kernel allocates 80 MB by default for it.

This patch increases the guest stack for hppa to 80MB, and prevents
that this default stack size gets reduced by a lower stack limit on the
host.

Since the stack grows upwards on hppa, the stack_limit value marks the
upper boundary of the stack. Fix the output of /proc/self/maps (in the
guest) to show the [stack] marker on the correct memory area.

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


  Commit: 4c184e70ad01289f89a9a780d154b00d6a86cccd
      
https://github.com/qemu/qemu/commit/4c184e70ad01289f89a9a780d154b00d6a86cccd
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/mmap.c

  Log Message:
  -----------
  linux-user/hppa: Allow PROT_GROWSUP and PROT_GROWSDOWN in mprotect()

The hppa platform uses an upwards-growing stack and required in Linux
kernels < 5.18 an executable stack for signal processing.  For that some
executables and libraries are marked to have an executable stack, for
which glibc uses the mprotect() syscall to mark the stack like this:
 mprotect(xfa000000,4096,PROT_EXEC|PROT_READ|PROT_WRITE|PROT_GROWSUP).

Currently qemu will return -TARGET_EINVAL for this syscall because of the
checks in validate_prot_to_pageflags(), which doesn't allow the
PROT_GROWSUP or PROT_GROWSDOWN flags and thus triggers this error in the
guest:
 error while loading shared libraries: libc.so.6: cannot enable executable 
stack as shared object requires: Invalid argument

Allow mprotect() to handle both flags and thus fix the guest.
The glibc tst-execstack testcase can be used to reproduce the issue.

Signed-off-by: Helge Deller <deller@gmx.de>
Message-Id: <20220924114501.21767-7-deller@gmx.de>
[lvivier: s/elif TARGET_HPPA/elif defined(TARGET_HPPA)/]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 2319a53758efd0a2a1b45d94d3a3b721730cbc00
      
https://github.com/qemu/qemu/commit/2319a53758efd0a2a1b45d94d3a3b721730cbc00
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/hppa/signal.c

  Log Message:
  -----------
  linux-user/hppa: Fix setup_sigcontext()

We don't emulate a preemptive kernel on this level, and the hppa architecture
doesn't allow context switches on the gateway page. So we always have to return
to sc_iaoq[] and not to gr[31].
This fixes the remaining random segfaults which still occured.

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


  Commit: 9b9145f04d303354d8da1112577ece26aaf478dd
      
https://github.com/qemu/qemu/commit/9b9145f04d303354d8da1112577ece26aaf478dd
  Author: fanwenjie <fanwj@mail.ustc.edu.cn>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: fix bug about missing signum convert of sigqueue

Fixes: 66fb9763af ("basic signal handling")
Fixes: cf8b8bfc50 ("linux-user: add support for rt_tgsigqueueinfo() system 
call")
Signed-off-by: fanwenjie <fanwj@mail.ustc.edu.cn>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 9e59899f8c75e3a7b327eb42ef61818d7f06992e
      
https://github.com/qemu/qemu/commit/9e59899f8c75e3a7b327eb42ef61818d7f06992e
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Don't assume 0 is not a valid host timer_t value

For handling guest POSIX timers, we currently use an array
g_posix_timers[], whose entries are a host timer_t value, or 0 for
"this slot is unused".  When the guest calls the timer_create syscall
we look through the array for a slot containing 0, and use that for
the new timer.

This scheme assumes that host timer_t values can never be zero.  This
is unfortunately not a valid assumption -- for some host libc
versions, timer_t values are simply indexes starting at 0.  When
using this kind of host libc, the effect is that the first and second
timers end up sharing a slot, and so when the guest tries to operate
on the first timer it changes the second timer instead.

Rework the timer allocation code, so that:
 * the 'slot in use' indication uses a separate array from the
   host timer_t array
 * we grab the free slot atomically, to avoid races when multiple
   threads call timer_create simultaneously
 * releasing an allocated slot is abstracted out into a new
   free_host_timer_slot() function called in the correct places

This fixes:
 * problems on hosts where timer_t 0 is valid
 * the FIXME in next_free_host_timer() about locking
 * bugs in the error paths in timer_create where we forgot to release
   the slot we grabbed, or forgot to free the host timer

Reported-by: Jon Alduan <jon.alduan@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220725110035.1273441-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 2941e0fa050314cd200f24e3b99da61440b106ab
      
https://github.com/qemu/qemu/commit/2941e0fa050314cd200f24e3b99da61440b106ab
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/s390x/signal.c

  Log Message:
  -----------
  linux-user/s390x: Save/restore fpc when handling a signal

Linux kernel does this in fpregs_store() and fpregs_load(), so
qemu-user should do this as well.

Found by running valgrind's none/tests/s390x/test_sig.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220817123902.585623-1-iii@linux.ibm.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fcdc0ab4b4d09bac65c192726af1c1bcb28de8e4
      
https://github.com/qemu/qemu/commit/fcdc0ab4b4d09bac65c192726af1c1bcb28de8e4
  Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Introduce stubs for ELF AT_BASE_PLATFORM

AT_BASE_PLATFORM is a elf auxiliary vector pointing to a string
to pass some architecture information.
See getauxval(3) man-page.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220803103009.95972-2-jiaxun.yang@flygoat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: fbf47c18aa8687b1c6a929fbcd8bb36dfc386454
      
https://github.com/qemu/qemu/commit/fbf47c18aa8687b1c6a929fbcd8bb36dfc386454
  Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user: Set ELF_BASE_PLATFORM for MIPS

Match most appropriate base platform string based on insn_flags.
Logic is aligned with aligned with set_isa() from
arch/mips/kernel/cpu-probe.c in Linux kernel.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220803103009.95972-3-jiaxun.yang@flygoat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: 0fbc0f8da1ec69991472a42ba601376e3f7c6b2d
      
https://github.com/qemu/qemu/commit/0fbc0f8da1ec69991472a42ba601376e3f7c6b2d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Combine do_futex and do_futex_time64

Pass a boolean to select between time32 and time64.

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


  Commit: 57b9ccd4c03dc5f175c4bd7d7406a15fb4d24aca
      
https://github.com/qemu/qemu/commit/57b9ccd4c03dc5f175c4bd7d7406a15fb4d24aca
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Sink call to do_safe_futex

Leave only the argument adjustments within the shift,
and sink the actual syscall to the end.  Sink the
timespec conversion as well, as there will be more users.

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


  Commit: a6180f8aede726c1648b1ae3a602058c93f859c8
      
https://github.com/qemu/qemu/commit/a6180f8aede726c1648b1ae3a602058c93f859c8
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Implement FUTEX_WAKE_BITSET

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


  Commit: 0f9467311260c23eed758f97c75d83f1815acb29
      
https://github.com/qemu/qemu/commit/0f9467311260c23eed758f97c75d83f1815acb29
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/syscall.c

  Log Message:
  -----------
  linux-user: Convert signal number for FUTEX_FD

The val argument to FUTEX_FD is a signal number.  Convert to match
the host, as it will be converted back when the signal is delivered.

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


  Commit: c72a90df47b990572ac4fdb7e918005466446db9
      
https://github.com/qemu/qemu/commit/c72a90df47b990572ac4fdb7e918005466446db9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

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

  Log Message:
  -----------
  linux-user: Implement PI futexes

Define the missing FUTEX_* constants in syscall_defs.h

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


  Commit: 53b578f31fda28b2cf83ca28d0c7a5159416d32b
      
https://github.com/qemu/qemu/commit/53b578f31fda28b2cf83ca28d0c7a5159416d32b
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/strace.c

  Log Message:
  -----------
  linux-user: Update print_futex_op

Use a table for the names; print unknown values in hex,
since the value contains flags.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220829021006.67305-7-richard.henderson@linaro.org>
[lv: update print_futex() according to
"linux-user: Show timespec on strace for futex()"]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>


  Commit: c5a1c6b88cad2e8c4d81b03dda48d49ea0be9cca
      
https://github.com/qemu/qemu/commit/c5a1c6b88cad2e8c4d81b03dda48d49ea0be9cca
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M linux-user/strace.c

  Log Message:
  -----------
  linux-user: Lock log around strace

Do not allow syscall arguments to be interleaved between threads.

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


  Commit: fb36fb9344c284a58f3f3ec5be6408fc51eaf3f1
      
https://github.com/qemu/qemu/commit/fb36fb9344c284a58f3f3ec5be6408fc51eaf3f1
  Author: Ruili Ji <ruili.ji@amd.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M hw/xen/xen_pt_config_init.c

  Log Message:
  -----------
  hw/xen: set pci Atomic Ops requests for passthrough device

Make guest os access pci device control 2 reg for passthrough device
as struct XenPTRegInfo described in the file hw/xen/xen_pt.h.
/* reg read only field mask (ON:RO/ROS, OFF:other) */
uint32_t ro_mask;
/* reg emulate field mask (ON:emu, OFF:passthrough) */
uint32_t emu_mask;

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1196
Signed-off-by: Aaron Liu <Aaron.Liu@amd.com>
Signed-off-by: Ruili Ji <ruili.ji@amd.com>
Message-ID: 
<BL1PR12MB599341DC55BA53FE588DE14E9B7E9@BL1PR12MB5993.namprd12.prod.outlook.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>


  Commit: 3039fd4b6e9b80ab35b34493181202a22b952812
      
https://github.com/qemu/qemu/commit/3039fd4b6e9b80ab35b34493181202a22b952812
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/i440fx-test.c

  Log Message:
  -----------
  tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable

Previously request_{bios, pflash} cases were skipped on win32, mainly
due to create_blob_file() calling mmap() which does not exist on win32.
This rewirtes create_blob_file() to be portable, so that we can enable
these cases on Windows.

Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-2-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: d9eefd35b678d6c1fa8c523de6441ef722f5321a
      
https://github.com/qemu/qemu/commit/d9eefd35b678d6c1fa8c523de6441ef722f5321a
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/ahci-test.c

  Log Message:
  -----------
  tests/qtest: ahci-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-6-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 39df79e4ed89cd835784ede8563ee41aa1f8265d
      
https://github.com/qemu/qemu/commit/39df79e4ed89cd835784ede8563ee41aa1f8265d
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/aspeed_smc-test.c

  Log Message:
  -----------
  tests/qtest: aspeed_smc-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220925113032.1949844-7-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 4bcea44b9af7981e2074c74298e89ea3f97a3174
      
https://github.com/qemu/qemu/commit/4bcea44b9af7981e2074c74298e89ea3f97a3174
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/boot-serial-test.c

  Log Message:
  -----------
  tests/qtest: boot-serial-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-8-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 39180d4e944caa0a9818f73acc4fadc2fbd2f422
      
https://github.com/qemu/qemu/commit/39180d4e944caa0a9818f73acc4fadc2fbd2f422
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/cxl-test.c

  Log Message:
  -----------
  tests/qtest: cxl-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_dir_make_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-9-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 394bcc5bc5247697f2091ac4b4686e39bfabba37
      
https://github.com/qemu/qemu/commit/394bcc5bc5247697f2091ac4b4686e39bfabba37
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/fdc-test.c

  Log Message:
  -----------
  tests/qtest: fdc-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-10-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 9e5d84037fcff3c5936b1e7776cc2363920ad1f1
      
https://github.com/qemu/qemu/commit/9e5d84037fcff3c5936b1e7776cc2363920ad1f1
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/fuzz/generic_fuzz_configs.h

  Log Message:
  -----------
  tests/qtest: generic_fuzz: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_dir_make_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-11-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 3ff220a0acc1d46d528600af937badf246cb05f3
      
https://github.com/qemu/qemu/commit/3ff220a0acc1d46d528600af937badf246cb05f3
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/fuzz/virtio_blk_fuzz.c

  Log Message:
  -----------
  tests/qtest: virtio_blk_fuzz: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-12-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 354aeeabecebb24cb7765b261f7a8ba084d3ef0e
      
https://github.com/qemu/qemu/commit/354aeeabecebb24cb7765b261f7a8ba084d3ef0e
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/ide-test.c

  Log Message:
  -----------
  tests/qtest: ide-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-14-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c20413558a49326599b15c3854c0df68a0b45895
      
https://github.com/qemu/qemu/commit/c20413558a49326599b15c3854c0df68a0b45895
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/vhost-user-blk-test.c

  Log Message:
  -----------
  tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_get_tmp_dir() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-18-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: bc989a2b870629276fcbb9f5ee380d5c53e145cc
      
https://github.com/qemu/qemu/commit/bc989a2b870629276fcbb9f5ee380d5c53e145cc
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/virtio-blk-test.c

  Log Message:
  -----------
  tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-20-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 28ea545b33f79dfd734d9a842a3a2cc9bf89d5e8
      
https://github.com/qemu/qemu/commit/28ea545b33f79dfd734d9a842a3a2cc9bf89d5e8
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/virtio-scsi-test.c

  Log Message:
  -----------
  tests/qtest: virtio-scsi-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-21-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: b6dabc82b070850711881feaa0d8028ee7c396dc
      
https://github.com/qemu/qemu/commit/b6dabc82b070850711881feaa0d8028ee7c396dc
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/libqtest.c

  Log Message:
  -----------
  tests/qtest: libqtest: Avoid using hardcoded /tmp

The qtest library was written to use hardcoded /tmp directory for
temporary files. Update to use g_get_tmp_dir() and g_dir_make_tmp()
for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-22-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: e0e5b3dc0024f76a27b4643c4158cc5463713d9c
      
https://github.com/qemu/qemu/commit/e0e5b3dc0024f76a27b4643c4158cc5463713d9c
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/unit/test-image-locking.c

  Log Message:
  -----------
  tests/unit: test-image-locking: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-23-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 5b9f2781c251aa0b98cf9a3b025b803a7e23e638
      
https://github.com/qemu/qemu/commit/5b9f2781c251aa0b98cf9a3b025b803a7e23e638
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/unit/test-qga.c

  Log Message:
  -----------
  tests/unit: test-qga: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_get_tmp_dir() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-24-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 786e46ee68d7920d4bead184c42950a4b0e2e75a
      
https://github.com/qemu/qemu/commit/786e46ee68d7920d4bead184c42950a4b0e2e75a
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/vhost-user-bridge.c

  Log Message:
  -----------
  tests: vhost-user-bridge: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-25-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: cac4373aa0953fe4a96268d28a35401cf0747f07
      
https://github.com/qemu/qemu/commit/cac4373aa0953fe4a96268d28a35401cf0747f07
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/virtio-net-test.c

  Log Message:
  -----------
  tests/qtest: Skip running virtio-net-test cases that require socketpair() for 
win32

Some of the virtio-net-test test cases require socketpair() to do the
test setup. Skip them for win32.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-29-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 8bf5bb2e04f33dd869f1221ec949359874b6c604
      
https://github.com/qemu/qemu/commit/8bf5bb2e04f33dd869f1221ec949359874b6c604
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/meson.build

  Log Message:
  -----------
  tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

The test-filter-{mirror,redirector} cases use socketpair() API that
is only available on POSIX and should only be built for POSIX.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-30-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: b82cbbf0f229f0295e917c69b40e6c12365782e8
      
https://github.com/qemu/qemu/commit/b82cbbf0f229f0295e917c69b40e6c12365782e8
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/qmp-test.c

  Log Message:
  -----------
  tests/qtest: qmp-test: Skip running test_qmp_oob for win32

The test_qmp_oob test case calls mkfifo() which does not exist on
win32. Exclude it.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-31-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 39f0e991e10706447cad782e0de48ad9724aadf7
      
https://github.com/qemu/qemu/commit/39f0e991e10706447cad782e0de48ad9724aadf7
  Author: Xuzhou Cheng <xuzhou.cheng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/libqtest-single.h

  Log Message:
  -----------
  tests/qtest: libqtest: Adapt global_qtest declaration for win32

Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that 
require global_qtest")
moved global_qtest to libqtest-single.h, by declaring global_qtest
attribute to be common and weak.

This trick unfortunately does not work on Windows, and building
qtest test cases results in multiple definition errors of the weak
symbol global_qtest, as Windows PE does not have the concept of
the so-called weak symbol like ELF in the *nix world.

However Windows does provide a trick to declare a variable to be
a common symbol, via __declspec(selectany) [1]. It does not provide
the "strong override weak" effect but we don't need it in our use
case anyway. So let's use it for win32.

[1] https://docs.microsoft.com/en-us/cpp/cpp/selectany

Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-33-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 490081b282766df0e91de3903d948f1eed6fe6d2
      
https://github.com/qemu/qemu/commit/490081b282766df0e91de3903d948f1eed6fe6d2
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/libqtest.c
    M tests/qtest/libqtest.h

  Log Message:
  -----------
  tests/qtest: libqtest: Exclude the *_fds APIs for win32

libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any
APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be
excluded for win32 too. This includes the following:

  * qtest_qmp_vsend_fds()
  * qtest_vqmp_fds()
  * qtest_qmp_fds()
  * qtest_qmp_add_client()

Note qtest_qmp_vsend() was wrongly written to call qmp_fd_vsend_fds()
previously, but it should call the non fds version API qmp_fd_vsend().

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-35-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: be181f87eb75d21ad82819e92175a2d6716527e0
      
https://github.com/qemu/qemu/commit/be181f87eb75d21ad82819e92175a2d6716527e0
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/ahci-test.c
    M tests/qtest/ide-test.c

  Log Message:
  -----------
  tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

These test cases uses "blkdebug:path/to/config:path/to/image" for
testing. On Windows, absolute file paths contain the delimiter ':'
which causes the blkdebug filename parser fail to parse filenames.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-38-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 4b83dd0efdbbf0e9213aa8e789ab0700e191ae24
      
https://github.com/qemu/qemu/commit/4b83dd0efdbbf0e9213aa8e789ab0700e191ae24
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/bios-tables-test.c

  Log Message:
  -----------
  tests/qtest: bios-tables-test: Adapt the case for win32

Single quotes in the arguments (oem_id='CRASH ') are not removed in
the Windows environment before it is passed to the QEMU executable.
The space in the argument causes the "-acpitable" option parser to
think that all of its parameters are done, hence it complains:

  '-acpitable' requires one of 'data' or 'file'

Change to use double quotes which works fine on all platforms.

Also /dev/null does not work on win32, and nul should be used.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220925113032.1949844-39-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 4dc8be388320b95ee965e28893381c9193eca663
      
https://github.com/qemu/qemu/commit/4dc8be388320b95ee965e28893381c9193eca663
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  tests/qtest: migration-test: Disable IO redirection for win32

On Windows the QEMU executable is created via CreateProcess() and
IO redirection does not work, so don't bother adding IO redirection
to the command line.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-40-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 6b2906d65ca2e1fc2c71be1ce8992eaa3c5d7eab
      
https://github.com/qemu/qemu/commit/6b2906d65ca2e1fc2c71be1ce8992eaa3c5d7eab
  Author: Xuzhou Cheng <xuzhou.cheng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/ide-test.c

  Log Message:
  -----------
  tests/qtest: ide-test: Open file in binary mode

By default Windows opens file in text mode, while a POSIX compliant
implementation treats text files and binary files the same.

The fopen() 'mode' string can include the letter 'b' to indicate
binary mode shall be used. POSIX spec says the character 'b' shall
have no effect, but is allowed for ISO C standard conformance.
Let's add the letter 'b' which works on both POSIX and Windows.

Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-41-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: a68667066ad0b171a8938fb3f6bf0ad964362593
      
https://github.com/qemu/qemu/commit/a68667066ad0b171a8938fb3f6bf0ad964362593
  Author: Xuzhou Cheng <xuzhou.cheng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/virtio-net-failover.c

  Log Message:
  -----------
  tests/qtest: virtio-net-failover: Disable migration tests for win32

These tests use the exec migration protocol, which is unsupported
on Windows as of today. Disable these tests for now.

Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-42-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: e6f59e4c0b86a82cdaeacbd0ee94183b896523df
      
https://github.com/qemu/qemu/commit/e6f59e4c0b86a82cdaeacbd0ee94183b896523df
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/microbit-test.c

  Log Message:
  -----------
  tests/qtest: microbit-test: Fix socket access for win32

Sockets on Windows do not use *nix-style file descriptors, so
write()/read()/close() do not work on Windows.

Switch over to use send()/recv()/closesocket() which work with
sockets on all platforms.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-45-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 3665fadd468b3fb02371e57d1ab7de60c882038b
      
https://github.com/qemu/qemu/commit/3665fadd468b3fb02371e57d1ab7de60c882038b
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/libqtest.c

  Log Message:
  -----------
  tests/qtest: libqtest: Replace the call to close a socket with closesocket()

close() is a *nix function. It works on any file descriptor, and
sockets in *nix are an example of a file descriptor.

closesocket() is a Windows-specific function, which works only
specifically with sockets. Sockets on Windows do not use *nix-style
file descriptors, and socket() returns a handle to a kernel object
instead, so it must be closed with closesocket().

In QEMU there is already a logic to handle such platform difference
in os-posix.h and os-win32.h, that:

  * closesocket maps to close on POSIX
  * closesocket maps to a wrapper that calls the real closesocket()
    on Windows

Replace the call to close a socket with closesocket() instead.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220925113032.1949844-46-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 2c73437d8de59942bbe6dde0029922744c4c4f81
      
https://github.com/qemu/qemu/commit/2c73437d8de59942bbe6dde0029922744c4c4f81
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/migration-test.c

  Log Message:
  -----------
  tests/qtest: migration-test: Skip running some TLS cases for win32

Some migration test cases use TLS to communicate, but they fail on
Windows with the following error messages:

  qemu-system-x86_64: TLS handshake failed: Insufficient credentials for that 
request.
  qemu-system-x86_64: TLS handshake failed: Error in the pull function.
  query-migrate shows failed migration: TLS handshake failed: Error in the pull 
function.

Disable them temporarily.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220925113032.1949844-51-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 3070eeba8510ce755d6cd75e761126c01f065a24
      
https://github.com/qemu/qemu/commit/3070eeba8510ce755d6cd75e761126c01f065a24
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M .gitlab-ci.d/windows.yml

  Log Message:
  -----------
  .gitlab-ci.d/windows.yml: Display meson test logs

When CI fails we don't know what causes the failure. Displaying the
meson test logs can be helpful.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220925113032.1949844-53-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 9bcc0f7de7a6a04bd184ac4a1dbcbc3ccd53a6c0
      
https://github.com/qemu/qemu/commit/9bcc0f7de7a6a04bd184ac4a1dbcbc3ccd53a6c0
  Author: Michael Labiuk <michael.labiuk@virtuozzo.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/device-plug-test.c

  Log Message:
  -----------
  tests/x86: Move common code to function in device-plug-test

Move common code for device removing to function.

Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com>
Message-Id: <20220920104842.605530-2-michael.labiuk@virtuozzo.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 52ca92d6d7b287e3d1b326168f57fc00ebd47b64
      
https://github.com/qemu/qemu/commit/52ca92d6d7b287e3d1b326168f57fc00ebd47b64
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/hd-geo-test.c

  Log Message:
  -----------
  tests/qtest: hd-geo-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220927110632.1973965-13-bmeng.cn@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 8189b27d3b183e27e3720f4a06b6d950542cba64
      
https://github.com/qemu/qemu/commit/8189b27d3b183e27e3720f4a06b6d950542cba64
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/pflash-cfi02-test.c

  Log Message:
  -----------
  tests/qtest: pflash-cfi02-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_file_open_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220927110632.1973965-16-bmeng.cn@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: c12fea71a0195b71715f4c1b190232bebb2e9cf6
      
https://github.com/qemu/qemu/commit/c12fea71a0195b71715f4c1b190232bebb2e9cf6
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/qmp-test.c

  Log Message:
  -----------
  tests/qtest: qmp-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_dir_make_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220927110632.1973965-17-bmeng.cn@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: e6efe236c1d1f2451d59a7151c50d1c79360857c
      
https://github.com/qemu/qemu/commit/e6efe236c1d1f2451d59a7151c50d1c79360857c
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/vhost-user-test.c

  Log Message:
  -----------
  tests/qtest: vhost-user-test: Avoid using hardcoded /tmp

This case was written to use hardcoded /tmp directory for temporary
files. Update to use g_dir_make_tmp() for a portable implementation.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220927110632.1973965-19-bmeng.cn@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 65a2eff0f53871166dee6767494f0cc6ffbf4a14
      
https://github.com/qemu/qemu/commit/65a2eff0f53871166dee6767494f0cc6ffbf4a14
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M tests/qtest/boot-serial-test.c

  Log Message:
  -----------
  tests/qtest: boot-serial-test: Close the serial file before starting QEMU

This qtest executable created a serial chardev file to be passed to
the QEMU executable. The serial file was created by g_file_open_tmp(),
which internally opens the file with FILE_SHARE_WRITE security attribute
on Windows. Based on [1], there is only one case that allows the first
call to CreateFile() with GENERIC_READ & FILE_SHARE_WRITE, and second
call to CreateFile() with GENERIC_WRITE & FILE_SHARE_READ. All other
combinations require FILE_SHARE_WRITE in the second call. But there is
no way for the second call (in this case the QEMU executable) to know
what combination was passed to the first call, unless FILE_SHARE_WRITE
is passed to the second call.

Two processes shouldn't share the same file for writing with a chardev.
Let's close the serial file before starting QEMU.

[1] 
https://docs.microsoft.com/en-us/windows/win32/fileio/creating-and-opening-files

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Message-Id: <20220927110632.1973965-40-bmeng.cn@gmail.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 0b49bc1b713d6e3896179f9700c8c35e511075f6
      
https://github.com/qemu/qemu/commit/0b49bc1b713d6e3896179f9700c8c35e511075f6
  Author: Bin Meng <bin.meng@windriver.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M docs/devel/testing.rst

  Log Message:
  -----------
  docs/devel: testing: Document writing portable test cases

Update the best practices of how to write portable test cases that
can be built and run successfully on both Linux and Windows hosts.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220927110632.1973965-55-bmeng.cn@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 429c72800654503e0073906f63fdc9a641639bdc
      
https://github.com/qemu/qemu/commit/429c72800654503e0073906f63fdc9a641639bdc
  Author: Kunkun Jiang <jiangkunkun@huawei.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M hw/vfio/migration.c

  Log Message:
  -----------
  vfio/migration: Fix incorrect initialization value for parameters in 
VFIOMigration

The structure VFIOMigration of a VFIODevice is allocated and initialized
in vfio_migration_init(). "device_state" and "vm_running" are initialized
to 0, indicating that VFIO device is_STOP and VM is not-running. The
initialization value is incorrect. According to the agreement, default
state of VFIO device is _RUNNING. And if a VFIO device is hot-plugged
while the VM is running, "vm_running" should be 1. This patch fixes it.

Fixes: 02a7e71b1e5b ("vfio: Add VM state change handler to know state of VM")
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
Link: https://lore.kernel.org/r/20220711014651.1327-1-jiangkunkun@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 85b6d2b5fc25c9c0d10d493b3728183ab8f8e68a
      
https://github.com/qemu/qemu/commit/85b6d2b5fc25c9c0d10d493b3728183ab8f8e68a
  Author: Alex Williamson <alex.williamson@redhat.com>
  Date:   2022-09-27 (Tue, 27 Sep 2022)

  Changed paths:
    M hw/vfio/common.c

  Log Message:
  -----------
  vfio/common: Fix vfio_iommu_type1_info use after free

On error, vfio_get_iommu_info() frees and clears *info, but
vfio_connect_container() continues to use the pointer regardless
of the return value.  Restructure the code such that a failure
of this function triggers an error and clean up the remainder of
the function, including updating an outdated comment that had
drifted from its relevant line of code and using host page size
for a default for better compatibility on non-4KB systems.

Reported-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/all/20220910004245.2878-1-nicolinc@nvidia.com/
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Link: 
https://lore.kernel.org/r/166326219630.3388898.12882473157184946072.stgit@omen
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>


  Commit: 4a877b82f7f99f7366fbb4820687d88dcf97478f
      
https://github.com/qemu/qemu/commit/4a877b82f7f99f7366fbb4820687d88dcf97478f
  Author: Helge Deller <deller@gmx.de>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M linux-user/strace.list

  Log Message:
  -----------
  linux-user: Add parameters of getrandom() syscall for strace

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


  Commit: 1acf19faedef820fd88435cb5b93f0267b6a224c
      
https://github.com/qemu/qemu/commit/1acf19faedef820fd88435cb5b93f0267b6a224c
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M hw/xen/xen_pt_config_init.c

  Log Message:
  -----------
  Merge tag 'pull-xen-20220927' of 
https://xenbits.xen.org/git-http/people/aperard/qemu-dm into staging

Xen patch

- Xen PCI passthrough fix for Atomic Ops requests

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEE+AwAYwjiLP2KkueYDPVXL9f7Va8FAmMy/BUACgkQDPVXL9f7
# Va/EWwf+OYEesPbMD9IWvMAgtbuqK8Q/u+YwX8bviiWsBHdGT/Egut/AKBcdmVo0
# 68erlvsXBlffhT5kw6FtWHPrIMsDA+tos/q4pM7w4IJUsz+RKV/1IYT1pQ92XPP1
# RgxJyMCmVrKadqnDvVE9wAn8NeK3t75Lq5QWhN4cpWDWSSUXta90dlu8QefnrguA
# tTmdgneoDUjBhimpy4LgoWBeBqnAMdN05A0dcGcsTSjptj/GsylwSbbbkGivsaDl
# OH23Lk4I6dBhqGo0bEi/LpuPZ44BsuY6NHUlZixbWZl+PxneePdiEd+6YjEWNAZU
# kx2XEm0hQXYxUZDk+fvHCVZP3Y/b1g==
# =cDzP
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 27 Sep 2022 09:35:17 EDT
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg: Can't check signature: No public key

* tag 'pull-xen-20220927' of 
https://xenbits.xen.org/git-http/people/aperard/qemu-dm:
  hw/xen: set pci Atomic Ops requests for passthrough device

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: dc6c2342a0c1103bf4b2750dd756609d6ab7ecac
      
https://github.com/qemu/qemu/commit/dc6c2342a0c1103bf4b2750dd756609d6ab7ecac
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/migration.c

  Log Message:
  -----------
  Merge tag 'vfio-updates-20220927.1' of 
https://gitlab.com/alex.williamson/qemu into staging

VFIO updates 2022-09-27

 * Fix initial values for migration state (Kunkun Jiang)

 * Fix a use-after-free error path (Alex Williamson)

# -----BEGIN PGP SIGNATURE-----
#
# iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmMzXKwbHGFsZXgud2ls
# bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiOv8QAKJstXXq92FxT+wBXt0Q
# wnMJjE1hvCHXki7FfPSRPmVgoMppWD1vhr7TajeOkidtqnX48V863/RGZfxX+oQU
# bEPPT6QaWnYhagslrRjIj4R+5O5N6rY9A2zzpG2vv1x9qv8r9WLicKvwjzinTgAp
# PyU9Ajgu2OUpD6O64iXIeD2MnfblSN3N+bBvZ7alDifFC1D8CfX9D3X76bdERC6X
# LFEenZ/3ZwZh46z1xv4v3opI2aBp9oh1gca9NKc/jUKg11AuswhmmUSmb+lVDDnt
# UBNTqgHtnGBfAMcxQ1cA6AtRvtwwneJkQC4nkUmOEWuMImUEhTQw7vcTpDFFyHzz
# dcYRjioHu15EmuHeP/W+139fnGeCDpr1/XJcJ2avUp/9oNeRDsAi4w/lEHXHv5Rm
# KHuXSIswC/6+dgvdOwRw2OlbzX5KjSVlqXJia+QexEliCxpcs8OYEJ7ZgRdFCO8t
# unWssLs7x1O40J7cngnyT8addLGwbwExrJggpG70suSQB5mMIJzNIVanUpUkzy2g
# 9kAwW3fTUXqW7O+2RYbjFUoY0yR1eHO8EExiPHyO3hxCDNjglwpM20C4M7fs3Eo6
# /1zwagtjxblsWTPK9dOsq3y4yoXlhX+0EpM9PYPV8OleayTRyhS7O/FzHmqpJNlt
# G524RusuIU+xNwUTEKgFFHgm
# =5YPM
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 27 Sep 2022 16:27:24 EDT
# gpg:                using RSA key 42F6C04E540BD1A99E7B8A90239B9B6E3BB08B22
# gpg:                issuer "alex.williamson@redhat.com"
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
# gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" 
[full]
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* tag 'vfio-updates-20220927.1' of https://gitlab.com/alex.williamson/qemu:
  vfio/common: Fix vfio_iommu_type1_info use after free
  vfio/migration: Fix incorrect initialization value for parameters in 
VFIOMigration

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: 36cd0aeac3337af06875e08683380389df48ccd0
      
https://github.com/qemu/qemu/commit/36cd0aeac3337af06875e08683380389df48ccd0
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M accel/tcg/translate-all.c
    M include/exec/cpu-all.h
    A linux-user/aarch64/target_mman.h
    A linux-user/alpha/target_mman.h
    A linux-user/arm/target_mman.h
    M linux-user/cpu_loop-common.h
    A linux-user/cris/target_mman.h
    M linux-user/elfload.c
    A linux-user/generic/target_mman.h
    A linux-user/hexagon/target_mman.h
    M linux-user/hppa/cpu_loop.c
    M linux-user/hppa/signal.c
    A linux-user/hppa/target_mman.h
    M linux-user/hppa/target_signal.h
    M linux-user/hppa/target_syscall.h
    M linux-user/i386/target_elf.h
    A linux-user/i386/target_mman.h
    A linux-user/loongarch64/target_mman.h
    A linux-user/m68k/target_mman.h
    M linux-user/main.c
    A linux-user/microblaze/target_mman.h
    A linux-user/mips/target_mman.h
    A linux-user/mips64/target_mman.h
    M linux-user/mmap.c
    A linux-user/nios2/target_mman.h
    A linux-user/openrisc/target_mman.h
    A linux-user/ppc/target_mman.h
    A linux-user/riscv/target_mman.h
    M linux-user/s390x/signal.c
    A linux-user/s390x/target_mman.h
    A linux-user/sh4/target_mman.h
    M linux-user/signal-common.h
    M linux-user/signal.c
    A linux-user/sparc/target_mman.h
    M linux-user/strace.c
    M linux-user/strace.list
    M linux-user/syscall.c
    M linux-user/syscall_defs.h
    M linux-user/x86_64/target_elf.h
    A linux-user/x86_64/target_mman.h
    A linux-user/xtensa/target_mman.h
    M target/hppa/helper.c
    A tests/tcg/multiarch/linux/linux-madvise.c

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

linux-user pull request 20220928-v2

use 'max' instead of 'qemu32' / 'qemu64'
add  pidfd_open(), pidfd_send_signal() and pidfd_getfd()
Improve madvise(MADV_DONTNEED)
futex syscal rework
strace improvement
HP/PA fixes and improvement
Misc fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmM0riISHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748gH4P/2wesXJKPMY2zQzP3Rld4iyefoPGG/Yp
# mdq59BbjO2jQMR8GBss/nl9l84cIzzkYRQIogaKsjljtZYm/OO5xRefqrzJY6apD
# eidxv20dAVjuaXHAIdGhbFlxot1ctExbZs9atB4uj5DWxfYGD6e/stoBy5/pSmr4
# M5EbGHhyrRI7tRbHGtVQVvG6AT6XGE0pT9tzT5JLaApF8UPMkgJwmez16PNWvcMm
# v8GEvKm/vEVS8CCpzLV4kfwVeo3f54VAOrEBDi29ph2Yo50IA21k8BvoRZaSp+Kn
# G6TMnnly/DkMspAs5EOVfat+kv3TziNNdDH7EnVU1vV1yTDdZgW/1204Uy/JY0Pw
# WotwAFuO9FYeHKmjY0CfnIIZZHYZpDYUOZ8M6dESD/O0EjoB8LMf5p9cbYlze4DE
# csJZCsVcz19HDv6QZXi5mvvDcJ83B2IDb8/PUAzSc0n62lXL9qjYD0wdb0QsLdAT
# I25qLDge1HCmQfCIKcaoHYvE0pDmvkF6ftuQUXLtIwtaV0Z/N5wDf2PEHikjOYHM
# gD2izz23/2wQx6KP/9ZNnCJ5QEBkEgm5wpHncsvjzSzi1uIdNlHyzJJwGTAcc5qZ
# hOeoJ7dT0D6g0BGnvOdg2W/bDx18KW65mNDxE4d+W0uzn0YmQtArk2YsnhKQNO46
# 12/0ltPFnSV/
# =DIzQ
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 28 Sep 2022 16:27:14 EDT
# 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.2-pull-request' of 
https://gitlab.com/laurent_vivier/qemu: (37 commits)
  linux-user: Add parameters of getrandom() syscall for strace
  linux-user: Lock log around strace
  linux-user: Update print_futex_op
  linux-user: Implement PI futexes
  linux-user: Convert signal number for FUTEX_FD
  linux-user: Implement FUTEX_WAKE_BITSET
  linux-user: Sink call to do_safe_futex
  linux-user: Combine do_futex and do_futex_time64
  linux-user: Set ELF_BASE_PLATFORM for MIPS
  linux-user: Introduce stubs for ELF AT_BASE_PLATFORM
  linux-user/s390x: Save/restore fpc when handling a signal
  linux-user: Don't assume 0 is not a valid host timer_t value
  linux-user: fix bug about missing signum convert of sigqueue
  linux-user/hppa: Fix setup_sigcontext()
  linux-user/hppa: Allow PROT_GROWSUP and PROT_GROWSDOWN in mprotect()
  linux-user/hppa: Increase guest stack size to 80MB for hppa target
  linux-user/hppa: Drop stack guard page on hppa target
  linux-user/hppa: Add signal trampoline for hppa target
  linux-user: Add proper strace format strings for getdents()/getdents64()
  linux-user: Fix TARGET_PROT_SEM for XTENSA
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: c8de6ec63d766ca1998c5af468483ce912fdc0c2
      
https://github.com/qemu/qemu/commit/c8de6ec63d766ca1998c5af468483ce912fdc0c2
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M .gitlab-ci.d/windows.yml
    M docs/devel/testing.rst
    M tests/qtest/ahci-test.c
    M tests/qtest/aspeed_smc-test.c
    M tests/qtest/bios-tables-test.c
    M tests/qtest/boot-serial-test.c
    M tests/qtest/cxl-test.c
    M tests/qtest/device-plug-test.c
    M tests/qtest/fdc-test.c
    M tests/qtest/fuzz/generic_fuzz_configs.h
    M tests/qtest/fuzz/virtio_blk_fuzz.c
    M tests/qtest/hd-geo-test.c
    M tests/qtest/i440fx-test.c
    M tests/qtest/ide-test.c
    M tests/qtest/libqtest-single.h
    M tests/qtest/libqtest.c
    M tests/qtest/libqtest.h
    M tests/qtest/meson.build
    M tests/qtest/microbit-test.c
    M tests/qtest/migration-test.c
    M tests/qtest/pflash-cfi02-test.c
    M tests/qtest/qmp-test.c
    M tests/qtest/vhost-user-blk-test.c
    M tests/qtest/vhost-user-test.c
    M tests/qtest/virtio-blk-test.c
    M tests/qtest/virtio-net-failover.c
    M tests/qtest/virtio-net-test.c
    M tests/qtest/virtio-scsi-test.c
    M tests/unit/test-image-locking.c
    M tests/unit/test-qga.c
    M tests/vhost-user-bridge.c

  Log Message:
  -----------
  Merge tag 'pull-request-2022-09-28' of https://gitlab.com/thuth/qemu into 
staging

* Fixes for qtests and unit tests to be more portable to non-POSIX platforms

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmMz9MQRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVUKRAAnubo/wtHqjxg/yVO68odX2LFI2koligA
# LcEAnhGkVJ/Pe/+Qo9yVbcOY6k6xfGQU3VIipqvLEwPAdSF0E43EJxlImBNm8/Zq
# MggjNoepXRhdFGULONSmSNm7HJykLH/CHdmBjPLrbpkTCwWG1gg64xP9fI+b8mGf
# vST0ADuYloLDA9J45UbC33AD+9dQsy2GeOs8X99O6ysKF3htEqMD3vBdqKiJSwgT
# 2c7UqySGECn6kMHl7iAdipRNUghSgzpUe8LcH4jP7Y1XnoB3zwC/+VrOVwFESI6y
# LVFsC8u7cEKKSYunoowfQTgHvYbCuSdrDqljy17NE5qRMziKMTnhXaQNR5wtBKNt
# HZxvc082P/QDFdBYYY3MIjB27r/I6x0t6Xl4IVwLz7bK0xfHFF8Ba2Lr57/2RTc/
# SMPDxGrMicTPnPDU/Cw5VROMmw0OC/tVpJMGo1VjVnNESo581RAMApyzkWiUyfZj
# ktKd+4ihmqrBXcZHVjKbIufa6eKNuktlkfv72dnJY4XoUlDHlbDYaVuknybZmxWK
# 9/CDVDG72s5Cqm+M47Q56IagVVZwIGrUP0u3j3h/v0rnHZehY8Qzr3SLEfeqmUb6
# nP7MP+ItZFZtMITdvXb3OtyeVuM0ZSw8kt+/evpvC9zB6FjgYl/e5FppsO0HxB/O
# PeeV43Bk270=
# =n+FM
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 28 Sep 2022 03:16:20 EDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-09-28' of https://gitlab.com/thuth/qemu: (37 commits)
  docs/devel: testing: Document writing portable test cases
  tests/qtest: boot-serial-test: Close the serial file before starting QEMU
  tests/qtest: vhost-user-test: Avoid using hardcoded /tmp
  tests/qtest: qmp-test: Avoid using hardcoded /tmp
  tests/qtest: pflash-cfi02-test: Avoid using hardcoded /tmp
  tests/qtest: hd-geo-test: Avoid using hardcoded /tmp
  tests/x86: Move common code to function in device-plug-test
  .gitlab-ci.d/windows.yml: Display meson test logs
  tests/qtest: migration-test: Skip running some TLS cases for win32
  tests/qtest: libqtest: Replace the call to close a socket with closesocket()
  tests/qtest: microbit-test: Fix socket access for win32
  tests/qtest: virtio-net-failover: Disable migration tests for win32
  tests/qtest: ide-test: Open file in binary mode
  tests/qtest: migration-test: Disable IO redirection for win32
  tests/qtest: bios-tables-test: Adapt the case for win32
  tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32
  tests/qtest: libqtest: Exclude the *_fds APIs for win32
  tests/qtest: libqtest: Adapt global_qtest declaration for win32
  tests/qtest: qmp-test: Skip running test_qmp_oob for win32
  tests/qtest: Build test-filter-{mirror, redirector} cases for posix only
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


Compare: https://github.com/qemu/qemu/compare/dbc4f48b5ab3...c8de6ec63d76



reply via email to

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