qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 0337e4: input: Allow to choose console with q


From: Alex Bennée
Subject: [Qemu-commits] [qemu/qemu] 0337e4: input: Allow to choose console with qemu_input_is_...
Date: Wed, 04 Oct 2023 07:10:50 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 0337e4123e62721bd0bcb4d5645fee2a31e8906d
      
https://github.com/qemu/qemu/commit/0337e4123e62721bd0bcb4d5645fee2a31e8906d
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/ui/input.h
    M ui/cocoa.m
    M ui/dbus-console.c
    M ui/gtk.c
    M ui/input.c
    M ui/sdl2.c
    M ui/spice-input.c
    M ui/trace-events
    M ui/vnc.c

  Log Message:
  -----------
  input: Allow to choose console with qemu_input_is_absolute

Although an input is routed depending on the console,
qemu_input_is_absolute() had no mechanism to specify the console.

Accept QemuConsole as an argument for qemu_input_is_absolute, and let
the display know the absolute/relative state for a particular console.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230921082936.28100-1-akihiko.odaki@daynix.com>


  Commit: 845fff1f83ac87f592b5b0fa01c37844ea8cc9f9
      
https://github.com/qemu/qemu/commit/845fff1f83ac87f592b5b0fa01c37844ea8cc9f9
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/ui/console.h
    M ui/console.c

  Log Message:
  -----------
  ui/console: make qemu_console_is_multihead() static

qemu_console_is_multihead() is only called from within "ui/console.c";
make it static.

Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230913144959.41891-2-lersek@redhat.com>


  Commit: 4ce2f97c000629531553328e1871b56312a210cf
      
https://github.com/qemu/qemu/commit/4ce2f97c000629531553328e1871b56312a210cf
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M ui/console.c

  Log Message:
  -----------
  ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead()

qemu_console_is_multihead() declares the console "c" a "multihead" console
if there are two different consoles in the system that (a) both reference
"c->device", and (b) have different "c->head" numbers. In effect, if at
least two consoles exist that are different heads of the same device that
underlies "c".

Commit 58d5870845c6 ("ui/console: move graphic fields to
QemuGraphicConsole", 2023-09-04) pushed the "device" and "head" members
from the QemuConsole base class down to the QemuGraphicConsole subclass,
adjusting the referring QOM properties accordingly as well. As a result,
the "device" property lookup in qemu_console_is_multihead() now crashes,
in case the candidate console being investigated for criterion (a) is not
a QemuGraphicConsole instance:

> Unexpected error in object_property_find_err() at qom/object.c:1314:
> qemu: Property 'qemu-fixed-text-console.device' not found
> Aborted (core dumped)

This is effectively an unchecked downcast. Make it checked: only consider
such console candidates that are themselves QemuGraphicConsole instances.

Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
Fixes: 58d5870845c6
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230913144959.41891-3-lersek@redhat.com>


  Commit: 2c0c4c1f650d48c814df5a8b48544ea44918bd8f
      
https://github.com/qemu/qemu/commit/2c0c4c1f650d48c814df5a8b48544ea44918bd8f
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M ui/console.c

  Log Message:
  -----------
  ui/console: eliminate QOM properties from qemu_console_is_multihead()

According to Marc-André's and Gerd's descriptions, the "device" and
"head" members of QemuGraphicConsole are exposed as QOM properties for two
purposes:

(1) Introspection (e.g., "qom-get" monitor command).

(2) A VNC server can display a specific device + head. This lets us run a
    multihead configuration by using multiple VNC servers (one for each
    head).

    Further, we can link input devices to device + head, so input events
    are routed to different devices dependent on where they are coming
    from. Which is most useful for tablet devices in a VNC multihead
    setup, each head has its own tablet device then. This does requires
    manual guest-side configuration, for establishing the same tablet <->
    head relationship.

However, neither goal seems to justify the complicated QOM property lookup
that's internal to qemu_console_is_multihead().

Rework qemu_console_is_multihead() with plain old C language field
accesses.

Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230913144959.41891-4-lersek@redhat.com>


  Commit: 65d7ceb49b434d578cee61467c009cb16a794b16
      
https://github.com/qemu/qemu/commit/65d7ceb49b434d578cee61467c009cb16a794b16
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M ui/console.c

  Log Message:
  -----------
  ui/console: sanitize search in qemu_graphic_console_is_multihead()

qemu_graphic_console_is_multihead() declares the graphical console "c" a
"multihead" console if there are two different graphical consoles in the
system that (a) both reference "c->device", and (b) have different
"c->head" numbers. In effect, if at least two graphical consoles exist
that are different heads of the same device that underlies "c". In fact,
"c" may be one of these two graphical consoles, or "c" may differ from
both of those consoles (in case "c->device" has at least three heads).

The loop currently uses this awkward "two different consoles" approach
because the function used not to have access to "c", only to "c->device",
which didn't allow for fetching (and comparing) "c->head". But, we've
changed that in the last patch; we now pass all of "c" to
qemu_graphic_console_is_multihead().

Thus, look for the *first* (and possibly *only*) graphical console, if
any, that refers to the same "device" as "c", but by a different "head"
number.

Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> (odd fixer:Graphics)
Cc: Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230913144959.41891-5-lersek@redhat.com>


  Commit: 7db57a73f66463488fbd53fe5f9589de49534fe8
      
https://github.com/qemu/qemu/commit/7db57a73f66463488fbd53fe5f9589de49534fe8
  Author: Ken Xue <Ken.Xue@amd.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/ui/qemu-pixman.h
    M ui/qemu-pixman.c

  Log Message:
  -----------
  ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map

Android uses XBGR8888 and ABGR8888 as default scanout buffer, But qemu
does not support them for qemu_pixman_to_drm_format conversion within
virtio_gpu_create_dmabuf for virtio gpu.

so, add those 2 formats into drm_format_pixman_map.

Signed-off-by: Ken Xue <Ken.Xue@amd.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230914013151.805363-1-Ken.Xue@amd.com>


  Commit: 75b773d84c89220463a14a6883d2b2a8e49e5b68
      
https://github.com/qemu/qemu/commit/75b773d84c89220463a14a6883d2b2a8e49e5b68
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/qemu/compiler.h
    M util/oslib-win32.c

  Log Message:
  -----------
  win32: avoid discarding the exception handler

In all likelihood, the compiler with lto doesn't see the function being
used, from assembly macro __try1. Help it by marking the function has
being used.

Resolves:
https://gitlab.com/qemu-project/qemu/-/issues/1904

Fixes: commit d89f30b4df ("win32: wrap socket close() with an exception 
handler")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>


  Commit: 9bd4d3df633593878ada3dffcfe05318754b4596
      
https://github.com/qemu/qemu/commit/9bd4d3df633593878ada3dffcfe05318754b4596
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M ui/gtk.c

  Log Message:
  -----------
  ui/gtk: fix UI info precondition

dpy_get_ui_info() shouldn't be called if the underlying GPU doesn't
support it.

Before the assert() was added and the regression introduced, GTK code
used to get "zero" UI info, for ex with a simple VGA device. The assert
was added to prevent from calling when there are no console too. The
other display backend that calls dpy_get_ui_info() correctly checks that
pre-condition.

Calling dpy_set_ui_info() is "safe" in this case, it will simply return
an error that can be generally ignored.

Fixes: commit a92e7bb4c ("ui: add precondition for dpy_get_ui_info()")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: f1de309792d6656ef3443ba65272c4a868a43914
      
https://github.com/qemu/qemu/commit/f1de309792d6656ef3443ba65272c4a868a43914
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M scripts/analyze-migration.py

  Log Message:
  -----------
  analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH

Traceback (most recent call last):
  File "scripts/analyze-migration.py", line 605, in <module>
    dump.read(dump_memory = args.memory)
  File "scripts/analyze-migration.py", line 542, in read
    section.read()
  File "scripts/analyze-migration.py", line 214, in read
    raise Exception("Unknown RAM flags: %x" % flags)
Exception: Unknown RAM flags: 200

See commit 77c259a4cb ("multifd: Create property 
multifd-flush-after-each-section")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>


  Commit: 314e0a84cd5d3a8d04c9778eecb5618dee3574cf
      
https://github.com/qemu/qemu/commit/314e0a84cd5d3a8d04c9778eecb5618dee3574cf
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M hw/core/machine.c

  Log Message:
  -----------
  hw/core: remove needless includes

The include list is large, make it smaller.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>


  Commit: bf7e5215c40c9c38067798fdced94623f2ee0201
      
https://github.com/qemu/qemu/commit/bf7e5215c40c9c38067798fdced94623f2ee0201
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  hw/pc: remove needless includes

The include list is gigantic, make it smaller.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>


  Commit: e0288a778473ebd35eac6cc1924faca7d477d241
      
https://github.com/qemu/qemu/commit/e0288a778473ebd35eac6cc1924faca7d477d241
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M hw/display/ramfb.c

  Log Message:
  -----------
  hw/display/ramfb: plug slight guest-triggerable leak on mode setting

The fw_cfg DMA write callback in ramfb prepares a new display surface in
QEMU; this new surface is put to use ("swapped in") upon the next display
update. At that time, the old surface (if any) is released.

If the guest triggers the fw_cfg DMA write callback at least twice between
two adjacent display updates, then the second callback (and further such
callbacks) will leak the previously prepared (but not yet swapped in)
display surface.

The issue can be shown by:

(1) starting QEMU with "-trace displaysurface_free", and

(2) running the following program in the guest UEFI shell:

> #include <Library/ShellCEntryLib.h>           // ShellAppMain()
> #include <Library/UefiBootServicesTableLib.h> // gBS
> #include <Protocol/GraphicsOutput.h>          // EFI_GRAPHICS_OUTPUT_PROTOCOL
>
> INTN
> EFIAPI
> ShellAppMain (
>   IN UINTN   Argc,
>   IN CHAR16  **Argv
>   )
> {
>   EFI_STATUS                    Status;
>   VOID                          *Interface;
>   EFI_GRAPHICS_OUTPUT_PROTOCOL  *Gop;
>   UINT32                        Mode;
>
>   Status = gBS->LocateProtocol (
>                   &gEfiGraphicsOutputProtocolGuid,
>                   NULL,
>                   &Interface
>                   );
>   if (EFI_ERROR (Status)) {
>     return 1;
>   }
>
>   Gop = Interface;
>
>   Mode = 1;
>   for ( ; ;) {
>     Status = Gop->SetMode (Gop, Mode);
>     if (EFI_ERROR (Status)) {
>       break;
>     }
>
>     Mode = 1 - Mode;
>   }
>
>   return 1;
> }

The symptom is then that:

- only one trace message appears periodically,

- the time between adjacent messages keeps increasing -- implying that
  some list structure (containing the leaked resources) keeps growing,

- the "surface" pointer is ever different.

> 18566@1695127471.449586:displaysurface_free surface=0x7f2fcc09a7c0
> 18566@1695127471.529559:displaysurface_free surface=0x7f2fcc9dac10
> 18566@1695127471.659812:displaysurface_free surface=0x7f2fcc441dd0
> 18566@1695127471.839669:displaysurface_free surface=0x7f2fcc0363d0
> 18566@1695127472.069674:displaysurface_free surface=0x7f2fcc413a80
> 18566@1695127472.349580:displaysurface_free surface=0x7f2fcc09cd00
> 18566@1695127472.679783:displaysurface_free surface=0x7f2fcc1395f0
> 18566@1695127473.059848:displaysurface_free surface=0x7f2fcc1cae50
> 18566@1695127473.489724:displaysurface_free surface=0x7f2fcc42fc50
> 18566@1695127473.969791:displaysurface_free surface=0x7f2fcc45dcc0
> 18566@1695127474.499708:displaysurface_free surface=0x7f2fcc70b9d0
> 18566@1695127475.079769:displaysurface_free surface=0x7f2fcc82acc0
> 18566@1695127475.709941:displaysurface_free surface=0x7f2fcc369c00
> 18566@1695127476.389619:displaysurface_free surface=0x7f2fcc32b910
> 18566@1695127477.119772:displaysurface_free surface=0x7f2fcc0d5a20
> 18566@1695127477.899517:displaysurface_free surface=0x7f2fcc086c40
> 18566@1695127478.729962:displaysurface_free surface=0x7f2fccc72020
> 18566@1695127479.609839:displaysurface_free surface=0x7f2fcc185160
> 18566@1695127480.539688:displaysurface_free surface=0x7f2fcc23a7e0
> 18566@1695127481.519759:displaysurface_free surface=0x7f2fcc3ec870
> 18566@1695127482.549930:displaysurface_free surface=0x7f2fcc634960
> 18566@1695127483.629661:displaysurface_free surface=0x7f2fcc26b140
> 18566@1695127484.759987:displaysurface_free surface=0x7f2fcc321700
> 18566@1695127485.940289:displaysurface_free surface=0x7f2fccaad100

We figured this wasn't a CVE-worthy problem, as only small amounts of
memory were leaked (the framebuffer itself is mapped from guest RAM, QEMU
only allocates administrative structures), plus libvirt restricts QEMU
memory footprint anyway, thus the guest can only DoS itself.

Plug the leak, by releasing the last prepared (not yet swapped in) display
surface, if any, in the fw_cfg DMA write callback.

Regarding the "reproducer", with the fix in place, the log is flooded with
trace messages (one per fw_cfg write), *and* the trace message alternates
between just two "surface" pointer values (i.e., nothing is leaked, the
allocator flip-flops between two objects in effect).

This issue appears to date back to the introducion of ramfb (995b30179bdc,
"hw/display: add ramfb, a simple boot framebuffer living in guest ram",
2018-06-18).

Cc: Gerd Hoffmann <kraxel@redhat.com> (maintainer:ramfb)
Cc: qemu-stable@nongnu.org
Fixes: 995b30179bdc
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20230919131955.27223-1-lersek@redhat.com>


  Commit: 4f7689f0817a717d18cc8aca298990760f27a89b
      
https://github.com/qemu/qemu/commit/4f7689f0817a717d18cc8aca298990760f27a89b
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M chardev/char-pty.c

  Log Message:
  -----------
  chardev/char-pty: Avoid losing bytes when the other side just (re-)connected

When starting a guest via libvirt with "virsh start --console ...",
the first second of the console output is missing. This is especially
annoying on s390x that only has a text console by default and no graphical
output - if the bios fails to boot here, the information about what went
wrong is completely lost.

One part of the problem (there is also some things to be done on the
libvirt side) is that QEMU only checks with a 1 second timer whether
the other side of the pty is already connected, so the first second of
the console output is always lost.

This likely used to work better in the past, since the code once checked
for a re-connection during write, but this has been removed in commit
f8278c7d74 ("char-pty: remove the check for connection on write") to avoid
some locking.

To ease the situation here at least a little bit, let's check with g_poll()
whether we could send out the data anyway, even if the connection has not
been marked as "connected" yet. The file descriptor is marked as non-blocking
anyway since commit fac6688a18 ("Do not hang on full PTY"), so this should
not cause any trouble if the other side is not ready for receiving yet.

With this patch applied, I can now successfully see the bios output of
a s390x guest when running it with "virsh start --console" (with a patched
version of virsh that fixes the remaining issues there, too).

Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230816210743.1319018-1-thuth@redhat.com>


  Commit: e5dc722ca9f8b02da21e0fd7852a44b65a5686c6
      
https://github.com/qemu/qemu/commit/e5dc722ca9f8b02da21e0fd7852a44b65a5686c6
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/accel-common.c
    M cpu.c
    M include/qemu/accel.h
    M target/i386/kvm/kvm-cpu.c

  Log Message:
  -----------
  accel: Rename accel_cpu_realizefn() -> accel_cpu_realize()

We use the '*fn' suffix for handlers, this is a public method.
Drop the suffix.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20231003123026.99229-2-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6294e502a95e64f75d63bd95c5a24aa4d7f00196
      
https://github.com/qemu/qemu/commit/6294e502a95e64f75d63bd95c5a24aa4d7f00196
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/accel-common.c
    M include/hw/core/accel-cpu.h
    M target/i386/hvf/hvf-cpu.c
    M target/i386/kvm/kvm-cpu.c
    M target/i386/tcg/tcg-cpu.c

  Log Message:
  -----------
  accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize()

The AccelCPUClass::cpu_realizefn handler is meant for target
specific code, rename it using '_target_' to emphasis it.

Suggested-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20231003123026.99229-3-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: bd684b2f3f57dd390ba715fce1597eb7ad97ee8d
      
https://github.com/qemu/qemu/commit/bd684b2f3f57dd390ba715fce1597eb7ad97ee8d
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/accel-common.c
    M cpu.c
    M include/qemu/accel.h
    M target/i386/kvm/kvm-cpu.c

  Log Message:
  -----------
  accel: Rename accel_cpu_realize() -> accel_cpu_common_realize()

accel_cpu_realize() is a generic function working with CPUs
from any target. Rename it using '_common_' to emphasis it is
not target specific.

Suggested-by: Claudio Fontana <cfontana@suse.de>

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20231003123026.99229-4-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 1aa1d8308d46c5ee3b8558f9f916f5da2492a60a
      
https://github.com/qemu/qemu/commit/1aa1d8308d46c5ee3b8558f9f916f5da2492a60a
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/accel-common.c
    M cpu.c
    M include/qemu/accel.h

  Log Message:
  -----------
  accel: Introduce accel_cpu_common_unrealize() stub

Prepare the stub for parity with accel_cpu_common_realize().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20231003123026.99229-5-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 59851868a2fb632dbf080feda814137fd60242db
      
https://github.com/qemu/qemu/commit/59851868a2fb632dbf080feda814137fd60242db
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/accel-common.c
    M include/qemu/accel.h

  Log Message:
  -----------
  accel: Declare AccelClass::cpu_common_[un]realize() handlers

Currently accel_cpu_realize() only performs target-specific
realization. Introduce the cpu_common_[un]realize fields in
the base AccelClass to be able to perform target-agnostic
[un]realization of vCPUs.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20231003123026.99229-6-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: fa312f2eaf50d7abb84dcc0d9b5d15f1ddf6f66b
      
https://github.com/qemu/qemu/commit/fa312f2eaf50d7abb84dcc0d9b5d15f1ddf6f66b
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cpu-exec.c
    M include/exec/cpu-all.h

  Log Message:
  -----------
  accel/tcg: Have tcg_exec_realizefn() return a boolean

Following the example documented since commit e3fe3988d7 ("error:
Document Error API usage rules"), have tcg_exec_realizefn() return
a boolean indicating whether an error is set or not.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20231003123026.99229-7-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 23af78b070ebfc0bfa8f114796a2eb9b5ed31e92
      
https://github.com/qemu/qemu/commit/23af78b070ebfc0bfa8f114796a2eb9b5ed31e92
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/internal.h
    M accel/tcg/tcg-all.c
    M cpu.c
    M include/exec/cpu-all.h

  Log Message:
  -----------
  accel/tcg: Restrict tcg_exec_[un]realizefn() to TCG

We don't need to expose these TCG-specific methods to the
whole code base. Register them as AccelClass handlers, they
will be called by the generic accel_cpu_[un]realize() methods.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20231003123026.99229-8-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a81fef4b6440046e21e3531329e1e21f58645c76
      
https://github.com/qemu/qemu/commit/a81fef4b6440046e21e3531329e1e21f58645c76
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-defs.h
    M target/arm/cpu-param.h
    M target/arm/ptw.c
    M target/arm/tcg/mte_helper.c
    M target/arm/tcg/sve_helper.c
    M target/arm/tcg/tlb_helper.c
    M target/arm/tcg/translate-a64.c

  Log Message:
  -----------
  target/arm: Replace TARGET_PAGE_ENTRY_EXTRA

TARGET_PAGE_ENTRY_EXTRA is a macro that allows guests to specify additional
fields for caching with the full TLB entry.  This macro is replaced with
a union in CPUTLBEntryFull, thus making CPUTLB target-agnostic at the
cost of slightly inflated CPUTLBEntryFull for non-arm guests.

Note, this is needed to ensure that fields in CPUTLB don't vary in
offset between various targets.

(arm is the only guest actually making use of this feature.)

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-2-anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M include/exec/cpu-defs.h
    M include/hw/core/cpu.h

  Log Message:
  -----------
  accel/tcg: Move CPUTLB definitions from cpu-defs.h

Accept that we will consume space in CPUState for CONFIG_USER_ONLY,
since we cannot test CONFIG_SOFTMMU within hw/core/cpu.h.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M qom/object.c

  Log Message:
  -----------
  qom: Propagate alignment through type system

Propagate alignment just like size.  This is required in order to
get the correct alignment on most cpu subclasses where the size and
alignment is only specified for the base cpu type.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 61cd357698231386f482f4257fc9fc1d66c750d8
      
https://github.com/qemu/qemu/commit/61cd357698231386f482f4257fc9fc1d66c750d8
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M target/arm/cpu.c
    M target/arm/cpu64.c

  Log Message:
  -----------
  target/arm: Remove size and alignment for cpu subclasses

Inherit the size and alignment from TYPE_ARM_CPU.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M target/alpha/cpu.c
    M target/avr/cpu.c
    M target/cris/cpu.c
    M target/hexagon/cpu.c
    M target/hppa/cpu.c
    M target/i386/cpu.c
    M target/loongarch/cpu.c
    M target/m68k/cpu.c
    M target/microblaze/cpu.c
    M target/mips/cpu.c
    M target/nios2/cpu.c
    M target/openrisc/cpu.c
    M target/riscv/cpu.c
    M target/rx/cpu.c
    M target/sh4/cpu.c
    M target/sparc/cpu.c
    M target/tricore/cpu.c
    M target/xtensa/cpu.c

  Log Message:
  -----------
  target/*: Add instance_align to all cpu base classes

The omission of alignment has technically been wrong since
269bd5d8f61, where QEMU_ALIGNED was added to CPUTLBDescFast.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 5d30bdcb1b72ec1d44397ee7047417617066d97a
      
https://github.com/qemu/qemu/commit/5d30bdcb1b72ec1d44397ee7047417617066d97a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-all.h

  Log Message:
  -----------
  accel/tcg: Validate placement of CPUNegativeOffsetState

Verify that the distance between CPUNegativeOffsetState and
CPUArchState is no greater than any alignment requirements.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 3b3d7df545ff30762b169147398dbf90c42eb452
      
https://github.com/qemu/qemu/commit/3b3d7df545ff30762b169147398dbf90c42eb452
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/translate-all.c
    M accel/tcg/translator.c
    M include/exec/cpu-all.h
    M include/hw/core/cpu.h
    M target/alpha/cpu.h
    M target/arm/cpu.h
    M target/avr/cpu.h
    M target/cris/cpu.h
    M target/hexagon/cpu.h
    M target/hppa/cpu.h
    M target/i386/cpu.h
    M target/loongarch/cpu.h
    M target/m68k/cpu.h
    M target/microblaze/cpu.h
    M target/mips/cpu.h
    M target/nios2/cpu.h
    M target/openrisc/cpu.h
    M target/ppc/cpu.h
    M target/riscv/cpu.h
    M target/rx/cpu.h
    M target/s390x/cpu.h
    M target/sh4/cpu.h
    M target/sparc/cpu.h
    M target/tricore/cpu.h
    M target/xtensa/cpu.h

  Log Message:
  -----------
  accel/tcg: Move CPUNegativeOffsetState into CPUState

Retain the separate structure to emphasize its importance.
Enforce CPUArchState always follows CPUState without padding.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M hw/core/cpu-common.c
    M include/exec/cpu-all.h
    M include/hw/core/cpu.h

  Log Message:
  -----------
  accel/tcg: Remove CPUState.icount_decr_ptr

We can now access icount_decr directly.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 464dacf6090d859a919596ba7452498c7446ced1
      
https://github.com/qemu/qemu/commit/464dacf6090d859a919596ba7452498c7446ced1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/dummy-cpus.c
    M accel/hvf/hvf-accel-ops.c
    M accel/kvm/kvm-accel-ops.c
    M accel/tcg/cpu-exec-common.c
    M accel/tcg/cpu-exec.c
    M accel/tcg/cputlb.c
    M accel/tcg/tcg-accel-ops-icount.c
    M accel/tcg/tcg-accel-ops-mttcg.c
    M accel/tcg/tcg-accel-ops-rr.c
    M accel/tcg/translator.c
    M hw/core/cpu-common.c
    M include/hw/core/cpu.h
    M softmmu/icount.c
    M softmmu/watchpoint.c

  Log Message:
  -----------
  accel/tcg: Move can_do_io to CPUNegativeOffsetState

Minimize the displacement to can_do_io, since it may
be touched at the start of each TranslationBlock.
It fits into other padding within the substructure.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/tcg-accel-ops-icount.c
    M accel/tcg/tcg-accel-ops.c
    M accel/tcg/translate-all.c
    M include/exec/cpu-all.h
    M include/exec/exec-all.h
    M softmmu/icount.c

  Log Message:
  -----------
  accel/tcg: Remove cpu_neg()

Now that CPUNegativeOffsetState is part of CPUState,
we can reference it directly.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M accel/tcg/plugin-gen.c
    M accel/tcg/translator.c
    M include/tcg/tcg.h
    M target/alpha/translate.c
    M target/arm/tcg/translate-a32.h
    M target/arm/tcg/translate-a64.c
    M target/arm/tcg/translate-a64.h
    M target/arm/tcg/translate-m-nocp.c
    M target/arm/tcg/translate-mve.c
    M target/arm/tcg/translate-neon.c
    M target/arm/tcg/translate-sme.c
    M target/arm/tcg/translate-sve.c
    M target/arm/tcg/translate-vfp.c
    M target/arm/tcg/translate.c
    M target/arm/tcg/translate.h
    M target/avr/translate.c
    M target/cris/translate.c
    M target/cris/translate_v10.c.inc
    M target/hexagon/README
    M target/hexagon/gen_tcg.h
    M target/hexagon/gen_tcg_funcs.py
    M target/hexagon/gen_tcg_hvx.h
    M target/hexagon/genptr.c
    M target/hexagon/idef-parser/parser-helpers.c
    M target/hexagon/macros.h
    M target/hexagon/translate.c
    M target/hppa/translate.c
    M target/i386/tcg/decode-new.c.inc
    M target/i386/tcg/emit.c.inc
    M target/i386/tcg/translate.c
    M target/loongarch/insn_trans/trans_atomic.c.inc
    M target/loongarch/insn_trans/trans_branch.c.inc
    M target/loongarch/insn_trans/trans_extra.c.inc
    M target/loongarch/insn_trans/trans_farith.c.inc
    M target/loongarch/insn_trans/trans_fcmp.c.inc
    M target/loongarch/insn_trans/trans_fmemory.c.inc
    M target/loongarch/insn_trans/trans_fmov.c.inc
    M target/loongarch/insn_trans/trans_memory.c.inc
    M target/loongarch/insn_trans/trans_privileged.c.inc
    M target/loongarch/insn_trans/trans_vec.c.inc
    M target/loongarch/translate.c
    M target/m68k/translate.c
    M target/microblaze/translate.c
    M target/mips/tcg/lcsr_translate.c
    M target/mips/tcg/micromips_translate.c.inc
    M target/mips/tcg/msa_translate.c
    M target/mips/tcg/mxu_translate.c
    M target/mips/tcg/nanomips_translate.c.inc
    M target/mips/tcg/translate.c
    M target/mips/tcg/translate.h
    M target/mips/tcg/vr54xx_translate.c
    M target/nios2/translate.c
    M target/openrisc/translate.c
    M target/ppc/power8-pmu-regs.c.inc
    M target/ppc/translate.c
    M target/ppc/translate/branch-impl.c.inc
    M target/ppc/translate/dfp-impl.c.inc
    M target/ppc/translate/fixedpoint-impl.c.inc
    M target/ppc/translate/fp-impl.c.inc
    M target/ppc/translate/processor-ctrl-impl.c.inc
    M target/ppc/translate/spe-impl.c.inc
    M target/ppc/translate/storage-ctrl-impl.c.inc
    M target/ppc/translate/vmx-impl.c.inc
    M target/ppc/translate/vsx-impl.c.inc
    M target/riscv/insn_trans/trans_privileged.c.inc
    M target/riscv/insn_trans/trans_rvbf16.c.inc
    M target/riscv/insn_trans/trans_rvd.c.inc
    M target/riscv/insn_trans/trans_rvf.c.inc
    M target/riscv/insn_trans/trans_rvh.c.inc
    M target/riscv/insn_trans/trans_rvi.c.inc
    M target/riscv/insn_trans/trans_rvm.c.inc
    M target/riscv/insn_trans/trans_rvv.c.inc
    M target/riscv/insn_trans/trans_rvvk.c.inc
    M target/riscv/insn_trans/trans_rvzce.c.inc
    M target/riscv/insn_trans/trans_rvzfa.c.inc
    M target/riscv/insn_trans/trans_rvzfh.c.inc
    M target/riscv/insn_trans/trans_rvzicbo.c.inc
    M target/riscv/insn_trans/trans_svinval.c.inc
    M target/riscv/insn_trans/trans_xthead.c.inc
    M target/riscv/translate.c
    M target/rx/translate.c
    M target/s390x/tcg/translate.c
    M target/s390x/tcg/translate_vx.c.inc
    M target/sh4/translate.c
    M target/sparc/translate.c
    M target/tricore/translate.c
    M target/xtensa/translate.c
    M tcg/tcg-op-gvec.c
    M tcg/tcg-op-ldst.c
    M tcg/tcg-op.c
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Rename cpu_env to tcg_env

Allow the name 'cpu_env' to be used for something else.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

  Changed paths:
    M accel/tcg/cpu-exec.c
    M accel/tcg/cputlb.c
    M accel/tcg/plugin-gen.c
    M accel/tcg/translate-all.c
    M bsd-user/main.c
    M bsd-user/signal.c
    M gdbstub/gdbstub.c
    M gdbstub/user-target.c
    M hw/i386/kvm/clock.c
    M hw/intc/mips_gic.c
    M hw/intc/riscv_aclint.c
    M hw/intc/riscv_imsic.c
    M hw/ppc/e500.c
    M hw/ppc/spapr.c
    M include/exec/cpu-all.h
    M include/hw/core/cpu.h
    M linux-user/elfload.c
    M linux-user/i386/cpu_loop.c
    M linux-user/main.c
    M linux-user/signal.c
    M monitor/hmp-cmds-target.c
    M semihosting/arm-compat-semi.c
    M semihosting/syscalls.c
    M target/alpha/translate.c
    M target/arm/common-semi-target.h
    M target/arm/cpu.c
    M target/arm/helper.c
    M target/arm/tcg/translate-a64.c
    M target/arm/tcg/translate.c
    M target/avr/translate.c
    M target/cris/translate.c
    M target/hexagon/translate.c
    M target/hppa/mem_helper.c
    M target/hppa/translate.c
    M target/i386/nvmm/nvmm-all.c
    M target/i386/tcg/decode-new.c.inc
    M target/i386/tcg/sysemu/excp_helper.c
    M target/i386/tcg/tcg-cpu.c
    M target/i386/tcg/translate.c
    M target/i386/whpx/whpx-all.c
    M target/loongarch/translate.c
    M target/m68k/translate.c
    M target/microblaze/translate.c
    M target/mips/tcg/sysemu/mips-semi.c
    M target/mips/tcg/translate.c
    M target/nios2/translate.c
    M target/openrisc/translate.c
    M target/ppc/excp_helper.c
    M target/ppc/translate.c
    M target/riscv/translate.c
    M target/rx/cpu.c
    M target/rx/translate.c
    M target/s390x/tcg/translate.c
    M target/sh4/op_helper.c
    M target/sh4/translate.c
    M target/sparc/translate.c
    M target/tricore/translate.c
    M target/xtensa/translate.c

  Log Message:
  -----------
  accel/tcg: Replace CPUState.env_ptr with cpu_env()

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 60835831a2c047ab527226fa4920bfcccde05a9f
      
https://github.com/qemu/qemu/commit/60835831a2c047ab527226fa4920bfcccde05a9f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-all.h
    M target/alpha/cpu.c
    M target/arm/cpu.c
    M target/avr/cpu.c
    M target/cris/cpu.c
    M target/hexagon/cpu.c
    M target/hppa/cpu.c
    M target/i386/cpu.c
    M target/loongarch/cpu.c
    M target/m68k/cpu.c
    M target/microblaze/cpu.c
    M target/mips/cpu.c
    M target/nios2/cpu.c
    M target/openrisc/cpu.c
    M target/ppc/cpu_init.c
    M target/riscv/cpu.c
    M target/rx/cpu.c
    M target/s390x/cpu.c
    M target/sh4/cpu.c
    M target/sparc/cpu.c
    M target/tricore/cpu.c
    M target/xtensa/cpu.c

  Log Message:
  -----------
  accel/tcg: Remove cpu_set_cpustate_pointers

This function is now empty, so remove it.  In the case of
m68k and tricore, this empties the class instance initfn,
so remove those as well.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 2709e69431ec78ddeb08aab2fe38e4f66608967d
      
https://github.com/qemu/qemu/commit/2709e69431ec78ddeb08aab2fe38e4f66608967d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-all.h

  Log Message:
  -----------
  accel/tcg: Remove env_neg()

Replace the single use within env_tlb() and remove.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 59e9243e758ca81f53228f4f1d104a95b9783919
      
https://github.com/qemu/qemu/commit/59e9243e758ca81f53228f4f1d104a95b9783919
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/translate-all.c
    M include/tcg/tcg.h
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Remove TCGContext.tlb_fast_offset

Now that there is no padding between CPUNegativeOffsetState
and CPUArchState, this value is constant across all targets.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 5c449dce9f8aac2a4d10681a7439fff7443a78fa
      
https://github.com/qemu/qemu/commit/5c449dce9f8aac2a4d10681a7439fff7443a78fa
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c
    M include/exec/cpu_ldst.h

  Log Message:
  -----------
  accel/tcg: Modify tlb_*() to use CPUState

Changes tlb_*() functions to take CPUState instead of CPUArchState, as
they don't require the full CPUArchState. This makes it easier to
decouple target-(in)dependent code.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-4-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[rth: Use cpu->neg.tlb instead of cpu_tlb()]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 8e901b9b4d116bb3c94694b409d3f8801b7460c7
      
https://github.com/qemu/qemu/commit/8e901b9b4d116bb3c94694b409d3f8801b7460c7
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c

  Log Message:
  -----------
  accel/tcg: Modify probe_access_internal() to use CPUState

probe_access_internal() is changed to instead take the generic CPUState
over CPUArchState, in order to lessen the target-specific coupling of
cputlb.c. Note: probe_access*() also don't need the full CPUArchState,
but aren't touched in this patch as they are target-facing.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-5-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[rth: Use cpu->neg.tlb instead of cpu_tlb()]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: c455ed7b8675c670c48d3be637d3ead158123267
      
https://github.com/qemu/qemu/commit/c455ed7b8675c670c48d3be637d3ead158123267
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c

  Log Message:
  -----------
  accel/tcg: Modify memory access functions to use CPUState

do_[ld|st]*() and mmu_lookup*() are changed to use CPUState over
CPUArchState, moving the target-dependence to the target-facing facing
cpu_[ld|st] functions.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-6-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[rth: Use cpu->neg.tlb instead of cpu_tlb; cpu_env instead of env_ptr.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: e5d028bb0ea84e72f35be124f459e1865d4ec95a
      
https://github.com/qemu/qemu/commit/e5d028bb0ea84e72f35be124f459e1865d4ec95a
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/atomic_template.h
    M accel/tcg/cputlb.c
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Modify atomic_mmu_lookup() to use CPUState

The goal is to (in the future) allow for per-target compilation of
functions in atomic_template.h whilst atomic_mmu_lookup() and cputlb.c
are compiled once-per user- or system mode.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-7-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[rth: Use cpu->neg.tlb instead of cpu_tlb()]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 72275516cee35dfba9c6418cae57777901d1e491
      
https://github.com/qemu/qemu/commit/72275516cee35dfba9c6418cae57777901d1e491
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c
    M accel/tcg/ldst_atomicity.c.inc
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Use CPUState in atomicity helpers

Makes ldst_atomicity.c.inc almost target-independent, with the exception
of TARGET_PAGE_MASK, which will be addressed in a future patch.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-8-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: b780fcd42569eb2c74ef0ae5a1123f4ebf81334b
      
https://github.com/qemu/qemu/commit/b780fcd42569eb2c74ef0ae5a1123f4ebf81334b
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-all.h
    M tcg/aarch64/tcg-target.c.inc
    M tcg/arm/tcg-target.c.inc

  Log Message:
  -----------
  accel/tcg: Remove env_tlb()

The function is no longer used to access the TLB,
and has been replaced by cpu->neg.tlb.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-9-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[rth: Merge comment update patch]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: d49b463c1f7fa3cfa6172cc871d2572967b5a4ea
      
https://github.com/qemu/qemu/commit/d49b463c1f7fa3cfa6172cc871d2572967b5a4ea
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Unify user and softmmu do_[st|ld]*_mmu()

The prototype of do_[st|ld]*_mmu() is unified between system- and
user-mode allowing a large chunk of helper_[st|ld]*() and cpu_[st|ld]*()
functions to be expressed in same manner between both modes. These
functions will be moved to ldst_common.c.inc in a following commit.

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-11-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: ffc1780a2d8b47dcceff02a3c33d99687f9f54b4
      
https://github.com/qemu/qemu/commit/ffc1780a2d8b47dcceff02a3c33d99687f9f54b4
  Author: Anton Johansson <anjo@rev.ng>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cputlb.c
    M accel/tcg/ldst_common.c.inc
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: move ld/st helpers to ldst_common.c.inc

A large chunk of ld/st functions are moved from cputlb.c and user-exec.c
to ldst_common.c.inc as their implementation is the same between both
modes.

Eventually, ldst_common.c.inc could be compiled into a separate
target-specific compilation unit, and be linked in with the targets.
Keeping CPUArchState usage out of cputlb.c (CPUArchState is primarily
used to access the mmu index in these functions).

Signed-off-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230912153428.17816-12-anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 406022ecb0d8641b6e938394dc6a9b9832cf07e7
      
https://github.com/qemu/qemu/commit/406022ecb0d8641b6e938394dc6a9b9832cf07e7
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-all.h
    M include/exec/cpu-common.h

  Log Message:
  -----------
  exec: Make EXCP_FOO definitions target agnostic

The EXCP_* definitions don't need to be target specific,
move them to "exec/cpu-common.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-2-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 676f56800729e4b882d2a8e8eeb14385efd3f23c
      
https://github.com/qemu/qemu/commit/676f56800729e4b882d2a8e8eeb14385efd3f23c
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M include/exec/cpu-common.h
    M include/exec/exec-all.h

  Log Message:
  -----------
  exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'

While these functions are not TCG specific, they are not target
specific. Move them to "exec/cpu-common.h" so their callers don't
have to be tainted as target specific.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-3-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 9b0f5adf584be4eb81681b9c8eb52668b95c53b9
      
https://github.com/qemu/qemu/commit/9b0f5adf584be4eb81681b9c8eb52668b95c53b9
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/internal.h
    M include/exec/cpu-all.h

  Log Message:
  -----------
  accel/tcg: Restrict dump_exec_info() declaration

In commit 00c9a5c2c3 ("accel/tcg: Restrict 'qapi-commands-machine.h'
to system emulation") we moved the definition to accel/tcg/ which is
where this function is called. No need to expose it outside.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-4-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6b0741c4e3ea46e51c389af966c034a3f6f24b30
      
https://github.com/qemu/qemu/commit/6b0741c4e3ea46e51c389af966c034a3f6f24b30
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/meson.build

  Log Message:
  -----------
  accel: Make accel-blocker.o target agnostic

accel-blocker.c is not target specific, move it to system_ss[].

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-5-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 9d8ded67a2cd4f0a3375db78b13552b1ec4ab32a
      
https://github.com/qemu/qemu/commit/9d8ded67a2cd4f0a3375db78b13552b1ec4ab32a
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    R accel/accel-common.c
    A accel/accel-target.c
    M accel/meson.build

  Log Message:
  -----------
  accel: Rename accel-common.c -> accel-target.c

We use the '-common.c' suffix for target agnostic units.
This file is target specific, rename it using the '-target'
suffix.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-6-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: ca61854ac8d6e1ebf7446bdd99d839968040a073
      
https://github.com/qemu/qemu/commit/ca61854ac8d6e1ebf7446bdd99d839968040a073
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M MAINTAINERS
    A cpu-common.c
    A cpu-target.c
    R cpu.c
    R cpus-common.c
    M meson.build

  Log Message:
  -----------
  exec: Rename cpu.c -> cpu-target.c

We have exec/cpu code split in 2 files for target agnostic
("common") and specific. Rename 'cpu.c' which is target
specific using the '-target' suffix. Update MAINTAINERS.
Remove the 's from 'cpus-common.c' to match the API cpu_foo()
functions.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-7-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6bdd03b15db33c9eec19dbe5cf4614ce64b163a5
      
https://github.com/qemu/qemu/commit/6bdd03b15db33c9eec19dbe5cf4614ce64b163a5
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M MAINTAINERS
    M meson.build
    A page-vary-target.c
    R page-vary.c

  Log Message:
  -----------
  exec: Rename target specific page-vary.c -> page-vary-target.c

This matches the target agnostic 'page-vary-common.c' counterpart.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-8-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: de4be67dc5cb1c1222f1df95cb62891fdb85b332
      
https://github.com/qemu/qemu/commit/de4be67dc5cb1c1222f1df95cb62891fdb85b332
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cpu-exec-common.c
    M accel/tcg/cpu-exec.c
    M accel/tcg/cputlb.c
    A accel/tcg/internal-target.h
    R accel/tcg/internal.h
    M accel/tcg/monitor.c
    M accel/tcg/tb-maint.c
    M accel/tcg/tcg-all.c
    M accel/tcg/translate-all.c
    M accel/tcg/translator.c
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'

accel/tcg/internal.h contains target specific declarations.
Unit files including it become "target tainted": they can not
be compiled as target agnostic. Rename using the '-target'
suffix to make this explicit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-9-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 1956cd7a0023db65d9d60a953da3fc161528bfba
      
https://github.com/qemu/qemu/commit/1956cd7a0023db65d9d60a953da3fc161528bfba
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cpu-exec.c
    A accel/tcg/internal-common.h
    M accel/tcg/internal-target.h
    M accel/tcg/meson.build
    M accel/tcg/monitor.c
    M accel/tcg/translate-all.c

  Log Message:
  -----------
  accel/tcg: Make monitor.c a target-agnostic unit

Move target-agnostic declarations from "internal-target.h"
to a new "internal-common.h" header.
monitor.c now don't include target specific headers and can
be compiled once in system_ss[].

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-10-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: e6ecd21a0dd5b6770608d525d249793158750c30
      
https://github.com/qemu/qemu/commit/e6ecd21a0dd5b6770608d525d249793158750c30
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M MAINTAINERS
    A accel/tcg/icount-common.c
    M accel/tcg/meson.build
    R softmmu/icount.c
    M softmmu/meson.build

  Log Message:
  -----------
  accel/tcg: Make icount.o a target agnostic unit

Remove the unused "exec/exec-all.h" header. There is
no more target specific code in it: make it target
agnostic (rename using the '-common' suffix). Since
it is TCG specific, move it to accel/tcg, updating
MAINTAINERS.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-11-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 510859bf7fbb9280750876719cd736bc8406708f
      
https://github.com/qemu/qemu/commit/510859bf7fbb9280750876719cd736bc8406708f
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/cpu-exec-common.c
    M accel/tcg/cputlb.c
    M accel/tcg/internal-common.h
    M accel/tcg/internal-target.h
    M accel/tcg/meson.build
    M accel/tcg/tb-maint.c
    M accel/tcg/user-exec.c

  Log Message:
  -----------
  accel/tcg: Make cpu-exec-common.c a target agnostic unit

cpu_in_serial_context() is not target specific,
move it declaration to "internal-common.h" (which
we include in the 4 source files modified).

Remove the unused "exec/exec-all.h" header from
cpu-exec-common.c.  There is no more target specific
code in this file: make it target agnostic.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-12-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 2507dabb9e7477f494e592ac90d2553d31998ddd
      
https://github.com/qemu/qemu/commit/2507dabb9e7477f494e592ac90d2553d31998ddd
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/tcg-all.c
    M bsd-user/main.c
    M include/tcg/tcg.h
    M linux-user/main.c
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Remove argument to tcg_prologue_init

We can load tcg_ctx just as easily within the callee.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 6703c4f4a28bedfa51d2a80b72b862aec68f49e6
      
https://github.com/qemu/qemu/commit/6703c4f4a28bedfa51d2a80b72b862aec68f49e6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M accel/tcg/tcg-accel-ops-mttcg.c
    M accel/tcg/tcg-accel-ops-rr.c
    M accel/tcg/tcg-all.c
    M bsd-user/main.c
    A include/tcg/startup.h
    M include/tcg/tcg.h
    M linux-user/main.c
    M linux-user/syscall.c
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Split out tcg init functions to tcg/startup.h

The tcg/tcg.h header is a big bucket, containing stuff related to
the translators and the JIT backend.  The places that initialize
tcg or create new threads do not need all of that, so split out
these three functions to a new header.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


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

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

  Log Message:
  -----------
  linux-user/hppa: Fix struct target_sigcontext layout

Use abi_ullong not uint64_t so that the alignment of the field
and therefore the layout of the struct is correct.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 149e6215982db872d8805d02339abd5464d50ffc
      
https://github.com/qemu/qemu/commit/149e6215982db872d8805d02339abd5464d50ffc
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/signal.c
    M docs/about/deprecated.rst
    M linux-user/exit.c
    M linux-user/signal.c
    M meson.build
    M meson_options.txt
    M scripts/meson-buildoptions.sh
    M tests/qemu-iotests/meson.build

  Log Message:
  -----------
  build: Remove --enable-gprof

This build option has been deprecated since 8.0.
Remove all CONFIG_GPROF code that depends on that,
including one errant check using TARGET_GPROF.

Acked-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 9844e022a73c3896a4550947b1f117e462e5bd4f
      
https://github.com/qemu/qemu/commit/9844e022a73c3896a4550947b1f117e462e5bd4f
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M tests/avocado/boot_linux_console.py
    M tests/avocado/machine_mips_malta.py
    M tests/avocado/replay_kernel.py
    M tests/avocado/tuxrun_baselines.py

  Log Message:
  -----------
  tests/avocado: Re-enable MIPS Malta tests (GitLab issue #1884 fixed)

Commit 18a536f1f8 ("accel/tcg: Always require can_do_io") fixed
the GitLab issue #1884: we can now re-enable those tests.

This reverts commit f959c3d87ccfa585b105de6964a6261e368cc1da.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20231003063808.66564-1-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 971537eca2e6c7aaf185bbf10d4cbd84cf9d8a38
      
https://github.com/qemu/qemu/commit/971537eca2e6c7aaf185bbf10d4cbd84cf9d8a38
  Author: gaosong <gaosong@loongson.cn>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M tcg/loongarch64/tcg-target.c.inc

  Log Message:
  -----------
  tcg/loongarch64: Fix buid error

Fix:

  In file included from ../tcg/tcg.c:735:
  /home1/gaosong/bugfix/qemu/tcg/loongarch64/tcg-target.c.inc: In function 
‘tcg_out_vec_op’:
  /home1/gaosong/bugfix/qemu/tcg/loongarch64/tcg-target.c.inc:1855:9: error: a 
label can only be part of a statement and a declaration is not a statement
           TCGCond cond = args[3];
           ^~~~~~~

Signed-off-by: gaosong <gaosong@loongson.cn>
Message-Id: <20230926075819.3602537-1-gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 5783a530166c0881df6fe680e095e28d962fc198
      
https://github.com/qemu/qemu/commit/5783a530166c0881df6fe680e095e28d962fc198
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: define TARGET_RFSPAWN for rfork to use vfork(2) semantics, and fix 
RLIM_INFINITY

RLIM_INFINITY on FreeBSD, OpenBSD and NetBSD has value of ~(1<<63), caculated
one way or another.

Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-2-kariem.taha2.7@gmail.com>


  Commit: d314ae93f1724fa2f5e9636aa6483acf9fa7505f
      
https://github.com/qemu/qemu/commit/d314ae93f1724fa2f5e9636aa6483acf9fa7505f
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: Define procctl(2) related structs

Implement procctl flags and related structs:
struct target_procctl_reaper_status
struct target_procctl_reaper_pidinfo
struct target_procctl_reaper_pids
struct target_procctl_reaper_kill

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-3-kariem.taha2.7@gmail.com>


  Commit: 3f254cf203e7bebc3758058802f834d9ba6ca3dc
      
https://github.com/qemu/qemu/commit/3f254cf203e7bebc3758058802f834d9ba6ca3dc
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

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

  Log Message:
  -----------
  bsd-user: Implement host_to_target_siginfo.

Used in wait6 system call

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-4-kariem.taha2.7@gmail.com>


  Commit: cc47390ce7553b29bc8fb12f171836ce5dbf61f5
      
https://github.com/qemu/qemu/commit/cc47390ce7553b29bc8fb12f171836ce5dbf61f5
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Add freebsd_exec_common and do_freebsd_procctl to qemu.h.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-5-kariem.taha2.7@gmail.com>


  Commit: 00bff01fc09c5e3aed4d35842ebc3dbc36a56ee9
      
https://github.com/qemu/qemu/commit/00bff01fc09c5e3aed4d35842ebc3dbc36a56ee9
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/qemu-bsd.h

  Log Message:
  -----------
  bsd-user: add extern declarations for bsd-proc.c conversion functions

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-6-kariem.taha2.7@gmail.com>


  Commit: 0caa37687882569163ed5984d554938fb327ea3c
      
https://github.com/qemu/qemu/commit/0caa37687882569163ed5984d554938fb327ea3c
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/bsd-proc.c
    M bsd-user/bsd-proc.h
    M bsd-user/meson.build

  Log Message:
  -----------
  bsd-user: Implement target_to_host_resource conversion function

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-7-kariem.taha2.7@gmail.com>


  Commit: 550fc7018993d4c21092d6882e4846fc3151d3ed
      
https://github.com/qemu/qemu/commit/550fc7018993d4c21092d6882e4846fc3151d3ed
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.c

  Log Message:
  -----------
  bsd-user: Implement target_to_host_rlim and host_to_target_rlim conversion.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-8-kariem.taha2.7@gmail.com>


  Commit: 66c51d63d408fe4130d3fb63524d7a009e1e01a6
      
https://github.com/qemu/qemu/commit/66c51d63d408fe4130d3fb63524d7a009e1e01a6
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.c

  Log Message:
  -----------
  bsd-user: Implement host_to_target_rusage and host_to_target_wrusage.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-9-kariem.taha2.7@gmail.com>


  Commit: 3f44e273ff530ae9885b64791779ced571233d1d
      
https://github.com/qemu/qemu/commit/3f44e273ff530ae9885b64791779ced571233d1d
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.c

  Log Message:
  -----------
  bsd-user: Implement host_to_target_waitstatus conversion.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-10-kariem.taha2.7@gmail.com>


  Commit: b623031ca60b23dbb8a573306495e7d99821a9af
      
https://github.com/qemu/qemu/commit/b623031ca60b23dbb8a573306495e7d99821a9af
  Author: Kyle Evans <kevans@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.c
    M bsd-user/bsd-proc.h

  Log Message:
  -----------
  bsd-user: Get number of cpus.

Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-11-kariem.taha2.7@gmail.com>


  Commit: a478416dc89f9eaceb8d6550efd8417a965153a2
      
https://github.com/qemu/qemu/commit/a478416dc89f9eaceb8d6550efd8417a965153a2
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement getgroups(2) and setgroups(2) system calls.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-12-kariem.taha2.7@gmail.com>


  Commit: 82fe5f3a3454fe19cfff1b52430ef783da10719a
      
https://github.com/qemu/qemu/commit/82fe5f3a3454fe19cfff1b52430ef783da10719a
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement umask(2), setlogin(2) and getlogin(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-13-kariem.taha2.7@gmail.com>


  Commit: 59e801efdfce31b62d09793d35e85d3bdad0230c
      
https://github.com/qemu/qemu/commit/59e801efdfce31b62d09793d35e85d3bdad0230c
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement getrusage(2).

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-14-kariem.taha2.7@gmail.com>


  Commit: faba8e123f41902edf762bb12054f096713a5338
      
https://github.com/qemu/qemu/commit/faba8e123f41902edf762bb12054f096713a5338
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement getrlimit(2) and setrlimit(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-15-kariem.taha2.7@gmail.com>


  Commit: e4446e0a2c8b4f32d53694a85ebdedc06cb69499
      
https://github.com/qemu/qemu/commit/e4446e0a2c8b4f32d53694a85ebdedc06cb69499
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement several get/set system calls:

getpid(2), getppid(2), getpgrp(2)
setreuid(2), setregid(2)
getuid(2), geteuid(2), getgid(2), getegid(2), getpgid(2)
setuid(2), seteuid(2), setgid(2), setegid(2), setpgid(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-16-kariem.taha2.7@gmail.com>


  Commit: 932683c3d421a2057e15cd7f87ad781c3d65fc95
      
https://github.com/qemu/qemu/commit/932683c3d421a2057e15cd7f87ad781c3d65fc95
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement get/set[resuid/resgid/sid] and issetugid.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-17-kariem.taha2.7@gmail.com>


  Commit: 615ad41c614bf0f2011bba43116434b66e40abc0
      
https://github.com/qemu/qemu/commit/615ad41c614bf0f2011bba43116434b66e40abc0
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Add stubs for profil(2), ktrace(2), utrace(2) and ptrace(2).

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-18-kariem.taha2.7@gmail.com>


  Commit: ff26637260d059f5b37d32f00d7881a8c21a06f9
      
https://github.com/qemu/qemu/commit/ff26637260d059f5b37d32f00d7881a8c21a06f9
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement getpriority(2) and setpriority(2).

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-19-kariem.taha2.7@gmail.com>


  Commit: 84d41c5e6dc69be9b3e0fb8ad5f1ff2007e0e8a1
      
https://github.com/qemu/qemu/commit/84d41c5e6dc69be9b3e0fb8ad5f1ff2007e0e8a1
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/meson.build
    A bsd-user/freebsd/os-proc.c

  Log Message:
  -----------
  bsd-user: Implement get_filename_from_fd.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-20-kariem.taha2.7@gmail.com>


  Commit: 8632729060bf840560215c91c8611bd6769deff9
      
https://github.com/qemu/qemu/commit/8632729060bf840560215c91c8611bd6769deff9
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.c
    M bsd-user/main.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Implement freebsd_exec_common, used in implementing execve/fexecve.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-21-kariem.taha2.7@gmail.com>


  Commit: dcaa3dfda379157a1e5148e112a77aa7e1d79c58
      
https://github.com/qemu/qemu/commit/dcaa3dfda379157a1e5148e112a77aa7e1d79c58
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.c
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement procctl(2) along with necessary conversion functions.

Implement t2h_procctl_cmd, h2t_reaper_status, h2t_reaper_pidinfo and h2t/t2h 
reaper_kill conversion functions.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-22-kariem.taha2.7@gmail.com>


  Commit: 36999e6a6bb1e3c7d7d40c751b67d5886f023ee9
      
https://github.com/qemu/qemu/commit/36999e6a6bb1e3c7d7d40c751b67d5886f023ee9
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement execve(2) and fexecve(2) system calls.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-23-kariem.taha2.7@gmail.com>


  Commit: ae502887cb3e3aa38bc0837cd7580f7a6768a649
      
https://github.com/qemu/qemu/commit/ae502887cb3e3aa38bc0837cd7580f7a6768a649
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement wait4(2) and wait6(2) system calls.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-24-kariem.taha2.7@gmail.com>


  Commit: 159e5b0c4bb00ade2d53e6c482ecda59f69fbdde
      
https://github.com/qemu/qemu/commit/159e5b0c4bb00ade2d53e6c482ecda59f69fbdde
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement setloginclass(2) and getloginclass(2) system calls.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-25-kariem.taha2.7@gmail.com>


  Commit: 0571e3f5e20e4a93b0d59c948bcd89b60033d0be
      
https://github.com/qemu/qemu/commit/0571e3f5e20e4a93b0d59c948bcd89b60033d0be
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement pdgetpid(2) and the undocumented setugid.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-26-kariem.taha2.7@gmail.com>


  Commit: 831a5a7fcbb3bfc36e8e7ed511817e8390344f87
      
https://github.com/qemu/qemu/commit/831a5a7fcbb3bfc36e8e7ed511817e8390344f87
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement fork(2) and vfork(2) system calls.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-27-kariem.taha2.7@gmail.com>


  Commit: 510eecbc86e1aa93c17e9e0a3acced366b0258e1
      
https://github.com/qemu/qemu/commit/510eecbc86e1aa93c17e9e0a3acced366b0258e1
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement rfork(2) system call.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-28-kariem.taha2.7@gmail.com>


  Commit: 6756ae283ac7fe43b8bbc1d8662dfe238f667032
      
https://github.com/qemu/qemu/commit/6756ae283ac7fe43b8bbc1d8662dfe238f667032
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement pdfork(2) system call.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182425.3163-29-kariem.taha2.7@gmail.com>


  Commit: 61a8f1100759a320940e8c53eaaefb37a4c603fb
      
https://github.com/qemu/qemu/commit/61a8f1100759a320940e8c53eaaefb37a4c603fb
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: Implement struct target_ipc_perm

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-2-kariem.taha2.7@gmail.com>


  Commit: 695cb9137f6c1b1bf940d303b2f26a46241056b8
      
https://github.com/qemu/qemu/commit/695cb9137f6c1b1bf940d303b2f26a46241056b8
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: Implement struct target_shmid_ds

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-3-kariem.taha2.7@gmail.com>


  Commit: 1d4c4026b15045e45de5c6f64e4b6322274680e7
      
https://github.com/qemu/qemu/commit/1d4c4026b15045e45de5c6f64e4b6322274680e7
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/qemu-bsd.h

  Log Message:
  -----------
  bsd-user: Declarations for ipc_perm and shmid_ds conversion functions

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-4-kariem.taha2.7@gmail.com>


  Commit: 137d963cfb1c9f0d9e76a40229df2996809b746b
      
https://github.com/qemu/qemu/commit/137d963cfb1c9f0d9e76a40229df2996809b746b
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/freebsd/os-misc.h

  Log Message:
  -----------
  bsd-user: Introduce freebsd/os-misc.h to the source tree

To preserve the copyright notice and help with the 'Author' info for
subsequent changes to the file.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-5-kariem.taha2.7@gmail.com>


  Commit: 0c3529888a427cefe248227423f7a89c8f665fab
      
https://github.com/qemu/qemu/commit/0c3529888a427cefe248227423f7a89c8f665fab
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-misc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement shm_open2(2) system call

Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-6-kariem.taha2.7@gmail.com>


  Commit: 182ea728e06a09e6ceaa9d62a279e883459d36dd
      
https://github.com/qemu/qemu/commit/182ea728e06a09e6ceaa9d62a279e883459d36dd
  Author: Kyle Evans <kevans@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/freebsd/os-misc.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement shm_rename(2) system call

Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-7-kariem.taha2.7@gmail.com>


  Commit: dde5f40dc38d61e80a91c482d9faf45eacdceed8
      
https://github.com/qemu/qemu/commit/dde5f40dc38d61e80a91c482d9faf45eacdceed8
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/bsd-mem.c
    M bsd-user/meson.build

  Log Message:
  -----------
  bsd-user: Add bsd-mem.c to meson.build

Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-8-kariem.taha2.7@gmail.com>


  Commit: c9cdf0a5ecfd16176e48a8cec6fc4a22d9d7b229
      
https://github.com/qemu/qemu/commit/c9cdf0a5ecfd16176e48a8cec6fc4a22d9d7b229
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.c
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement target_set_brk function in bsd-mem.c instead of 
os-syscall.c

The definitions and variables names matches the corresponding ones in
linux-user/syscall.c, for making later implementation of do_obreak easier

Co-authored-by: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Mikaël Urankar <mikael.urankar@gmail.com>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-9-kariem.taha2.7@gmail.com>


  Commit: 86fbb4436bd09c5006c1f07d4cb007b2e91b595a
      
https://github.com/qemu/qemu/commit/86fbb4436bd09c5006c1f07d4cb007b2e91b595a
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.c

  Log Message:
  -----------
  bsd-user: Implement ipc_perm conversion between host and target.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-10-kariem.taha2.7@gmail.com>


  Commit: bd2b73182f5a793c1b226a2846c847faaa7b3e9d
      
https://github.com/qemu/qemu/commit/bd2b73182f5a793c1b226a2846c847faaa7b3e9d
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.c

  Log Message:
  -----------
  bsd-user: Implement shmid_ds conversion between host and target.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-11-kariem.taha2.7@gmail.com>


  Commit: 6765e988e12825e9464a10b6451aeb25b29bfbc3
      
https://github.com/qemu/qemu/commit/6765e988e12825e9464a10b6451aeb25b29bfbc3
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    A bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Introduce bsd-mem.h to the source tree

Preserve the copyright notice and help with the 'Author' info for
subsequent changes to the file.

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-12-kariem.taha2.7@gmail.com>


  Commit: 87dcb4ad485424dcbfedbc7a298279e8738f1a40
      
https://github.com/qemu/qemu/commit/87dcb4ad485424dcbfedbc7a298279e8738f1a40
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement mmap(2) and munmap(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-13-kariem.taha2.7@gmail.com>


  Commit: ecbe22494d970b7811a1764d2f98e083b02f73d0
      
https://github.com/qemu/qemu/commit/ecbe22494d970b7811a1764d2f98e083b02f73d0
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement mprotect(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230925182709.4834-14-kariem.taha2.7@gmail.com>


  Commit: f28a1e4bab4cfdd067bde3d958529575aa8e8f6b
      
https://github.com/qemu/qemu/commit/f28a1e4bab4cfdd067bde3d958529575aa8e8f6b
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement msync(2)

Co-authored-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-15-kariem.taha2.7@gmail.com>


  Commit: 0a49ef02a643864a9c6a36ebaf452e0d30c96b0b
      
https://github.com/qemu/qemu/commit/0a49ef02a643864a9c6a36ebaf452e0d30c96b0b
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), 
minherit(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-16-kariem.taha2.7@gmail.com>


  Commit: 0c1ced42c84bdd8beeef6c40dff8d143cf409f15
      
https://github.com/qemu/qemu/commit/0c1ced42c84bdd8beeef6c40dff8d143cf409f15
  Author: Karim Taha <kariem.taha2.7@gmail.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  bsd-user: Implment madvise(2) to match the linux-user implementation.

Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-17-kariem.taha2.7@gmail.com>


  Commit: 83b045ad4e0106836963185ed696991883104359
      
https://github.com/qemu/qemu/commit/83b045ad4e0106836963185ed696991883104359
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement mincore(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-18-kariem.taha2.7@gmail.com>


  Commit: a99d74034754b1d8735d814cf17db6bf0eb4bfd1
      
https://github.com/qemu/qemu/commit/a99d74034754b1d8735d814cf17db6bf0eb4bfd1
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement do_obreak function

Match linux-user, by manually applying the following commits, in order:

d28b3c90cfad1a7e211ae2bce36ecb9071086129   linux-user: Make sure initial brk(0) 
is page-aligned
15ad98536ad9410fb32ddf1ff09389b677643faa   linux-user: Fix qemu brk() to not 
zero bytes on current page
dfe49864afb06e7e452a4366051697bc4fcfc1a5   linux-user: Prohibit brk() to to 
shrink below initial heap address
eac78a4b0b7da4de2c0a297f4d528ca9cc6256a3   linux-user: Fix signed math overflow 
in brk() syscall
c6cc059eca18d9f6e4e26bb8b6d1135ddb35d81a   linux-user: Do not call get_errno() 
in do_brk()
e69e032d1a8ee8d754ca119009a3c2c997f8bb30   linux-user: Use MAP_FIXED_NOREPLACE 
for do_brk()
cb9d5d1fda0bc2312fc0c779b4ea1d7bf826f31f   linux-user: Do nothing if too small 
brk is specified
2aea137a425a87b930a33590177b04368fd7cc12   linux-user: Do not align brk with 
host page size

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-19-kariem.taha2.7@gmail.com>


  Commit: 4f0be683e399e7685608b83240da099ea45d84e6
      
https://github.com/qemu/qemu/commit/4f0be683e399e7685608b83240da099ea45d84e6
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement shm_open(2)

Co-authored-by: Kyle Evans <kevans@FreeBSD.org>

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-20-kariem.taha2.7@gmail.com>


  Commit: 9d14db15b121c81a008098c46053d98cd6a0da6b
      
https://github.com/qemu/qemu/commit/9d14db15b121c81a008098c46053d98cd6a0da6b
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement shm_unlink(2) and shmget(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-21-kariem.taha2.7@gmail.com>


  Commit: f9bbe3cf28ae7157724a364da6f4a7231f2fdfb3
      
https://github.com/qemu/qemu/commit/f9bbe3cf28ae7157724a364da6f4a7231f2fdfb3
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Implement shmctl(2)

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-22-kariem.taha2.7@gmail.com>


  Commit: 4e00b7d85d0dcc2064c68168163d3a411e32798f
      
https://github.com/qemu/qemu/commit/4e00b7d85d0dcc2064c68168163d3a411e32798f
  Author: Stacey Son <sson@FreeBSD.org>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c
    M bsd-user/mmap.c
    M bsd-user/qemu.h

  Log Message:
  -----------
  bsd-user: Implement shmat(2) and shmdt(2)

Use `WITH_MMAP_LOCK_GUARD` instead of mmap_lock() and mmap_unlock(),
to match linux-user implementation, according to the following commits:

69fa2708a216df715ba5102a0f98468b540a464e linux-user: Use WITH_MMAP_LOCK_GUARD 
in target_{shmat,shmdt}
ceda5688b650646248f269a992c06b11148c5759 linux-user: Fix shmdt

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Message-Id: <20230925182709.4834-23-kariem.taha2.7@gmail.com>


  Commit: dfa1d915756b2d9d22946cbd7d2587f30cdcb7a3
      
https://github.com/qemu/qemu/commit/dfa1d915756b2d9d22946cbd7d2587f30cdcb7a3
  Author: Warner Losh <imp@bsdimp.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M bsd-user/bsd-mem.h
    M bsd-user/freebsd/os-syscall.c

  Log Message:
  -----------
  bsd-user: Add stubs for vadvise(), sbrk() and sstk()

The above system calls are not supported by qemu.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-24-kariem.taha2.7@gmail.com>


  Commit: 4565917bb034479a29c04f0b44124e7f61585ccf
      
https://github.com/qemu/qemu/commit/4565917bb034479a29c04f0b44124e7f61585ccf
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/core/machine.c
    M hw/pci/pci.c
    M hw/pci/pci_bridge.c
    M include/hw/pci/pci_bridge.h

  Log Message:
  -----------
  pci: SLT must be RO

current code sets PCI_SEC_LATENCY_TIMER to RW, but for
pcie to pcie bridges it must be RO 0 according to
pci express spec which says:
    This register does not apply to PCI Express. It must be read-only
    and hardwired to 00h. For PCI Express to PCI/PCI-X Bridges, refer to the
    [PCIe-to-PCI-PCI-X-Bridge] for requirements for this register.

also, fix typo in comment where it's made writeable - this typo
is likely what prevented us noticing we violate this requirement
in the 1st place.

Reported-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Message-Id: 
<de9d05366a70172e1789d10591dbe59e39c3849c.1693432039.git.mst@redhat.com>
Tested-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 961d60e934e793a6065fb17d2312d5bced25031e
      
https://github.com/qemu/qemu/commit/961d60e934e793a6065fb17d2312d5bced25031e
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-vdpa.c

  Log Message:
  -----------
  hw/virtio: Propagate page_mask to vhost_vdpa_listener_skipped_section()

In order to make vhost-vdpa.c a target-agnostic source unit,
we need to remove the TARGET_PAGE_SIZE / TARGET_PAGE_MASK /
TARGET_PAGE_ALIGN uses. TARGET_PAGE_SIZE will be replaced by
the runtime qemu_target_page_size(). The other ones will be
deduced from TARGET_PAGE_SIZE.

Since the 3 macros are used in 3 related functions (sharing
the same call tree), we'll refactor them to only depend on
TARGET_PAGE_MASK.

Having the following call tree:

  vhost_vdpa_listener_region_del()
    -> vhost_vdpa_listener_skipped_section()
       -> vhost_vdpa_section_end()

The first step is to propagate TARGET_PAGE_MASK to
vhost_vdpa_listener_skipped_section().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710094931.84402-2-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 8b1a8884c6aacd9a35863d18a757be17ec7b1369
      
https://github.com/qemu/qemu/commit/8b1a8884c6aacd9a35863d18a757be17ec7b1369
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-vdpa.c

  Log Message:
  -----------
  hw/virtio: Propagate page_mask to vhost_vdpa_section_end()

Propagate TARGET_PAGE_MASK (see the previous commit for
rationale).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710094931.84402-3-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 1dca36fb3d4f07354c9f6bc38b6e5c72fe1e9855
      
https://github.com/qemu/qemu/commit/1dca36fb3d4f07354c9f6bc38b6e5c72fe1e9855
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-vdpa.c

  Log Message:
  -----------
  hw/virtio/vhost-vdpa: Inline TARGET_PAGE_ALIGN() macro

Use TARGET_PAGE_SIZE to calculate TARGET_PAGE_ALIGN
(see the rationale in previous commits).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710094931.84402-4-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 33f21860b766701f92c01094dcfc5390974d4020
      
https://github.com/qemu/qemu/commit/33f21860b766701f92c01094dcfc5390974d4020
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-vdpa.c

  Log Message:
  -----------
  hw/virtio/vhost-vdpa: Use target-agnostic qemu_target_page_mask()

Similarly to commit e414ed2c47 ("virtio-iommu: Use
target-agnostic qemu_target_page_mask"), Replace the
target-specific TARGET_PAGE_SIZE and TARGET_PAGE_MASK
definitions by a call to the runtime qemu_target_page_size()
helper which is target agnostic.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230710094931.84402-5-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 05632635f84311f241ad4dbffdb591f97339a5dc
      
https://github.com/qemu/qemu/commit/05632635f84311f241ad4dbffdb591f97339a5dc
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/meson.build

  Log Message:
  -----------
  hw/virtio: Build vhost-vdpa.o once

The previous commit removed the dependencies on the
target-specific TARGET_PAGE_FOO macros. We can now
move vhost-vdpa.c to the 'softmmu_virtio_ss' source
set to build it once for all our targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710100432.84819-1-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f05356f84d2e3cb4f6437716cc9b5dc59baf769d
      
https://github.com/qemu/qemu/commit/f05356f84d2e3cb4f6437716cc9b5dc59baf769d
  Author: Philippe Mathieu-Daudé <philmd@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/meson.build

  Log Message:
  -----------
  hw/virtio/meson: Rename softmmu_virtio_ss[] -> system_virtio_ss[]

Similarly to commit de6cd7599b ("meson: Replace softmmu_ss
-> system_ss"), rename the virtio source set common to all
system emulation as 'system_virtio_ss[]'. This is clearer
because softmmu can be used for user emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230710100510.84862-1-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: eee77809733d3a94c0d78a29a93d032c1faefd2c
      
https://github.com/qemu/qemu/commit/eee77809733d3a94c0d78a29a93d032c1faefd2c
  Author: Alex Bennée <alex.bennee@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/meson.build
    A hw/virtio/vhost-user-device-pci.c
    A hw/virtio/vhost-user-device.c
    A include/hw/virtio/vhost-user-device.h

  Log Message:
  -----------
  virtio: add vhost-user-base and a generic vhost-user-device

In theory we shouldn't need to repeat so much boilerplate to support
vhost-user backends. This provides a generic vhost-user-base QOM
object and a derived vhost-user-device for which the user needs to
provide the few bits of information that aren't currently provided by
the vhost-user protocol. This should provide a baseline implementation
from which the other vhost-user stub can specialise.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230710153522.3469097-8-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f92a2d61cd86fd585b1b2a57295fcde278aebd78
      
https://github.com/qemu/qemu/commit/f92a2d61cd86fd585b1b2a57295fcde278aebd78
  Author: Alex Bennée <alex.bennee@linaro.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user-device.c
    M include/hw/virtio/vhost-user-device.h

  Log Message:
  -----------
  hw/virtio: add config support to vhost-user-device

To use the generic device the user will need to provide the config
region size via the command line. We also add a notifier so the guest
can be pinged if the remote daemon updates the config.

With these changes:

  -device vhost-user-device-pci,virtio-id=41,num_vqs=2,config_size=8

is equivalent to:

  -device vhost-user-gpio-pci

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230710153522.3469097-11-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 06b636a1e2ad12ab130edcbb0ccf995118440706
      
https://github.com/qemu/qemu/commit/06b636a1e2ad12ab130edcbb0ccf995118440706
  Author: Hawkins Jiawei <yin31149@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: do not reset vlan filtering at set_features

This function is called after virtio_load, so all vlan configuration is
lost in migration case.

Just allow all the vlan-tagged packets if vlan is not configured, and
trust device reset to clear all filtered vlans.

Fixes: 0b1eaa8803 ("virtio-net: Do not filter VLANs without F_CTRL_VLAN")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Hawkins Jiawei <yin31149@gmail.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id: 
<95af0d013281282f48ad3f47f6ad1ac4ca9e52eb.1690106284.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e19751a32f140a232fafb037e703abb961a94abb
      
https://github.com/qemu/qemu/commit/e19751a32f140a232fafb037e703abb961a94abb
  Author: Hawkins Jiawei <yin31149@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/net/virtio-net.c
    M include/hw/virtio/virtio-net.h

  Log Message:
  -----------
  virtio-net: Expose MAX_VLAN

vhost-vdpa shadowed CVQ needs to know the maximum number of
vlans supported by the virtio-net device, so QEMU can restore
the VLAN state in a migration.

Co-developed-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id: 
<ca03403319c6405ea7c400836a572255bbc9ceba.1690106284.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 8f7e9967484dec2a727c24a509962ca3a4f5dad4
      
https://github.com/qemu/qemu/commit/8f7e9967484dec2a727c24a509962ca3a4f5dad4
  Author: Hawkins Jiawei <yin31149@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: Restore vlan filtering state

This patch introduces vhost_vdpa_net_load_single_vlan()
and vhost_vdpa_net_load_vlan() to restore the vlan
filtering state at device's startup.

Co-developed-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id: 
<e76a29f77bb3f386e4a643c8af94b77b775d1752.1690106284.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e213c45a042db2506b5e8f16293f1f1c5083a577
      
https://github.com/qemu/qemu/commit/e213c45a042db2506b5e8f16293f1f1c5083a577
  Author: Hawkins Jiawei <yin31149@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: Allow VIRTIO_NET_F_CTRL_VLAN in SVQ

Enable SVQ with VIRTIO_NET_F_CTRL_VLAN feature.

Co-developed-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Message-Id: 
<38dc63102a42c31c72fd293d0e6e2828fd54c86e.1690106284.git.yin31149@gmail.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 43d6376980d5567f2a6d00cfb30d10c0961671e6
      
https://github.com/qemu/qemu/commit/43d6376980d5567f2a6d00cfb30d10c0961671e6
  Author: Ilya Maximets <i.maximets@ovn.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/virtio.c
    M include/exec/memory.h

  Log Message:
  -----------
  virtio: don't zero out memory region cache for indirect descriptors

Lots of virtio functions that are on a hot path in data transmission
are initializing indirect descriptor cache at the point of stack
allocation.  It's a 112 byte structure that is getting zeroed out on
each call adding unnecessary overhead.  It's going to be correctly
initialized later via special init function.  The only reason to
actually initialize right away is the ability to safely destruct it.
Replacing a designated initializer with a function to only initialize
what is necessary.

Removal of the unnecessary stack initializations improves throughput
of virtio-net devices in terms of 64B packets per second by 6-14 %
depending on the case.  Tested with a proposed af-xdp network backend
and a dpdk testpmd application in the guest, but should be beneficial
for other virtio devices as well.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Message-Id: <20230811143423.3258788-1-i.maximets@ovn.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b40eba9cdde3b041f02a9cbaa23ca0eeda9bd9c1
      
https://github.com/qemu/qemu/commit/b40eba9cdde3b041f02a9cbaa23ca0eeda9bd9c1
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: use first queue SVQ state for CVQ default

Previous to this patch the only way CVQ would be shadowed is if it does
support to isolate CVQ group or if all vqs were shadowed from the
beginning.  The second condition was checked at the beginning, and no
more configuration was done.

After this series we need to check if data queues are shadowed because
they are in the middle of the migration.  As checking if they are
shadowed already covers the previous case, let's just mimic it.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230822085330.3978829-2-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d7ce0841767d01c226fc0e22436ce22a0ec74226
      
https://github.com/qemu/qemu/commit/d7ce0841767d01c226fc0e22436ce22a0ec74226
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/trace-events
    M hw/virtio/vhost-vdpa.c
    M include/hw/virtio/vhost-vdpa.h

  Log Message:
  -----------
  vdpa: export vhost_vdpa_set_vring_ready

The vhost-vdpa net backend needs to enable vrings in a different order
than default, so export it.

No functional change intended except for tracing, that now includes the
(virtio) index being enabled and the return value of the ioctl.

Still ignoring return value of this function if called from
vhost_vdpa_dev_start, as reorganize calling code around it is out of
the scope of this series.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230822085330.3978829-3-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f3fada598c909bac12bd18da36437d9bed0b9f06
      
https://github.com/qemu/qemu/commit/f3fada598c909bac12bd18da36437d9bed0b9f06
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: rename vhost_vdpa_net_load to vhost_vdpa_net_cvq_load

Next patches will add the corresponding data load.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230822085330.3978829-4-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 6c4825476a4351530bcac17abab72295b75ffe98
      
https://github.com/qemu/qemu/commit/6c4825476a4351530bcac17abab72295b75ffe98
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vdpa-dev.c
    M hw/virtio/vhost-vdpa.c
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: move vhost_vdpa_set_vring_ready to the caller

Doing that way allows CVQ to be enabled before the dataplane vqs,
restoring the state as MQ or MAC addresses properly in the case of a
migration.

The patch does it by defining a ->load NetClientInfo callback also for
dataplane.  Ideally, this should be done by an independent patch, but
the function is already static so it would only add an empty
vhost_vdpa_net_data_load stub.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230822085330.3978829-5-eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f13f5f6412fc51574c961f39dbd625357948282b
      
https://github.com/qemu/qemu/commit/f13f5f6412fc51574c961f39dbd625357948282b
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: remove net cvq migration blocker

Now that we have add migration blockers if the device does not support
all the needed features, remove the general blocker applied to all net
devices with CVQ.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20230822085330.3978829-6-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b0de17a2e28de477e09e77a587fcbeafbbc897c4
      
https://github.com/qemu/qemu/commit/b0de17a2e28de477e09e77a587fcbeafbbc897c4
  Author: Hawkins Jiawei <yin31149@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-shadow-virtqueue.c
    M hw/virtio/vhost-shadow-virtqueue.h
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vhost: Add count argument to vhost_svq_poll()

Next patches in this series will no longer perform an
immediate poll and check of the device's used buffers
for each CVQ state load command. Instead, they will
send CVQ state load commands in parallel by polling
multiple pending buffers at once.

To achieve this, this patch refactoring vhost_svq_poll()
to accept a new argument `num`, which allows vhost_svq_poll()
to wait for the device to use multiple elements,
rather than polling for a single element.

Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: 
<950b3bfcfc5d446168b9d6a249d554a013a691d4.1693287885.git.yin31149@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b532c684e0d71bc69fa56a30f1c7588101aa086a
      
https://github.com/qemu/qemu/commit/b532c684e0d71bc69fa56a30f1c7588101aa086a
  Author: Jonah Palmer <jonah.palmer@oracle.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/virtio-qmp.c
    M hw/virtio/virtio-qmp.h
    M hw/virtio/virtio.c

  Log Message:
  -----------
  qmp: remove virtio_list, search QOM tree instead

The virtio_list duplicates information about virtio devices that already
exist in the QOM composition tree. Instead of creating this list of
realized virtio devices, search the QOM composition tree instead.

This patch modifies the QMP command qmp_x_query_virtio to instead
recursively search the QOM composition tree for devices of type
'TYPE_VIRTIO_DEVICE'. The device is also checked to ensure it's
realized.

Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230926224107.2951144-2-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 58f81689789f63853d7585c5168f687f1633893a
      
https://github.com/qemu/qemu/commit/58f81689789f63853d7585c5168f687f1633893a
  Author: Jonah Palmer <jonah.palmer@oracle.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user-gpio.c
    M hw/virtio/virtio-qmp.c

  Log Message:
  -----------
  qmp: update virtio feature maps, vhost-user-gpio introspection

Add new vhost-user protocol feature to vhost-user protocol feature map
and enumeration:
 - VHOST_USER_PROTOCOL_F_STATUS

Add new virtio device features for several virtio devices to their
respective feature mappings:

virtio-blk:
 - VIRTIO_BLK_F_SECURE_ERASE

virtio-net:
 - VIRTIO_NET_F_NOTF_COAL
 - VIRTIO_NET_F_GUEST_USO4
 - VIRTIO_NET_F_GUEST_USO6
 - VIRTIO_NET_F_HOST_USO

virtio/vhost-user-gpio:
 - VIRTIO_GPIO_F_IRQ
 - VHOST_USER_F_PROTOCOL_FEATURES

Add support for introspection on vhost-user-gpio devices.

Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <20230926224107.2951144-3-jonah.palmer@oracle.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 3d123a8b411706423581db7d26a7bbe548360751
      
https://github.com/qemu/qemu/commit/3d123a8b411706423581db7d26a7bbe548360751
  Author: Jonah Palmer <jonah.palmer@oracle.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/scsi/vhost-user-scsi.c
    M hw/virtio/vhost-user.c
    M hw/virtio/virtio-qmp.c
    M include/hw/virtio/vhost-user.h

  Log Message:
  -----------
  vhost-user: move VhostUserProtocolFeature definition to header file

Move the definition of VhostUserProtocolFeature to
include/hw/virtio/vhost-user.h.

Remove previous definitions in hw/scsi/vhost-user-scsi.c,
hw/virtio/vhost-user.c, and hw/virtio/virtio-qmp.c.

Previously there were 3 separate definitions of this over 3 different
files. Now only 1 definition of this will be present for these 3 files.

Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Reviewed-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <20230926224107.2951144-4-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: c46350e30a8f9be9ca7540960855d253100858c0
      
https://github.com/qemu/qemu/commit/c46350e30a8f9be9ca7540960855d253100858c0
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: strip superfluous whitespace

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-2-lersek@redhat.com>
Tested-by: Albert Esteve <aesteve@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f581268db73e0f2431bb400eed62e8eed069d5ec
      
https://github.com/qemu/qemu/commit/f581268db73e0f2431bb400eed62e8eed069d5ec
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: tighten "reply_supported" scope in "set_vring_addr"

In the vhost_user_set_vring_addr() function, we calculate
"reply_supported" unconditionally, even though we'll only need it if
"wait_for_reply" is also true.

Restrict the scope of "reply_supported" to the minimum.

This is purely refactoring -- no observable change.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-3-lersek@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 213cbaf75d50bd1eb23750f3f2b398a005fe403f
      
https://github.com/qemu/qemu/commit/213cbaf75d50bd1eb23750f3f2b398a005fe403f
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: factor out "vhost_user_write_sync"

The tails of the "vhost_user_set_vring_addr" and "vhost_user_set_u64"
functions are now byte-for-byte identical. Factor the common tail out to a
new function called "vhost_user_write_sync".

This is purely refactoring -- no observable change.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-4-lersek@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 969298f9d7ed0ccad39203bc3656805cbf0893d4
      
https://github.com/qemu/qemu/commit/969298f9d7ed0ccad39203bc3656805cbf0893d4
  Author: Tejus GK <tejus.gk@nutanix.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M include/migration/vmstate.h
    M migration/savevm.c
    M migration/vmstate.c

  Log Message:
  -----------
  migration/vmstate: Introduce vmstate_save_state_with_err

Currently, a few code paths exist in the function vmstate_save_state_v,
which ultimately leads to a migration failure. However, an update in the
current MigrationState for the error description is never done.

vmstate.c somehow doesn't seem to allow the use of migrate_set_error due
to some dependencies for unit tests. Hence, this patch introduces a new
function vmstate_save_state_with_err, which will eventually propagate
the error message to savevm.c where a migrate_set_error call can be
eventually done.

Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Tejus GK <tejus.gk@nutanix.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231003065538.244752-2-tejus.gk@nutanix.com>


  Commit: 848a0503422d043d541130d5e3e2f7bc147cdef9
      
https://github.com/qemu/qemu/commit/848a0503422d043d541130d5e3e2f7bc147cdef9
  Author: Tejus GK <tejus.gk@nutanix.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M migration/savevm.c
    M migration/vmstate.c

  Log Message:
  -----------
  migration: Update error description outside migration.c

A few code paths exist in the source code,where a migration is
marked as failed via MIGRATION_STATUS_FAILED, but the failure happens
outside of migration.c

In such cases, an error_report() call is made, however the current
MigrationState is never updated with the error description, and hence
clients like libvirt never know the actual reason for the failure.

This patch covers such cases outside of migration.c and updates the
error description at the appropriate places.

Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Tejus GK <tejus.gk@nutanix.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231003065538.244752-3-tejus.gk@nutanix.com>


  Commit: 8ebcb4b31264a1b2e87f7c61c2d746be1974b333
      
https://github.com/qemu/qemu/commit/8ebcb4b31264a1b2e87f7c61c2d746be1974b333
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add entry for rdma migration

It's not obvious to many that RDMA migration is in Odd Fixes stage for a
long time.  Add an explicit sub entry for it (besides migration, which
already covers the rdma files) to be clear on that, meanwhile add Zhijian
as Reviewer, so Zhijian can see the patches and review when he still has
the bandwidth.

Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Zhijian Li (Fujitsu) <lizhijian@fujitsu.com>
Cc: Fabiano Rosas <farosas@suse.de>

Acked-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230925133441.265455-1-peterx@redhat.com>


  Commit: 2bace555b3bd7bb38a58b9862016c4528b331fdb
      
https://github.com/qemu/qemu/commit/2bace555b3bd7bb38a58b9862016c4528b331fdb
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  migration: Add co-maintainers for migration

Per the qemu upstream call a few hours ago, proposing Fabiano and myself as
the co-maintainer for migration subsystem to help Juan.

Cc: Fabiano Rosas <farosas@suse.de>
Cc: Juan Quintela <quintela@redhat.com>
Acked-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231003143847.9245-1-peterx@redhat.com>


  Commit: 4f3a097143053a872ebd90ee897f08ade9ade956
      
https://github.com/qemu/qemu/commit/4f3a097143053a872ebd90ee897f08ade9ade956
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: flatten "enforce_reply" into "vhost_user_write_sync"

At this point, only "vhost_user_write_sync" calls "enforce_reply"; embed
the latter into the former.

This is purely refactoring -- no observable change.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-5-lersek@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 2ada4b63f1764d13a2b9ca9cbeb5feda46ab6851
      
https://github.com/qemu/qemu/commit/2ada4b63f1764d13a2b9ca9cbeb5feda46ab6851
  Author: Li Zhijian <lizhijian@fujitsu.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration/rdma: zore out head.repeat to make the error more clear

Previously, we got a confusion error that complains
the RDMAControlHeader.repeat:
qemu-system-x86_64: rdma: Too many requests in this message 
(3638950032).Bailing.

Actually, it's caused by an unexpected RDMAControlHeader.type.
After this patch, error will become:
qemu-system-x86_64: Unknown control message QEMU FILE

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230926100103.201564-2-lizhijian@fujitsu.com>


  Commit: 3aaf25f604823a698aa1d219411828dc176f01c4
      
https://github.com/qemu/qemu/commit/3aaf25f604823a698aa1d219411828dc176f01c4
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: hoist "write_sync", "get_features", "get_u64"

In order to avoid a forward-declaration for "vhost_user_write_sync" in a
subsequent patch, hoist "vhost_user_write_sync" ->
"vhost_user_get_features" -> "vhost_user_get_u64" just above
"vhost_set_vring".

This is purely code movement -- no observable change.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-6-lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f64388b18fe27c156aca6ae3aa02937469847c7e
      
https://github.com/qemu/qemu/commit/f64388b18fe27c156aca6ae3aa02937469847c7e
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: allow "vhost_set_vring" to wait for a reply

The "vhost_set_vring" function already centralizes the common parts of
"vhost_user_set_vring_num", "vhost_user_set_vring_base" and
"vhost_user_set_vring_enable". We'll want to allow some of those callers
to wait for a reply.

Therefore, rebase "vhost_set_vring" from just "vhost_user_write" to
"vhost_user_write_sync", exposing the "wait_for_reply" parameter.

This is purely refactoring -- there is no observable change. That's
because:

- all three callers pass in "false" for "wait_for_reply", which disables
  all logic in "vhost_user_write_sync" except the call to
  "vhost_user_write";

- the fds=NULL and fd_num=0 arguments of the original "vhost_user_write"
  call inside "vhost_set_vring" are hard-coded within
  "vhost_user_write_sync".

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-7-lersek@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 576bfb46b32b4d906c2d1f2884a27cbfdb0cbd84
      
https://github.com/qemu/qemu/commit/576bfb46b32b4d906c2d1f2884a27cbfdb0cbd84
  Author: Laszlo Ersek <lersek@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/vhost-user.c

  Log Message:
  -----------
  vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

(1) The virtio-1.2 specification
<http://docs.oasis-open.org/virtio/virtio/v1.2/virtio-v1.2.html> writes:

> 3     General Initialization And Device Operation
> 3.1   Device Initialization
> 3.1.1 Driver Requirements: Device Initialization
>
> [...]
>
> 7. Perform device-specific setup, including discovery of virtqueues for
>    the device, optional per-bus setup, reading and possibly writing the
>    device’s virtio configuration space, and population of virtqueues.
>
> 8. Set the DRIVER_OK status bit. At this point the device is “live”.

and

> 4         Virtio Transport Options
> 4.1       Virtio Over PCI Bus
> 4.1.4     Virtio Structure PCI Capabilities
> 4.1.4.3   Common configuration structure layout
> 4.1.4.3.2 Driver Requirements: Common configuration structure layout
>
> [...]
>
> The driver MUST configure the other virtqueue fields before enabling the
> virtqueue with queue_enable.
>
> [...]

(The same statements are present in virtio-1.0 identically, at
<http://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.html>.)

These together mean that the following sub-sequence of steps is valid for
a virtio-1.0 guest driver:

(1.1) set "queue_enable" for the needed queues as the final part of device
initialization step (7),

(1.2) set DRIVER_OK in step (8),

(1.3) immediately start sending virtio requests to the device.

(2) When vhost-user is enabled, and the VHOST_USER_F_PROTOCOL_FEATURES
special virtio feature is negotiated, then virtio rings start in disabled
state, according to
<https://qemu-project.gitlab.io/qemu/interop/vhost-user.html#ring-states>.
In this case, explicit VHOST_USER_SET_VRING_ENABLE messages are needed for
enabling vrings.

Therefore setting "queue_enable" from the guest (1.1) is a *control plane*
operation, which travels from the guest through QEMU to the vhost-user
backend, using a unix domain socket.

Whereas sending a virtio request (1.3) is a *data plane* operation, which
evades QEMU -- it travels from guest to the vhost-user backend via
eventfd.

This means that steps (1.1) and (1.3) travel through different channels,
and their relative order can be reversed, as perceived by the vhost-user
backend.

That's exactly what happens when OVMF's virtiofs driver (VirtioFsDxe) runs
against the Rust-language virtiofsd version 1.7.2. (Which uses version
0.10.1 of the vhost-user-backend crate, and version 0.8.1 of the vhost
crate.)

Namely, when VirtioFsDxe binds a virtiofs device, it goes through the
device initialization steps (i.e., control plane operations), and
immediately sends a FUSE_INIT request too (i.e., performs a data plane
operation). In the Rust-language virtiofsd, this creates a race between
two components that run *concurrently*, i.e., in different threads or
processes:

- Control plane, handling vhost-user protocol messages:

  The "VhostUserSlaveReqHandlerMut::set_vring_enable" method
  [crates/vhost-user-backend/src/handler.rs] handles
  VHOST_USER_SET_VRING_ENABLE messages, and updates each vring's "enabled"
  flag according to the message processed.

- Data plane, handling virtio / FUSE requests:

  The "VringEpollHandler::handle_event" method
  [crates/vhost-user-backend/src/event_loop.rs] handles the incoming
  virtio / FUSE request, consuming the virtio kick at the same time. If
  the vring's "enabled" flag is set, the virtio / FUSE request is
  processed genuinely. If the vring's "enabled" flag is clear, then the
  virtio / FUSE request is discarded.

Note that OVMF enables the queue *first*, and sends FUSE_INIT *second*.
However, if the data plane processor in virtiofsd wins the race, then it
sees the FUSE_INIT *before* the control plane processor took notice of
VHOST_USER_SET_VRING_ENABLE and green-lit the queue for the data plane
processor. Therefore the latter drops FUSE_INIT on the floor, and goes
back to waiting for further virtio / FUSE requests with epoll_wait.
Meanwhile OVMF is stuck waiting for the FUSET_INIT response -- a deadlock.

The deadlock is not deterministic. OVMF hangs infrequently during first
boot. However, OVMF hangs almost certainly during reboots from the UEFI
shell.

The race can be "reliably masked" by inserting a very small delay -- a
single debug message -- at the top of "VringEpollHandler::handle_event",
i.e., just before the data plane processor checks the "enabled" field of
the vring. That delay suffices for the control plane processor to act upon
VHOST_USER_SET_VRING_ENABLE.

We can deterministically prevent the race in QEMU, by blocking OVMF inside
step (1.1) -- i.e., in the write to the "queue_enable" register -- until
VHOST_USER_SET_VRING_ENABLE actually *completes*. That way OVMF's VCPU
cannot advance to the FUSE_INIT submission before virtiofsd's control
plane processor takes notice of the queue being enabled.

Wait for VHOST_USER_SET_VRING_ENABLE completion by:

- setting the NEED_REPLY flag on VHOST_USER_SET_VRING_ENABLE, and waiting
  for the reply, if the VHOST_USER_PROTOCOL_F_REPLY_ACK vhost-user feature
  has been negotiated, or

- performing a separate VHOST_USER_GET_FEATURES *exchange*, which requires
  a backend response regardless of VHOST_USER_PROTOCOL_F_REPLY_ACK.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>
Cc: German Maglione <gmaglione@redhat.com>
Cc: Liu Jiang <gerry@linux.alibaba.com>
Cc: Sergio Lopez Pascual <slp@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20230830134055.106812-8-lersek@redhat.com>
Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 2f9e8442a5ec16420baac825baa59497d03465fb
      
https://github.com/qemu/qemu/commit/2f9e8442a5ec16420baac825baa59497d03465fb
  Author: David Woodhouse <dwmw@amazon.co.uk>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/isa/lpc_ich9.c

  Log Message:
  -----------
  hw/isa/ich9: Add comment on imperfect emulation of PIC vs. I/O APIC routing

As noted in the comment, the PCI INTx lines are supposed to be routed
to *both* the PIC and the I/O APIC. It's just that we don't cope with
the concept of an IRQ being asserted to two *different* pins on the
two irqchips.

So we have this hack of routing to I/O APIC only if the PIRQ routing to
the PIC is disabled. Which seems to work well enough, even when I try
hard to break it with kexec. But should be explicitly documented and
understood.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <112a09643b8191c4eae7d92fa247a861ab90a9ee.camel@infradead.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 94d30bd80b1829cd1f8e5552b2475be267ea9efb
      
https://github.com/qemu/qemu/commit/94d30bd80b1829cd1f8e5552b2475be267ea9efb
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  tests/acpi: Allow update of DSDT.cxl

Addition of QTG in following patch requires an update to the test
data.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230904161847.18468-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: ca1031203aaa38b4743339f29436e81fb4b04e12
      
https://github.com/qemu/qemu/commit/ca1031203aaa38b4743339f29436e81fb4b04e12
  Author: Dave Jiang <dave.jiang@intel.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/cxl.c
    M hw/i386/acpi-build.c
    M include/hw/acpi/cxl.h

  Log Message:
  -----------
  hw/cxl: Add QTG _DSM support for ACPI0017 device

Add a simple _DSM call support for the ACPI0017 device to return a fake QTG
ID value of 0 in all cases. The enabling is for _DSM plumbing testing
from the OS.

Following edited for readbility only

Device (CXLM)
{
    Name (_HID, "ACPI0017")  // _HID: Hardware ID
...
    Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
    {
        If ((Arg0 == ToUUID ("f365f9a6-a7de-4071-a66a-b40c0b4f8e52")))
        {
            If ((Arg2 == Zero))
            {
                Return (Buffer (One) { 0x01 })
            }

            If ((Arg2 == One))
            {
                Return (Package (0x02)
                {
                    Buffer (0x02)
                    { 0x01, 0x00 },
                    Package (0x01)
                    {
                        Buffer (0x02)
                        { 0x00, 0x00 }
                    }
                })
            }
        }
    }

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230904161847.18468-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 81186c17341defa778159a03fc8f84d3da243b33
      
https://github.com/qemu/qemu/commit/81186c17341defa778159a03fc8f84d3da243b33
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M tests/data/acpi/q35/DSDT.cxl
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  tests/acpi: Update DSDT.cxl with QTG DSM

Description of change in previous patch.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230904161847.18468-4-Jonathan.Cameron@huawei.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e77783f9d27a6a77385e2747d2509772098b152d
      
https://github.com/qemu/qemu/commit/e77783f9d27a6a77385e2747d2509772098b152d
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/i386/acpi-build.c
    M hw/i386/acpi-common.c
    M hw/i386/acpi-common.h
    M hw/i386/acpi-microvm.c

  Log Message:
  -----------
  hw/i386/acpi-build: Use pc_madt_cpu_entry() directly

This is x86-specific code, so there is no advantage in using
pc_madt_cpu_entry() behind an architecture-agnostic interface.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-2-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 2f5eed06b53f4a8376d0779310dfbf4b5bcf4ab7
      
https://github.com/qemu/qemu/commit/2f5eed06b53f4a8376d0779310dfbf4b5bcf4ab7
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/cpu.c
    M hw/i386/acpi-build.c
    M include/hw/acpi/cpu.h

  Log Message:
  -----------
  hw/acpi/cpu: Have build_cpus_aml() take a build_madt_cpu_fn callback

build_cpus_aml() is architecture independent but needs to create architecture-
specific CPU AML. So far this was achieved by using a virtual method from
TYPE_ACPI_DEVICE_IF. However, build_cpus_aml() would resolve this interface from
global (!) state. This makes it quite incomprehensible where this interface
comes from (TYPE_PIIX4_PM?, TYPE_ICH9_LPC_DEVICE?, TYPE_ACPI_GED_X86?) an can
lead to crashes when the generic code is ported to new architectures.

So far, build_cpus_aml() is only called in architecture-specific code -- and
only in x86. We can therefore simply pass pc_madt_cpu_entry() as callback to
build_cpus_aml(). This is the same callback that would be used through
TYPE_ACPI_DEVICE_IF.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-3-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f3006200ae19ad95c1b102a821345a1627628ae2
      
https://github.com/qemu/qemu/commit/f3006200ae19ad95c1b102a821345a1627628ae2
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/acpi-x86-stub.c
    M hw/acpi/piix4.c
    M hw/i386/generic_event_device_x86.c
    M hw/isa/lpc_ich9.c
    M include/hw/acpi/acpi_dev_interface.h

  Log Message:
  -----------
  hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method

This virtual method was always set to the x86-specific pc_madt_cpu_entry(),
even in piix4 which is also used in MIPS. The previous changes use
pc_madt_cpu_entry() otherwise, so madt_cpu can be dropped.

Since pc_madt_cpu_entry() is now only used in x86-specific code, the stub
in hw/acpi/acpi-x86-stub can be removed as well.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-4-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: cb00fba41b8dd669b1f34094f85ca9b35aa8d372
      
https://github.com/qemu/qemu/commit/cb00fba41b8dd669b1f34094f85ca9b35aa8d372
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/cpu.c
    M hw/acpi/hmat.c
    M hw/acpi/hmat.h
    M hw/acpi/memory_hotplug.c
    M include/hw/acpi/acpi_dev_interface.h

  Log Message:
  -----------
  hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h"

The "hw/boards.h" is unused since the previous commit. Since its removal
requires include fixes in various unrelated files to keep the code compiling it
has been split in a dedicated commit.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-5-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e93365a893cf32e85fb1572533c8864b84af6817
      
https://github.com/qemu/qemu/commit/e93365a893cf32e85fb1572533c8864b84af6817
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    R hw/i386/generic_event_device_x86.c
    M hw/i386/meson.build
    M hw/i386/microvm.c
    M include/hw/acpi/generic_event_device.h

  Log Message:
  -----------
  hw/i386: Remove now redundant TYPE_ACPI_GED_X86

Now that TYPE_ACPI_GED_X86 doesn't assign AcpiDeviceIfClass::madt_cpu any more
it is the same as TYPE_ACPI_GED.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-6-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 4e9b409e28b96e55d248f1a8f34185d9bd51f496
      
https://github.com/qemu/qemu/commit/4e9b409e28b96e55d248f1a8f34185d9bd51f496
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  hw/i386/acpi-build: Determine SMI command port just once

The SMI command port is currently hardcoded by means of the ACPI_PORT_SMI_CMD
macro. This hardcoding is Intel specific and doesn't match VIA, for example.
There is already the AcpiFadtData::smi_cmd attribute which is used when building
the FADT. Let's also use it when building the DSDT which confines SMI command
port determination to just one place. This allows it to become a property later,
thus resolving the Intel assumption.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-7-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: ec7b96b742411fd889f7fb9a29a2ac640cc97499
      
https://github.com/qemu/qemu/commit/ec7b96b742411fd889f7fb9a29a2ac640cc97499
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/core.c
    M hw/acpi/piix4.c
    M hw/acpi/trace-events

  Log Message:
  -----------
  hw/acpi: Trace GPE access in all device models, not just PIIX4

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-8-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 83c3c5646c29d0f2b6539ab21ba48b679c67b27b
      
https://github.com/qemu/qemu/commit/83c3c5646c29d0f2b6539ab21ba48b679c67b27b
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/acpi/core.c
    M hw/acpi/trace-events

  Log Message:
  -----------
  hw/acpi/core: Trace enable and status registers of GPE separately

The bit positions of both registers are related. Tracing the registers
independently results in the same offsets across these registers which
eases debugging.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230908084234.17642-9-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 0242fd011b95f423c4659b2b66a71fada98e4aa1
      
https://github.com/qemu/qemu/commit/0242fd011b95f423c4659b2b66a71fada98e4aa1
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa: fix gcc cvq_isolated uninitialized variable warning

gcc 13.2.1 emits the following warning:

  net/vhost-vdpa.c: In function ‘net_vhost_vdpa_init.constprop’:
  net/vhost-vdpa.c:1394:25: error: ‘cvq_isolated’ may be used uninitialized 
[-Werror=maybe-uninitialized]
   1394 |         s->cvq_isolated = cvq_isolated;
        |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
  net/vhost-vdpa.c:1355:9: note: ‘cvq_isolated’ was declared here
   1355 |     int cvq_isolated;
        |         ^~~~~~~~~~~~
  cc1: all warnings being treated as errors

Cc: Eugenio Pérez <eperezma@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230911215435.4156314-1-stefanha@redhat.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 46f80b8ba1696f12768ab5dfa475127c9f418537
      
https://github.com/qemu/qemu/commit/46f80b8ba1696f12768ab5dfa475127c9f418537
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa net: zero vhost_vdpa iova_tree pointer at cleanup

Not zeroing it causes a SIGSEGV if the live migration is cancelled, at
net device restart.

This is caused because CVQ tries to reuse the iova_tree that is present
in the first vhost_vdpa device at the end of vhost_vdpa_net_cvq_start.
As a consequence, it tries to access an iova_tree that has been already
free.

Fixes: 00ef422e9fbf ("vdpa net: move iova tree creation from init to start")
Reported-by: Yanhui Ma <yama@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230913123408.2819185-1-eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 252a50615fc24f184aa447ba901cc734f9eba045
      
https://github.com/qemu/qemu/commit/252a50615fc24f184aa447ba901cc734f9eba045
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/cxl/cxl-component-utils.c
    M include/hw/cxl/cxl_component.h

  Log Message:
  -----------
  hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c

There is no strong justification for keeping these in the header
so push them down into the associated cxl-component-utils.c file.

Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230913132523.29780-2-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 2d66e87538e9f086b6dad51a03ab3bcbbf1d4bb0
      
https://github.com/qemu/qemu/commit/2d66e87538e9f086b6dad51a03ab3bcbbf1d4bb0
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/cxl/cxl-component-utils.c
    M include/hw/cxl/cxl_component.h

  Log Message:
  -----------
  hw/cxl: Add utility functions decoder interleave ways and target count.

As an encoded version of these key configuration parameters is available
in a register, provide functions to extract it again so as to avoid
the need for duplicating the storage.

Whilst here update the _enc() function to include additional values
as defined in the CXL 3.0 specification. Whilst they are not
currently used in the emulation, they may be in future and it is
easier to compare with the specification if all values are covered.

Add a spec reference for cxl_interleave_ways_enc() for consistency
with the target count equivalent (and because it's nice to know where
the magic numbers come from).

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230913132523.29780-3-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 3976fa63a103f187026c2efdbf2857f3ddded6e8
      
https://github.com/qemu/qemu/commit/3976fa63a103f187026c2efdbf2857f3ddded6e8
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/cxl/cxl-component-utils.c
    M hw/cxl/cxl-host.c
    M hw/mem/cxl_type3.c
    M include/hw/cxl/cxl_component.h

  Log Message:
  -----------
  hw/cxl: Fix and use same calculation for HDM decoder block size everywhere

In order to avoid having the size of the per HDM decoder register block
repeated in lots of places, create the register definitions for HDM
decoder 1 and use the offset between the first registers in HDM decoder 0 and
HDM decoder 1 to establish the offset.

Calculate in each function as this is more obvious and leads to shorter
line lengths than a single #define which would need a long name
to be specific enough.

Note that the code currently only supports one decoder, so the bugs this
fixes don't actually affect anything.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Fan Ni <fan.ni@samsung.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230913132523.29780-4-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e6714b569215069d31535a1f260a0262359ab9c8
      
https://github.com/qemu/qemu/commit/e6714b569215069d31535a1f260a0262359ab9c8
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/cxl/cxl-component-utils.c
    M hw/cxl/cxl-host.c
    M hw/mem/cxl_type3.c
    M include/hw/cxl/cxl_component.h

  Log Message:
  -----------
  hw/cxl: Support 4 HDM decoders at all levels of topology

Support these decoders in CXL host bridges (pxb-cxl), CXL Switch USP
and CXL Type 3 end points.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Message-Id: <20230913132523.29780-5-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: ede63a679e6f7c6d3b0eec6dd8d39bb41bce0c8d
      
https://github.com/qemu/qemu/commit/ede63a679e6f7c6d3b0eec6dd8d39bb41bce0c8d
  Author: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/pci-bridge/cxl_upstream.c

  Log Message:
  -----------
  hw/pci-bridge/cxl-upstream: Add serial number extended capability support

Will be needed so there is a defined serial number for
information queries via the Switch CCI.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20230913133615.29876-1-Jonathan.Cameron@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e5f1d5802d9388faba3fa2c0aecf08664f27bca0
      
https://github.com/qemu/qemu/commit/e5f1d5802d9388faba3fa2c0aecf08664f27bca0
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa net: fix error message setting virtio status

It incorrectly prints "error setting features", probably because a copy
paste miss.

Fixes: 152128d646 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230915170836.3078172-2-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: a0285b4df2e5ba440502900a89d2d1279e55f6d5
      
https://github.com/qemu/qemu/commit/a0285b4df2e5ba440502900a89d2d1279e55f6d5
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa net: stop probing if cannot set features

Otherwise it continues the CVQ isolation probing.

Fixes: 152128d646 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230915170836.3078172-3-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: ee64a76ce91f38e6dea72f7fa49740ee1e85dbf5
      
https://github.com/qemu/qemu/commit/ee64a76ce91f38e6dea72f7fa49740ee1e85dbf5
  Author: Eugenio Pérez <eperezma@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M net/vhost-vdpa.c

  Log Message:
  -----------
  vdpa net: follow VirtIO initialization properly at cvq isolation probing

This patch solves a few issues.  The most obvious is that the feature
set was done previous to ACKNOWLEDGE | DRIVER status bit set.  Current
vdpa devices are permissive with this, but it is better to follow the
standard.

Fixes: 152128d646 ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Message-Id: <20230915170836.3078172-4-eperezma@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 6b6fb1224d011afadc13cbc2493625721e763ff9
      
https://github.com/qemu/qemu/commit/6b6fb1224d011afadc13cbc2493625721e763ff9
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/i386/amd_iommu.c
    M hw/i386/amd_iommu.h

  Log Message:
  -----------
  amd_iommu: Fix APIC address check

An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In
fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit.
Cover the range assigned to APIC.

Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230921114612.40671-1-akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 779c16c6f77543082cd237878981ecdffdd51368
      
https://github.com/qemu/qemu/commit/779c16c6f77543082cd237878981ecdffdd51368
  Author: Ani Sinha <anisinha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/i386/pc.h
    M tests/qtest/bios-tables-test.c
    M tests/qtest/numa-test.c

  Log Message:
  -----------
  hw/i386/pc: improve physical address space bound check for 32-bit x86 systems

32-bit x86 systems do not have a reserved memory for hole64. On those 32-bit
systems without PSE36 or PAE CPU features, hotplugging memory devices are not
supported by QEMU as QEMU always places hotplugged memory above 4 GiB boundary
which is beyond the physical address space of the processor. Linux guests also
does not support memory hotplug on those systems. Please see Linux
kernel commit b59d02ed08690 ("mm/memory_hotplug: disable the functionality
for 32b") for more details.

Therefore, the maximum limit of the guest physical address in the absence of
additional memory devices effectively coincides with the end of
"above 4G memory space" region for 32-bit x86 without PAE/PSE36. When users
configure additional memory devices, after properly accounting for the
additional device memory region to find the maximum value of the guest
physical address, the address will be outside the range of the processor's
physical address space.

This change adds improvements to take above into consideration.

For example, previously this was allowed:

$ ./qemu-system-x86_64 -cpu pentium -m size=10G

With this change now it is no longer allowed:

$ ./qemu-system-x86_64 -cpu pentium -m size=10G
qemu-system-x86_64: Address space limit 0xffffffff < 0x2bfffffff phys-bits too 
low (32)

However, the following are allowed since on both cases physical address
space of the processor is 36 bits:

$ ./qemu-system-x86_64 -cpu pentium2 -m size=10G
$ ./qemu-system-x86_64 -cpu pentium,pse36=on -m size=10G

For 32-bit, without PAE/PSE36, hotplugging additional memory is no longer 
allowed.

$ ./qemu-system-i386 -m size=1G,maxmem=3G,slots=2
qemu-system-i386: Address space limit 0xffffffff < 0x1ffffffff phys-bits too 
low (32)
$ ./qemu-system-i386 -machine q35 -m size=1G,maxmem=3G,slots=2
qemu-system-i386: Address space limit 0xffffffff < 0x1ffffffff phys-bits too 
low (32)

A new compatibility flag is introduced to make sure pc_max_used_gpa() keeps
returning the old value for machines 8.1 and older.
Therefore, the above is still allowed for older machine types in order to 
support
compatibility. Hence, the following still works:

$ ./qemu-system-i386 -machine pc-i440fx-8.1 -m size=1G,maxmem=3G,slots=2
$ ./qemu-system-i386 -machine pc-q35-8.1 -m size=1G,maxmem=3G,slots=2

Further, following is also allowed as with PSE36, the processor has 36-bit
address space:

$ ./qemu-system-i386 -cpu 486,pse36=on -m size=1G,maxmem=3G,slots=2

After calling CPUID with EAX=0x80000001, all AMD64 compliant processors
have the longmode-capable-bit turned on in the extended feature flags (bit 29)
in EDX. The absence of CPUID longmode can be used to differentiate between
32-bit and 64-bit processors and is the recommended approach. QEMU takes this
approach elsewhere (for example, please see x86_cpu_realizefn()), With
this change, pc_max_used_gpa() also uses the same method to detect 32-bit
processors.

Unit tests are modified to not run 32-bit x86 tests that use memory hotplug.

Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230922160413.165702-1-anisinha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 3bfea1a1bd64bd12e873a8831ded0bd58bff7914
      
https://github.com/qemu/qemu/commit/3bfea1a1bd64bd12e873a8831ded0bd58bff7914
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/pci/pcie_sriov.c

  Log Message:
  -----------
  pcie_sriov: unregister_vfs(): fix error path

local_err must be NULL before calling object_property_set_bool(), so we
must clear it on each iteration. Let's also use more convenient
error_reportf_err().

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230925194040.68592-8-vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: a252fa38d2dbb8bc8891e458c27f60c52ec49c69
      
https://github.com/qemu/qemu/commit/a252fa38d2dbb8bc8891e458c27f60c52ec49c69
  Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M subprojects/libvhost-user/libvhost-user.c

  Log Message:
  -----------
  libvhost-user.c: add assertion to vu_message_read_default

Explain Coverity that we are not going to overflow vmsg->fds.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230925194040.68592-5-vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 6bc83c60fbb4aef8ecca2cfc366316194ca0f65f
      
https://github.com/qemu/qemu/commit/6bc83c60fbb4aef8ecca2cfc366316194ca0f65f
  Author: Ilya Maximets <i.maximets@ovn.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: use shadow_avail_idx while checking number of heads

We do not need the most up to date number of heads, we only want to
know if there is at least one.

Use shadow variable as long as it is not equal to the last available
index checked.  This avoids expensive qatomic dereference of the
RCU-protected memory region cache as well as the memory access itself.

The change improves performance of the af-xdp network backend by 2-3%.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Message-Id: <20230927135157.2316982-1-i.maximets@ovn.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 517ad87442cd67270ed0f62592686a2a058f85af
      
https://github.com/qemu/qemu/commit/517ad87442cd67270ed0f62592686a2a058f85af
  Author: Ilya Maximets <i.maximets@ovn.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: remove unnecessary thread fence while reading next descriptor

It was supposed to be a compiler barrier and it was a compiler barrier
initially called 'wmb' when virtio core support was introduced.
Later all the instances of 'wmb' were switched to smp_wmb to fix memory
ordering issues on non-x86 platforms.  However, this one doesn't need
to be an actual barrier, as its only purpose was to ensure that the
value is not read twice.

And since commit aa570d6fb6bd ("virtio: combine the read of a descriptor")
there is no need for a barrier at all, since we're no longer reading
guest memory here, but accessing a local structure.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Message-Id: <20230927140016.2317404-2-i.maximets@ovn.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 44dc21c849c6373045e07b6b18abc1b32ae4cd7d
      
https://github.com/qemu/qemu/commit/44dc21c849c6373045e07b6b18abc1b32ae4cd7d
  Author: Ilya Maximets <i.maximets@ovn.org>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: remove unused next argument from virtqueue_split_read_next_desc()

The 'next' was converted from a local variable to an output parameter
in commit:
  412e0e81b174 ("virtio: handle virtqueue_read_next_desc() errors")

But all the actual uses of the 'i/next' as an output were removed a few
months prior in commit:
  aa570d6fb6bd ("virtio: combine the read of a descriptor")

Remove the unused argument to simplify the code.

Also, adding a comment to the function to describe what it is actually
doing, as it is not obvious that the 'desc' is both an input and an
output argument.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Message-Id: <20230927140016.2317404-3-i.maximets@ovn.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 78d39da81dceebb9e92a16b30f68597e8fe32dba
      
https://github.com/qemu/qemu/commit/78d39da81dceebb9e92a16b30f68597e8fe32dba
  Author: Albert Esteve <aesteve@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M include/qemu/uuid.h
    M tests/unit/test-uuid.c
    M util/uuid.c

  Log Message:
  -----------
  util/uuid: add a hash function

Add hash function to uuid module using the
djb2 hash algorithm.

Add a couple simple unit tests for the hash
function, checking collisions for similar UUIDs.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20231002065706.94707-2-aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 86de3c7c896e5f54d24b7984bebf1f81d4b70094
      
https://github.com/qemu/qemu/commit/86de3c7c896e5f54d24b7984bebf1f81d4b70094
  Author: Albert Esteve <aesteve@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS
    M hw/display/meson.build
    A hw/display/virtio-dmabuf.c
    A include/hw/virtio/virtio-dmabuf.h
    M tests/unit/meson.build
    A tests/unit/test-virtio-dmabuf.c

  Log Message:
  -----------
  hw/display: introduce virtio-dmabuf

This API manages objects (in this iteration,
dmabuf fds) that can be shared along different
virtio devices, associated to a UUID.

The API allows the different devices to add,
remove and/or retrieve the objects by simply
invoking the public functions that reside in the
virtio-dmabuf file.

For vhost backends, the API stores the pointer
to the backend holding the object.

Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20231002065706.94707-3-aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d714bc6da23e645b53caa2400f0e6c38dbbe4e7b
      
https://github.com/qemu/qemu/commit/d714bc6da23e645b53caa2400f0e6c38dbbe4e7b
  Author: Albert Esteve <aesteve@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M docs/interop/vhost-user.rst
    M hw/virtio/vhost-user.c
    M include/hw/virtio/vhost-backend.h
    M include/hw/virtio/vhost-user.h

  Log Message:
  -----------
  vhost-user: add shared_object msg

Add three new vhost-user protocol
`VHOST_USER_BACKEND_SHARED_OBJECT_* messages`.
These new messages are sent from vhost-user
back-ends to interact with the virtio-dmabuf
table in order to add or remove themselves as
virtio exporters, or lookup for virtio dma-buf
shared objects.

The action taken in the front-end depends
on the type stored in the virtio shared
object hash table.

When the table holds a pointer to a vhost
backend for a given UUID, the front-end sends
a VHOST_USER_GET_SHARED_OBJECT to the
backend holding the shared object.

The messages can only be sent after successfully
negotiating a new VHOST_USER_PROTOCOL_F_SHARED_OBJECT
vhost-user protocol feature bit.

Finally, refactor code to send response message so
that all common parts both for the common REPLY_ACK
case, and other data responses, can call it and
avoid code repetition.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20231002065706.94707-4-aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 603cf7156bc64236b4a5cccca9b42d5af5df5eea
      
https://github.com/qemu/qemu/commit/603cf7156bc64236b4a5cccca9b42d5af5df5eea
  Author: Albert Esteve <aesteve@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M subprojects/libvhost-user/libvhost-user.c
    M subprojects/libvhost-user/libvhost-user.h

  Log Message:
  -----------
  libvhost-user: handle shared_object msg

In the libvhost-user library we need to
handle VHOST_USER_GET_SHARED_OBJECT requests,
and add helper functions to allow sending messages
to interact with the virtio shared objects
hash table.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20231002065706.94707-5-aesteve@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 67aeae794e51b3238ced158218edf443f8607626
      
https://github.com/qemu/qemu/commit/67aeae794e51b3238ced158218edf443f8607626
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M tests/migration/i386/a-b-bootblock.S

  Log Message:
  -----------
  i386/a-b-bootblock: factor test memory addresses out into constants

So that we have less magic numbers to deal with. This also allows us to
reuse these in the following commits.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230919102346.2117963-2-d-tatianin@yandex-team.ru>


  Commit: adc1914a403e0ec89ebec4761ec8427668261c5b
      
https://github.com/qemu/qemu/commit/adc1914a403e0ec89ebec4761ec8427668261c5b
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M tests/migration/i386/a-b-bootblock.S
    M tests/migration/i386/a-b-bootblock.h

  Log Message:
  -----------
  i386/a-b-bootblock: zero the first byte of each page on start

The migration qtest all the way up to this point used to work by sheer
luck relying on the contents of all pages from 1MiB to 100MiB to contain
the same one value in the first byte initially.

This easily breaks if we reduce the amount of RAM for the test instances
from 150MiB to e.g 110MiB since that makes SeaBIOS dirty some of the
pages starting at about 0x5dd2000 (~93 MiB) as it reuses those for the
HighMemory allocator since commit dc88f9b72df ("malloc: use large
ZoneHigh when there is enough memory").

This would result in the following errors:
    12/60 qemu:qtest+qtest-x86_64 / qtest-x86_64/migration-test                 
ERROR           2.74s   killed by signal 6 SIGABRT
    stderr:
    Memory content inconsistency at 5dd2000 first_byte = cc last_byte = cb 
current = 9e hit_edge = 1
    Memory content inconsistency at 5dd3000 first_byte = cc last_byte = cb 
current = 89 hit_edge = 1
    Memory content inconsistency at 5dd4000 first_byte = cc last_byte = cb 
current = 23 hit_edge = 1
    Memory content inconsistency at 5dd5000 first_byte = cc last_byte = cb 
current = 31 hit_edge = 1
    Memory content inconsistency at 5dd6000 first_byte = cc last_byte = cb 
current = 70 hit_edge = 1
    Memory content inconsistency at 5dd7000 first_byte = cc last_byte = cb 
current = ff hit_edge = 1
    Memory content inconsistency at 5dd8000 first_byte = cc last_byte = cb 
current = 54 hit_edge = 1
    Memory content inconsistency at 5dd9000 first_byte = cc last_byte = cb 
current = 64 hit_edge = 1
    Memory content inconsistency at 5dda000 first_byte = cc last_byte = cb 
current = 1d hit_edge = 1
    Memory content inconsistency at 5ddb000 first_byte = cc last_byte = cb 
current = 1a hit_edge = 1
    and in another 26 pages**
    ERROR:../tests/qtest/migration-test.c:300:check_guests_ram: assertion 
failed: (bad == 0)

Fix this by always zeroing the first byte of each page in the range so
that we get consistent results no matter the initial contents.

Fixes: ea0c6d62391 ("test: Postcopy")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230919102346.2117963-3-d-tatianin@yandex-team.ru>


  Commit: b28e3ecf0de1bc77b6a1a520e3c223f37b5afce2
      
https://github.com/qemu/qemu/commit/b28e3ecf0de1bc77b6a1a520e3c223f37b5afce2
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M tests/migration/s390x/a-b-bios.c
    M tests/migration/s390x/a-b-bios.h

  Log Message:
  -----------
  s390x/a-b-bios: zero the first byte of each page on start

Same as with the x86 verison of this test, we relied on the contents of
all pages in RAM to be the same across the entire test range, which is
very fragile. Zero the first byte of each page before running the
increment loop to fix this.

Fixes: 5571dc824b ("tests/migration: Enable the migration test on s390x, too")
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230919102346.2117963-4-d-tatianin@yandex-team.ru>


  Commit: 2a9e2e595f2bc81c07e2f06ef9ba7d4c68897f1c
      
https://github.com/qemu/qemu/commit/2a9e2e595f2bc81c07e2f06ef9ba7d4c68897f1c
  Author: Steve Sistare <steven.sistare@oracle.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    A migration/file.c
    A migration/file.h
    M migration/meson.build
    M migration/migration.c
    M migration/trace-events
    M qemu-options.hx

  Log Message:
  -----------
  migration: file URI

Extend the migration URI to support file:<filename>.  This can be used for
any migration scenario that does not require a reverse path.  It can be
used as an alternative to 'exec:cat > file' in minimized containers that
do not contain /bin/sh, and it is easier to use than the fd:<fdname> URI.
It can be used in HMP commands, and as a qemu command-line parameter.

For best performance, guest ram should be shared and x-ignore-shared
should be true, so guest pages are not written to the file, in which case
the guest may remain running.  If ram is not so configured, then the user
is advised to stop the guest first.  Otherwise, a busy guest may re-dirty
the same page, causing it to be appended to the file multiple times,
and the file may grow unboundedly.  That issue is being addressed in the
"fixed-ram" patch series.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Tested-by: Michael Galaxy <mgalaxy@akamai.com>
Reviewed-by: Michael Galaxy <mgalaxy@akamai.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <1694182931-61390-2-git-send-email-steven.sistare@oracle.com>


  Commit: 385f510df5f6a7f3998b3ff01deca33b0027ff29
      
https://github.com/qemu/qemu/commit/385f510df5f6a7f3998b3ff01deca33b0027ff29
  Author: Steve Sistare <steven.sistare@oracle.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M migration/file.c
    M qemu-options.hx

  Log Message:
  -----------
  migration: file URI offset

Allow an offset option to be specified as part of the file URI, in
the form "file:filename,offset=offset", where offset accepts the common
size suffixes, or the 0x prefix, but not both.  Migration data is written
to and read from the file starting at offset.  If unspecified, it defaults
to 0.

This is needed by libvirt to store its own data at the head of the file.

Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <1694182931-61390-3-git-send-email-steven.sistare@oracle.com>


  Commit: 579cedf430582b37f804f6b6ed131554cebb11b5
      
https://github.com/qemu/qemu/commit/579cedf430582b37f804f6b6ed131554cebb11b5
  Author: Peter Xu <peterx@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M migration/trace-events
    M migration/vmstate.c

  Log Message:
  -----------
  migration: Unify and trace vmstate field_exists() checks

For both save/load we actually share the logic on deciding whether a field
should exist.  Merge the checks into a helper and use it for both save and
load.  When doing so, add documentations and reformat the code to make it
much easier to read.

The real benefit here (besides code cleanups) is we add a trace-point for
this; this is a known spot where we can easily break migration
compatibilities between binaries, and this trace point will be critical for
us to identify such issues.

For example, this will be handy when debugging things like:

https://gitlab.com/qemu-project/qemu/-/issues/932

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20230906204722.514474-1-peterx@redhat.com>


  Commit: 9afa888ce0f816d0f2cfc95eebe4f49244c518af
      
https://github.com/qemu/qemu/commit/9afa888ce0f816d0f2cfc95eebe4f49244c518af
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M include/qemu/osdep.h
    M meson.build
    M util/coroutine-sigaltstack.c
    M util/coroutine-ucontext.c

  Log Message:
  -----------
  osdep: set _FORTIFY_SOURCE=2 when optimization is enabled

Currently we set _FORTIFY_SOURCE=2 as a compiler argument when the
meson 'optimization' setting is non-zero, the compiler is GCC and
the target is Linux.

While the default QEMU optimization level is 2, user could override
this by setting CFLAGS="-O0" or --extra-cflags="-O0" when running
configure and this won't be reflected in the meson 'optimization'
setting. As a result we try to enable _FORTIFY_SOURCE=2 and then the
user gets compile errors as it only works with optimization.

Rather than trying to improve detection in meson, it is simpler to
just check the __OPTIMIZE__ define from osdep.h.

The comment about being incompatible with clang appears to be
outdated, as compilation works fine without excluding clang.

In the coroutine code we must set _FORTIFY_SOURCE=0 to stop the
logic in osdep.h then enabling it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20231003091549.223020-1-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: c5661d0cb8e64ec0c8721ac5c462be576cd7cbf7
      
https://github.com/qemu/qemu/commit/c5661d0cb8e64ec0c8721ac5c462be576cd7cbf7
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M chardev/char-pty.c
    M hw/core/machine.c
    M hw/display/ramfb.c
    M hw/i386/pc.c
    M include/qemu/compiler.h
    M include/ui/console.h
    M include/ui/input.h
    M include/ui/qemu-pixman.h
    M scripts/analyze-migration.py
    M ui/cocoa.m
    M ui/console.c
    M ui/dbus-console.c
    M ui/gtk.c
    M ui/input.c
    M ui/qemu-pixman.c
    M ui/sdl2.c
    M ui/spice-input.c
    M ui/trace-events
    M ui/vnc.c
    M util/oslib-win32.c

  Log Message:
  -----------
  Merge tag 'misc-pull-request' of https://gitlab.com/marcandre.lureau/qemu 
into staging

Misc fixes and cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmUcClAcHG1hcmNhbmRy
# ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5R5FD/9oeCDGXVzkm52K0DoW
# 90N5Blda/3exvnS49TEz+rbIxXcy9IBxEKV3aPesCDw0V7Vxy6ZijPA/aHKzQEeP
# DOX+0sELWLFRKvNNuXLxPlZcEQDgXkgqoCKf+0jp5oH7TAL2upezMhIr4XlUwG3v
# rKQstpmr0Jm9sjsBTL9uIZCJpzglWk7CIbgAlBjOX6MFz0HAManrhBBuguvSZtrW
# wYWrdkBEdTK6ranBvRA3IKi4ux/pmNsCpCtuOVT+WOLjC/wmJIE8+pBzlK9eOdqW
# bPaxuu4XK1qao1+z6EyoaUtH/UW50EUInGq7aR2Z31/S1BLxqEpFCCnPAw7RGYZO
# VlAuiR2U7K7AHFDfp8fJaUNH8a3Zh2wzpba5cyQ7LqVNRVbDhx65sQZw0pA3pjfi
# JG0brIpWldD7auJtZTdCxXcoHWxeyfqqzH3a6GpeZzrRwuuAwxv0+yGF3Y2cMJ7+
# lV9JVcei5M+Acq1UfO4BCC77UpXs4Jl0+zyRq02vOJFnfwcLMQ7VjD2A3e00yodj
# F5cPnbacI212ynNm925RNv45svaY1hD2Z8kJRV/15/04m9dRv4WHOOTuF3iwZjt1
# 9gp/p949tcEL/rBbDF+9QZiVHTWurVCQ0ZFnNhVnbKm+Hm5nHk5slc2p+VXQ0KB0
# E2mN1irWzLov0K1YZTfetiXo8A==
# =3ol2
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 03 Oct 2023 08:34:24 EDT
# gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
# gpg:                issuer "marcandre.lureau@redhat.com"
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" 
[full]
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" 
[full]
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* tag 'misc-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
  chardev/char-pty: Avoid losing bytes when the other side just (re-)connected
  hw/display/ramfb: plug slight guest-triggerable leak on mode setting
  hw/pc: remove needless includes
  hw/core: remove needless includes
  analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH
  ui/gtk: fix UI info precondition
  win32: avoid discarding the exception handler
  ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map
  ui/console: sanitize search in qemu_graphic_console_is_multihead()
  ui/console: eliminate QOM properties from qemu_console_is_multihead()
  ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead()
  ui/console: make qemu_console_is_multihead() static
  input: Allow to choose console with qemu_input_is_absolute

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


  Commit: 52f20ea8ee1bf3f22cb253e9c031c2c77614227c
      
https://github.com/qemu/qemu/commit/52f20ea8ee1bf3f22cb253e9c031c2c77614227c
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS
    R accel/accel-common.c
    A accel/accel-target.c
    M accel/dummy-cpus.c
    M accel/hvf/hvf-accel-ops.c
    M accel/kvm/kvm-accel-ops.c
    M accel/meson.build
    M accel/tcg/atomic_template.h
    M accel/tcg/cpu-exec-common.c
    M accel/tcg/cpu-exec.c
    M accel/tcg/cputlb.c
    A accel/tcg/icount-common.c
    A accel/tcg/internal-common.h
    A accel/tcg/internal-target.h
    R accel/tcg/internal.h
    M accel/tcg/ldst_atomicity.c.inc
    M accel/tcg/ldst_common.c.inc
    M accel/tcg/meson.build
    M accel/tcg/monitor.c
    M accel/tcg/plugin-gen.c
    M accel/tcg/tb-maint.c
    M accel/tcg/tcg-accel-ops-icount.c
    M accel/tcg/tcg-accel-ops-mttcg.c
    M accel/tcg/tcg-accel-ops-rr.c
    M accel/tcg/tcg-accel-ops.c
    M accel/tcg/tcg-all.c
    M accel/tcg/translate-all.c
    M accel/tcg/translator.c
    M accel/tcg/user-exec.c
    M bsd-user/bsd-proc.h
    M bsd-user/main.c
    M bsd-user/signal.c
    A cpu-common.c
    A cpu-target.c
    R cpu.c
    R cpus-common.c
    M docs/about/deprecated.rst
    M gdbstub/gdbstub.c
    M gdbstub/user-target.c
    M hw/core/cpu-common.c
    M hw/i386/kvm/clock.c
    M hw/intc/mips_gic.c
    M hw/intc/riscv_aclint.c
    M hw/intc/riscv_imsic.c
    M hw/ppc/e500.c
    M hw/ppc/spapr.c
    M include/exec/cpu-all.h
    M include/exec/cpu-common.h
    M include/exec/cpu-defs.h
    M include/exec/cpu_ldst.h
    M include/exec/exec-all.h
    M include/hw/core/accel-cpu.h
    M include/hw/core/cpu.h
    M include/qemu/accel.h
    A include/tcg/startup.h
    M include/tcg/tcg.h
    M linux-user/elfload.c
    M linux-user/exit.c
    M linux-user/hppa/signal.c
    M linux-user/i386/cpu_loop.c
    M linux-user/main.c
    M linux-user/signal.c
    M linux-user/syscall.c
    M meson.build
    M meson_options.txt
    M monitor/hmp-cmds-target.c
    A page-vary-target.c
    R page-vary.c
    M qom/object.c
    M scripts/meson-buildoptions.sh
    M semihosting/arm-compat-semi.c
    M semihosting/syscalls.c
    R softmmu/icount.c
    M softmmu/meson.build
    M softmmu/watchpoint.c
    M target/alpha/cpu.c
    M target/alpha/cpu.h
    M target/alpha/translate.c
    M target/arm/common-semi-target.h
    M target/arm/cpu-param.h
    M target/arm/cpu.c
    M target/arm/cpu.h
    M target/arm/cpu64.c
    M target/arm/helper.c
    M target/arm/ptw.c
    M target/arm/tcg/mte_helper.c
    M target/arm/tcg/sve_helper.c
    M target/arm/tcg/tlb_helper.c
    M target/arm/tcg/translate-a32.h
    M target/arm/tcg/translate-a64.c
    M target/arm/tcg/translate-a64.h
    M target/arm/tcg/translate-m-nocp.c
    M target/arm/tcg/translate-mve.c
    M target/arm/tcg/translate-neon.c
    M target/arm/tcg/translate-sme.c
    M target/arm/tcg/translate-sve.c
    M target/arm/tcg/translate-vfp.c
    M target/arm/tcg/translate.c
    M target/arm/tcg/translate.h
    M target/avr/cpu.c
    M target/avr/cpu.h
    M target/avr/translate.c
    M target/cris/cpu.c
    M target/cris/cpu.h
    M target/cris/translate.c
    M target/cris/translate_v10.c.inc
    M target/hexagon/README
    M target/hexagon/cpu.c
    M target/hexagon/cpu.h
    M target/hexagon/gen_tcg.h
    M target/hexagon/gen_tcg_funcs.py
    M target/hexagon/gen_tcg_hvx.h
    M target/hexagon/genptr.c
    M target/hexagon/idef-parser/parser-helpers.c
    M target/hexagon/macros.h
    M target/hexagon/translate.c
    M target/hppa/cpu.c
    M target/hppa/cpu.h
    M target/hppa/mem_helper.c
    M target/hppa/translate.c
    M target/i386/cpu.c
    M target/i386/cpu.h
    M target/i386/hvf/hvf-cpu.c
    M target/i386/kvm/kvm-cpu.c
    M target/i386/nvmm/nvmm-all.c
    M target/i386/tcg/decode-new.c.inc
    M target/i386/tcg/emit.c.inc
    M target/i386/tcg/sysemu/excp_helper.c
    M target/i386/tcg/tcg-cpu.c
    M target/i386/tcg/translate.c
    M target/i386/whpx/whpx-all.c
    M target/loongarch/cpu.c
    M target/loongarch/cpu.h
    M target/loongarch/insn_trans/trans_atomic.c.inc
    M target/loongarch/insn_trans/trans_branch.c.inc
    M target/loongarch/insn_trans/trans_extra.c.inc
    M target/loongarch/insn_trans/trans_farith.c.inc
    M target/loongarch/insn_trans/trans_fcmp.c.inc
    M target/loongarch/insn_trans/trans_fmemory.c.inc
    M target/loongarch/insn_trans/trans_fmov.c.inc
    M target/loongarch/insn_trans/trans_memory.c.inc
    M target/loongarch/insn_trans/trans_privileged.c.inc
    M target/loongarch/insn_trans/trans_vec.c.inc
    M target/loongarch/translate.c
    M target/m68k/cpu.c
    M target/m68k/cpu.h
    M target/m68k/translate.c
    M target/microblaze/cpu.c
    M target/microblaze/cpu.h
    M target/microblaze/translate.c
    M target/mips/cpu.c
    M target/mips/cpu.h
    M target/mips/tcg/lcsr_translate.c
    M target/mips/tcg/micromips_translate.c.inc
    M target/mips/tcg/msa_translate.c
    M target/mips/tcg/mxu_translate.c
    M target/mips/tcg/nanomips_translate.c.inc
    M target/mips/tcg/sysemu/mips-semi.c
    M target/mips/tcg/translate.c
    M target/mips/tcg/translate.h
    M target/mips/tcg/vr54xx_translate.c
    M target/nios2/cpu.c
    M target/nios2/cpu.h
    M target/nios2/translate.c
    M target/openrisc/cpu.c
    M target/openrisc/cpu.h
    M target/openrisc/translate.c
    M target/ppc/cpu.h
    M target/ppc/cpu_init.c
    M target/ppc/excp_helper.c
    M target/ppc/power8-pmu-regs.c.inc
    M target/ppc/translate.c
    M target/ppc/translate/branch-impl.c.inc
    M target/ppc/translate/dfp-impl.c.inc
    M target/ppc/translate/fixedpoint-impl.c.inc
    M target/ppc/translate/fp-impl.c.inc
    M target/ppc/translate/processor-ctrl-impl.c.inc
    M target/ppc/translate/spe-impl.c.inc
    M target/ppc/translate/storage-ctrl-impl.c.inc
    M target/ppc/translate/vmx-impl.c.inc
    M target/ppc/translate/vsx-impl.c.inc
    M target/riscv/cpu.c
    M target/riscv/cpu.h
    M target/riscv/insn_trans/trans_privileged.c.inc
    M target/riscv/insn_trans/trans_rvbf16.c.inc
    M target/riscv/insn_trans/trans_rvd.c.inc
    M target/riscv/insn_trans/trans_rvf.c.inc
    M target/riscv/insn_trans/trans_rvh.c.inc
    M target/riscv/insn_trans/trans_rvi.c.inc
    M target/riscv/insn_trans/trans_rvm.c.inc
    M target/riscv/insn_trans/trans_rvv.c.inc
    M target/riscv/insn_trans/trans_rvvk.c.inc
    M target/riscv/insn_trans/trans_rvzce.c.inc
    M target/riscv/insn_trans/trans_rvzfa.c.inc
    M target/riscv/insn_trans/trans_rvzfh.c.inc
    M target/riscv/insn_trans/trans_rvzicbo.c.inc
    M target/riscv/insn_trans/trans_svinval.c.inc
    M target/riscv/insn_trans/trans_xthead.c.inc
    M target/riscv/translate.c
    M target/rx/cpu.c
    M target/rx/cpu.h
    M target/rx/translate.c
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/tcg/translate.c
    M target/s390x/tcg/translate_vx.c.inc
    M target/sh4/cpu.c
    M target/sh4/cpu.h
    M target/sh4/op_helper.c
    M target/sh4/translate.c
    M target/sparc/cpu.c
    M target/sparc/cpu.h
    M target/sparc/translate.c
    M target/tricore/cpu.c
    M target/tricore/cpu.h
    M target/tricore/translate.c
    M target/xtensa/cpu.c
    M target/xtensa/cpu.h
    M target/xtensa/translate.c
    M tcg/aarch64/tcg-target.c.inc
    M tcg/arm/tcg-target.c.inc
    M tcg/loongarch64/tcg-target.c.inc
    M tcg/tcg-op-gvec.c
    M tcg/tcg-op-ldst.c
    M tcg/tcg-op.c
    M tcg/tcg.c
    M tests/avocado/boot_linux_console.py
    M tests/avocado/machine_mips_malta.py
    M tests/avocado/replay_kernel.py
    M tests/avocado/tuxrun_baselines.py
    M tests/qemu-iotests/meson.build

  Log Message:
  -----------
  Merge tag 'pull-tcg-20231003' of https://gitlab.com/rth7680/qemu into staging

accel: Introduce AccelClass::cpu_common_[un]realize
accel: Target agnostic code movement
accel/tcg: Cleanups to use CPUState instead of CPUArchState
accel/tcg: Move CPUNegativeOffsetState into CPUState
tcg: Split out tcg init functions to tcg/startup.h
linux-user/hppa: Fix struct target_sigcontext layout
build: Remove --enable-gprof

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmUcT1sdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV8kxggAmZ4JKNY1I2iE4oDZ
# HcOjLFzhz/yW39hwHS5Zrv0QWmd2uMzV0ZRXLDxps+ym2gzxJxaHOVsrDdmKzoNx
# VeSGWyWDpfEHqFBHMBz7pxW06zc/IxiRDp+WuzSGDbUCaJ6XeM9Va60ho6CbcXkD
# s9Q0w42GXuyjvTc9uWuY4EEnPW0dgAECQ8lBaU4hNkPxibuVWjNIlX5+Npv1CMd/
# Pg/lm1jRkgMkNPDe8u/mWCv8eWyYG2bEQ6EpwLsIIDcdb6FDKY2R/oAxT5X2Cz4y
# YqP3/kmPulQ5r+5uLUg3ajnAs2I7WL7bOWcCWzzJGo/yxwTRHqaDE0liYme2xbPl
# x3othg==
# =io+f
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 03 Oct 2023 13:28:59 EDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-tcg-20231003' of https://gitlab.com/rth7680/qemu: (47 commits)
  tcg/loongarch64: Fix buid error
  tests/avocado: Re-enable MIPS Malta tests (GitLab issue #1884 fixed)
  build: Remove --enable-gprof
  linux-user/hppa: Fix struct target_sigcontext layout
  tcg: Split out tcg init functions to tcg/startup.h
  tcg: Remove argument to tcg_prologue_init
  accel/tcg: Make cpu-exec-common.c a target agnostic unit
  accel/tcg: Make icount.o a target agnostic unit
  accel/tcg: Make monitor.c a target-agnostic unit
  accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'
  exec: Rename target specific page-vary.c -> page-vary-target.c
  exec: Rename cpu.c -> cpu-target.c
  accel: Rename accel-common.c -> accel-target.c
  accel: Make accel-blocker.o target agnostic
  accel/tcg: Restrict dump_exec_info() declaration
  exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'
  exec: Make EXCP_FOO definitions target agnostic
  accel/tcg: move ld/st helpers to ldst_common.c.inc
  accel/tcg: Unify user and softmmu do_[st|ld]*_mmu()
  accel/tcg: Remove env_tlb()
  ...

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


  Commit: 7e4b79d7cd83670cd12f6c7364b5d6011ab80ac0
      
https://github.com/qemu/qemu/commit/7e4b79d7cd83670cd12f6c7364b5d6011ab80ac0
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    A bsd-user/bsd-mem.c
    A bsd-user/bsd-mem.h
    A bsd-user/bsd-proc.c
    M bsd-user/bsd-proc.h
    M bsd-user/freebsd/meson.build
    A bsd-user/freebsd/os-misc.h
    A bsd-user/freebsd/os-proc.c
    A bsd-user/freebsd/os-proc.h
    M bsd-user/freebsd/os-syscall.c
    M bsd-user/main.c
    M bsd-user/meson.build
    M bsd-user/mmap.c
    A bsd-user/qemu-bsd.h
    M bsd-user/qemu.h
    M bsd-user/signal-common.h
    M bsd-user/signal.c
    M bsd-user/syscall_defs.h

  Log Message:
  -----------
  Merge tag 'bsd-user-mmap-pull-request' of https://gitlab.com/bsdimp/qemu into 
staging

bsd-user mmap and exec branches from gsoc

This pull request represents the mmap and exec changes from Karim Taha
for his GSoC project.

They represent all the mmap and exec related system calls and get bsd-user to
the point that a dynamic hello-world works (at least for armv7).

There are a couple of patch check errors, but they are the lessor evil: I made
purposely bad style choices to ensure all the commits compiled (and i undid the
style choices in subsequent commits).

I pushed an earlier version to gitlab, and all but the riscv64 pipelines were
green.  Since bsd-user doesn't change anything related to ricsv64 (there's no
support in qemu-project repo, though we do have it in the bsd-user fork: coming
soon).

I think this is good to go.

https://gitlab.com/bsdimp/qemu.git

Warner

# -----BEGIN PGP SIGNATURE-----
# Comment: GPGTools - https://gpgtools.org
#
# iQIzBAABCgAdFiEEIDX4lLAKo898zeG3bBzRKH2wEQAFAmUcpC4ACgkQbBzRKH2w
# EQDD9xAA3Rg0AnfnFrd+AoWRb/1/gOuO0v+dEGXj50qnGY8OmHeYtg3XecYPArBq
# EicZzL/OG7UZKMl5OfrmGP9tbr32yfeRUTe3AGGHfmnSb11q0yeSaEFZI7felLHj
# 9nlq4H/2EDRrY+7EnG1TWqtnuqDJAJf/7M0giiVxIk77XGX+USUNPOSG4NP/yc8E
# D5p2GN23pUsvnI0jBZkyP3gyeXVNCNG5+KobwqJM3r6OjEiTRmLEVBw98YzG12bh
# OY9ekMtVUKHi4Cvsf+2TtkDGRya0wX4uqm4UB1TtV1VUDoCWhYgEKBHp3ozCoVjB
# J+ygbx7/jNfY53cpgEpKUBFH7rnOq1yQQ+ad5Ap5hbp4j6WSvPwdp1N3RCnkZzd/
# L50VIaySd+P6enAgPO5Mbt3kMMVd/eDGhQDWdzNToIjyhXBb5hUNfumg9AgdEwTh
# rW/kKT39YLYWLO123hIJCy2CKU9nvoea9588ExkKb22v0ltrtDcAlWfCbZvZYxNN
# wRzh+MFBt7Cd/bqk7HaJ0J/YyPToqImoUjNuBnBSDPqZQP2H4U8v/FoICQ0mm5kR
# jZCmGLMEP1PiDlusjUjaW0iamHvXiSP8KEzaAbIxx5UUiTWTTkQm4CKY/xPxC9VQ
# 0ygJqJVrKHlNrAY9u6ggJAXtorVwmC55z4ZqIVQH6cbzUYFMuJU=
# =WpL4
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 03 Oct 2023 19:30:54 EDT
# gpg:                using RSA key 2035F894B00AA3CF7CCDE1B76C1CD1287DB01100
# gpg: Good signature from "Warner Losh <wlosh@netflix.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@bsdimp.com>" [unknown]
# gpg:                 aka "Warner Losh <imp@freebsd.org>" [unknown]
# gpg:                 aka "Warner Losh <imp@village.org>" [unknown]
# gpg:                 aka "Warner Losh <wlosh@bsdimp.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 2035 F894 B00A A3CF 7CCD  E1B7 6C1C D128 7DB0 1100

* tag 'bsd-user-mmap-pull-request' of https://gitlab.com/bsdimp/qemu: (51 
commits)
  bsd-user: Add stubs for vadvise(), sbrk() and sstk()
  bsd-user: Implement shmat(2) and shmdt(2)
  bsd-user: Implement shmctl(2)
  bsd-user: Implement shm_unlink(2) and shmget(2)
  bsd-user: Implement shm_open(2)
  bsd-user: Implement do_obreak function
  bsd-user: Implement mincore(2)
  bsd-user: Implment madvise(2) to match the linux-user implementation.
  bsd-user: Implement mlock(2), munlock(2), mlockall(2), munlockall(2), 
minherit(2)
  bsd-user: Implement msync(2)
  bsd-user: Implement mprotect(2)
  bsd-user: Implement mmap(2) and munmap(2)
  bsd-user: Introduce bsd-mem.h to the source tree
  bsd-user: Implement shmid_ds conversion between host and target.
  bsd-user: Implement ipc_perm conversion between host and target.
  bsd-user: Implement target_set_brk function in bsd-mem.c instead of 
os-syscall.c
  bsd-user: Add bsd-mem.c to meson.build
  bsd-user: Implement shm_rename(2) system call
  bsd-user: Implement shm_open2(2) system call
  bsd-user: Introduce freebsd/os-misc.h to the source tree
  ...

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


  Commit: e6fe25c94b31a916c145ba04a7c49db3b7f13965
      
https://github.com/qemu/qemu/commit/e6fe25c94b31a916c145ba04a7c49db3b7f13965
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS
    M docs/interop/vhost-user.rst
    M hw/acpi/acpi-x86-stub.c
    M hw/acpi/core.c
    M hw/acpi/cpu.c
    M hw/acpi/cxl.c
    M hw/acpi/hmat.c
    M hw/acpi/hmat.h
    M hw/acpi/memory_hotplug.c
    M hw/acpi/piix4.c
    M hw/acpi/trace-events
    M hw/core/machine.c
    M hw/cxl/cxl-component-utils.c
    M hw/cxl/cxl-host.c
    M hw/display/meson.build
    A hw/display/virtio-dmabuf.c
    M hw/i386/acpi-build.c
    M hw/i386/acpi-common.c
    M hw/i386/acpi-common.h
    M hw/i386/acpi-microvm.c
    M hw/i386/amd_iommu.c
    M hw/i386/amd_iommu.h
    R hw/i386/generic_event_device_x86.c
    M hw/i386/meson.build
    M hw/i386/microvm.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/isa/lpc_ich9.c
    M hw/mem/cxl_type3.c
    M hw/net/virtio-net.c
    M hw/pci-bridge/cxl_upstream.c
    M hw/pci/pci.c
    M hw/pci/pci_bridge.c
    M hw/pci/pcie_sriov.c
    M hw/scsi/vhost-user-scsi.c
    M hw/virtio/meson.build
    M hw/virtio/trace-events
    M hw/virtio/vdpa-dev.c
    M hw/virtio/vhost-shadow-virtqueue.c
    M hw/virtio/vhost-shadow-virtqueue.h
    A hw/virtio/vhost-user-device-pci.c
    A hw/virtio/vhost-user-device.c
    M hw/virtio/vhost-user-gpio.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost-vdpa.c
    M hw/virtio/virtio-qmp.c
    M hw/virtio/virtio-qmp.h
    M hw/virtio/virtio.c
    M include/exec/memory.h
    M include/hw/acpi/acpi_dev_interface.h
    M include/hw/acpi/cpu.h
    M include/hw/acpi/cxl.h
    M include/hw/acpi/generic_event_device.h
    M include/hw/cxl/cxl_component.h
    M include/hw/i386/pc.h
    M include/hw/pci/pci_bridge.h
    M include/hw/virtio/vhost-backend.h
    A include/hw/virtio/vhost-user-device.h
    M include/hw/virtio/vhost-user.h
    M include/hw/virtio/vhost-vdpa.h
    A include/hw/virtio/virtio-dmabuf.h
    M include/hw/virtio/virtio-net.h
    M include/qemu/uuid.h
    M net/vhost-vdpa.c
    M subprojects/libvhost-user/libvhost-user.c
    M subprojects/libvhost-user/libvhost-user.h
    M tests/data/acpi/q35/DSDT.cxl
    M tests/qtest/bios-tables-test.c
    M tests/qtest/numa-test.c
    M tests/unit/meson.build
    M tests/unit/test-uuid.c
    A tests/unit/test-virtio-dmabuf.c
    M util/uuid.c

  Log Message:
  -----------
  Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu 
into staging

virtio,pci: features, cleanups

vdpa:
      shadow vq vlan support
      net migration with cvq
cxl:
     dummy ACPI QTG DSM
     support emulating 4 HDM decoders
     serial number extended capability
virtio:
      hared dma-buf

Fixes, cleanups all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

* tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (63 
commits)
  libvhost-user: handle shared_object msg
  vhost-user: add shared_object msg
  hw/display: introduce virtio-dmabuf
  util/uuid: add a hash function
  virtio: remove unused next argument from virtqueue_split_read_next_desc()
  virtio: remove unnecessary thread fence while reading next descriptor
  virtio: use shadow_avail_idx while checking number of heads
  libvhost-user.c: add assertion to vu_message_read_default
  pcie_sriov: unregister_vfs(): fix error path
  hw/i386/pc: improve physical address space bound check for 32-bit x86 systems
  amd_iommu: Fix APIC address check
  vdpa net: follow VirtIO initialization properly at cvq isolation probing
  vdpa net: stop probing if cannot set features
  vdpa net: fix error message setting virtio status
  hw/pci-bridge/cxl-upstream: Add serial number extended capability support
  hw/cxl: Support 4 HDM decoders at all levels of topology
  hw/cxl: Fix and use same calculation for HDM decoder block size everywhere
  hw/cxl: Add utility functions decoder interleave ways and target count.
  hw/cxl: Push cxl_decoder_count_enc() and cxl_decode_ig() into .c
  vdpa net: zero vhost_vdpa iova_tree pointer at cleanup
  ...

Conflicts:
  hw/core/machine.c
  Context conflict due to #include changes in commit
  314e0a84cd5d3a8d04c9778eecb5618dee3574cf ("hw/core: remove needless
  includes").


  Commit: 401a8f379ecdae75f2ee72f5bae7a3616ae88972
      
https://github.com/qemu/qemu/commit/401a8f379ecdae75f2ee72f5bae7a3616ae88972
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M MAINTAINERS
    M include/migration/vmstate.h
    A migration/file.c
    A migration/file.h
    M migration/meson.build
    M migration/migration.c
    M migration/rdma.c
    M migration/savevm.c
    M migration/trace-events
    M migration/vmstate.c
    M qemu-options.hx
    M tests/migration/i386/a-b-bootblock.S
    M tests/migration/i386/a-b-bootblock.h
    M tests/migration/s390x/a-b-bios.c
    M tests/migration/s390x/a-b-bios.h

  Log Message:
  -----------
  Merge tag 'migration-20231004-pull-request' of 
https://gitlab.com/juan.quintela/qemu into staging

Migration Pull request (20231004)

Hi

In this series:

* make sure migration-tests get 0's (daniil)
  Notice that this creates a checkpatch negative, everything on that
  file is volatile, no need to add a comment.

* RDMA fix from li
* MAINTAINERS
  Get peter and fabiano to become co-maintainers of migration
  Get Entry fro migration-rdma for Li Zhijian
* Create field_exists() (peterx)
* Improve error messages (Tejus)

Please apply.

s

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmUdXTwACgkQ9IfvGFhy
# 1yPFPg//awd8HpoLs1Cq6zquBRivZOS88+tstwlBIODoU3lwPlriGU9Wquv8MqxG
# NGvcUKVsv1XXsRWYsqN3OPV6m+uRZpKrFfXEnIGNpHptf/e6KrrDGAttukalhx4n
# hJXCAActe9DlujSu+QI0L/j7R9S33zvLS46sjq7jaYLQLMzuEf5i+hiEPWfPP7AT
# 0SjrtpFaqIOGY4+VKteDirP7zJtu1+WEMVFgtAUeh3c0R8UAOsxVzBjfM3+KagIx
# NnYesFZoaOjVi1Xi1cRII7FmeKZ2OU7VBdYN9h3Y+dRIRjzF/YZOdt6Ypgb1c4gw
# ohpWJWT2tHU1z7nguSFpnqtu8xCeGhwAy+HUn/Az0TP6SCtpKRh23bZpwbfWIrHs
# eSZB6tO/eC/noQ5/d2cSs6pz7P77MkhTfxwD2+n9R4O36vSHEj3dGF0JbgCPr/Kw
# 0qfch9BQkFkAec3kiaZO/JOQ1rJuIMTbdER9gDzIODpUIc5QExs1dFwLoz5IRcpQ
# A1kOqVatMmm8jrvC3lEw76FjMX5pv11DKcS75ogWsSZHGk/jpXWABPEtiamzloqv
# c6owc5f09etkQCzT5ME8AZyZRjt7eeqIxZDZlGCjHbqZ+w/xuDsFJrEdg8YJvRLw
# AmsU5rRT2JV4lDNgZ1XG+xY9HF5LhAXYet5+UrCMBpFGk7JnHIw=
# =il/A
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 04 Oct 2023 08:40:28 EDT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* tag 'migration-20231004-pull-request' of 
https://gitlab.com/juan.quintela/qemu:
  migration: Unify and trace vmstate field_exists() checks
  migration: file URI offset
  migration: file URI
  s390x/a-b-bios: zero the first byte of each page on start
  i386/a-b-bootblock: zero the first byte of each page on start
  i386/a-b-bootblock: factor test memory addresses out into constants
  migration/rdma: zore out head.repeat to make the error more clear
  migration: Add co-maintainers for migration
  MAINTAINERS: Add entry for rdma migration
  migration: Update error description outside migration.c
  migration/vmstate: Introduce vmstate_save_state_with_err

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


  Commit: fd807faa1e1c6ab05c9cc3a9d6f772107b7fc272
      
https://github.com/qemu/qemu/commit/fd807faa1e1c6ab05c9cc3a9d6f772107b7fc272
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M include/qemu/osdep.h
    M meson.build
    M util/coroutine-sigaltstack.c
    M util/coroutine-ucontext.c

  Log Message:
  -----------
  Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmUdbkgACgkQnKSrs4Gr
# c8j03Af/Ww5CrGjvcTefvm6W65zTh6Di6ymUn59eqIpjpDbWTPruhnsrJFtNEo3Z
# wv8hcxgc+wP8Y7BbZiwiNrSZsjQ1y8rReeO+Eoe9YZoRTMy8aJYaASXvs9TWZoMT
# IjqPR6YEAEzh+30zLaPje/Lfy49Ni2Lqsg/fKsozl0b2LrZoEN5xJMHqI8CuRrzB
# JmtX4nCkaf/P0yvW1MAp4Dxiuqgk3Z7n2+F1Qrjklw1eSZsc6Mi9QmEwuzX4rnKO
# tzU2EApDWNvFQ604H86XHqWqXIw4C+7nNl81kOIZhUqIRamPD8bCNAeijkthmdLF
# l4EIOqSDX8nkxuddRS7jQmHxlIw18g==
# =26iN
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 04 Oct 2023 09:53:12 EDT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [ultimate]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [ultimate]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  osdep: set _FORTIFY_SOURCE=2 when optimization is enabled

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


Compare: https://github.com/qemu/qemu/compare/da1034094d37...fd807faa1e1c



reply via email to

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