qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7656d9: virtio-mem: Don't skip alignment chec


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 7656d9: virtio-mem: Don't skip alignment checks when warni...
Date: Fri, 07 Jan 2022 17:25:19 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 7656d9ce09cb1d6d76eeb2081f164a920361d1d3
      
https://github.com/qemu/qemu/commit/7656d9ce09cb1d6d76eeb2081f164a920361d1d3
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  virtio-mem: Don't skip alignment checks when warning about block size

If we warn about the block size being smaller than the default, we skip
some alignment checks.

This can currently only fail on x86-64, when specifying a block size of
1 MiB, however, we detect the THP size of 2 MiB.

Fixes: 228957fea3a9 ("virtio-mem: Probe THP size to determine default block 
size")
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211011173305.13778-1-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 9bd6565ccee68f72d5012e24646e12a1c662827e
      
https://github.com/qemu/qemu/commit/9bd6565ccee68f72d5012e24646e12a1c662827e
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

  Changed paths:
    M hw/acpi/pcihp.c

  Log Message:
  -----------
  acpi: validate hotplug selector on access

When bus is looked up on a pci write, we didn't
validate that the lookup succeeded.
Fuzzers thus can trigger QEMU crash by dereferencing the NULL
bus pointer.

Fixes: b32bd763a1 ("pci: introduce acpi-index property for PCI device")
Fixes: CVE-2021-4158
Cc: "Igor Mammedov" <imammedo@redhat.com>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/770
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>


  Commit: bf1d85c166c19af95dbd27b1faba1d2909732323
      
https://github.com/qemu/qemu/commit/bf1d85c166c19af95dbd27b1faba1d2909732323
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

  Changed paths:
    M hw/display/vhost-user-gpu.c
    M hw/net/virtio-net.c
    M hw/virtio/vhost-user-fs.c
    M hw/virtio/vhost-vsock-common.c
    M hw/virtio/virtio-crypto.c
    M include/hw/virtio/virtio.h

  Log Message:
  -----------
  virtio: introduce macro IRTIO_CONFIG_IRQ_IDX

To support configure interrupt for vhost-vdpa
Introduce VIRTIO_CONFIG_IRQ_IDX -1 as configure interrupt's queue index,
Then we can reuse the functions guest_notifier_mask and guest_notifier_pending.
Add the check of queue index in these drivers, if the driver does not support
configure interrupt, the function will just return

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-2-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e3480ef81f6fb61cc9c04e3b5be8b7e84484fc05
      
https://github.com/qemu/qemu/commit/e3480ef81f6fb61cc9c04e3b5be8b7e84484fc05
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  virtio-pci: decouple notifier from interrupt process

To reuse the notifier process in configure interrupt.
Use the virtio_pci_get_notifier function to get the notifier.
the INPUT of this function is the IDX, the OUTPUT is notifier and
the vector

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-3-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 316011b8a74e777eb3ba03171cd701a291c28867
      
https://github.com/qemu/qemu/commit/316011b8a74e777eb3ba03171cd701a291c28867
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  virtio-pci: decouple the single vector from the interrupt process

To reuse the interrupt process in configure interrupt
Need to decouple the single vector from the interrupt process. Add new function
kvm_virtio_pci_vector_use_one and _release_one. These functions are use
for the single vector, the whole process will finish in a loop for the vq 
number.

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-4-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 88062372340d33090b7f089ed3b1a00f530a8914
      
https://github.com/qemu/qemu/commit/88062372340d33090b7f089ed3b1a00f530a8914
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

  Changed paths:
    M include/hw/virtio/vhost-backend.h

  Log Message:
  -----------
  vhost: introduce new VhostOps vhost_set_config_call

This patch introduces new VhostOps vhost_set_config_call. This function allows 
the
vhost to set the event fd to kernel

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-5-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 634f7c89fbd78f57d00d5d6b39c0ade9df1fe27f
      
https://github.com/qemu/qemu/commit/634f7c89fbd78f57d00d5d6b39c0ade9df1fe27f
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  vhost-vdpa: add support for config interrupt

Add new call back function in vhost-vdpa, this function will
set the event fd to kernel. This function will be called
in the vhost_dev_start and vhost_dev_stop

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-6-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 081f864f56307551f59c5e934e3f30a7290d0faa
      
https://github.com/qemu/qemu/commit/081f864f56307551f59c5e934e3f30a7290d0faa
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  virtio: add support for configure interrupt

Add the functions to support the configure interrupt in virtio
The function virtio_config_guest_notifier_read will notify the
guest if there is an configure interrupt.
The function virtio_config_set_guest_notifier_fd_handler is
to set the fd hander for the notifier

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-7-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f7220a7ce21604a4bc6260ccca4dc9068c1f27f2
      
https://github.com/qemu/qemu/commit/f7220a7ce21604a4bc6260ccca4dc9068c1f27f2
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-06 (Thu, 06 Jan 2022)

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

  Log Message:
  -----------
  vhost: add support for configure interrupt

Add functions to support configure interrupt.
The configure interrupt process will start in vhost_dev_start
and stop in vhost_dev_stop.

Also add the functions to support vhost_config_pending and
vhost_config_mask, for masked_config_notifier, we only
use the notifier saved in vq 0.

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-8-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 497679d51087090d5a22fd265d1b96cf92d49d9d
      
https://github.com/qemu/qemu/commit/497679d51087090d5a22fd265d1b96cf92d49d9d
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio-net: add support for configure interrupt

Add functions to support configure interrupt in virtio_net
The functions are config_pending and config_mask, while
this input idx is VIRTIO_CONFIG_IRQ_IDX will check the
function of configure interrupt.

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-9-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d48185f1a40d4e4ed2fa2873a42b2a5eb8748256
      
https://github.com/qemu/qemu/commit/d48185f1a40d4e4ed2fa2873a42b2a5eb8748256
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio-mmio: add support for configure interrupt

Add configure interrupt support for virtio-mmio bus. This
interrupt will be working while the backend is vhost-vdpa

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-10-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d5d24d859c3957ea1674d0e102f96439cdbfe93a
      
https://github.com/qemu/qemu/commit/d5d24d859c3957ea1674d0e102f96439cdbfe93a
  Author: Cindy Lu <lulu@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio-pci: add support for configure interrupt

Add support for configure interrupt, The process is used kvm_irqfd_assign
to set the gsi to kernel. When the configure notifier was signal by
host, qemu will inject a msix interrupt to guest

Signed-off-by: Cindy Lu <lulu@redhat.com>
Message-Id: <20211104164827.21911-11-lulu@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: deeb956c40e3b6f8ab95f7b53f148a836cf93da2
      
https://github.com/qemu/qemu/commit/deeb956c40e3b6f8ab95f7b53f148a836cf93da2
  Author: Laurent Vivier <lvivier@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/pci/pci.c
    M hw/pci/pci_host.c
    M hw/pci/trace-events

  Log Message:
  -----------
  trace-events,pci: unify trace events format

Unify format used by trace_pci_update_mappings_del(),
trace_pci_update_mappings_add(), trace_pci_cfg_write() and
trace_pci_cfg_read() to print the device name and bus number,
slot number and function number.

For instance:

  pci_cfg_read virtio-net-pci 00:0 @0x20 -> 0xffffc00c
  pci_cfg_write virtio-net-pci 00:0 @0x20 <- 0xfea0000c
  pci_update_mappings_del d=0x555810b92330 01:00.0 4,0xffffc000+0x4000
  pci_update_mappings_add d=0x555810b92330 01:00.0 4,0xfea00000+0x4000

becomes

  pci_cfg_read virtio-net-pci 01:00.0 @0x20 -> 0xffffc00c
  pci_cfg_write virtio-net-pci 01:00.0 @0x20 <- 0xfea0000c
  pci_update_mappings_del virtio-net-pci 01:00.0 4,0xffffc000+0x4000
  pci_update_mappings_add virtio-net-pci 01:00.0 4,0xfea00000+0x4000

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20211105192541.655831-1-lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Yanan Wang <wangyanan55@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b7107e758f4ecdd8f07ede3f093cbbfdb623e865
      
https://github.com/qemu/qemu/commit/b7107e758f4ecdd8f07ede3f093cbbfdb623e865
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/block/vhost-user-blk.c

  Log Message:
  -----------
  vhost-user-blk: reconnect on any error during realize

vhost-user-blk realize only attempts to reconnect if the previous
connection attempt failed on "a problem with the connection and not an
error related to the content (which would fail again the same way in the
next attempt)".

However this distinction is very subtle, and may be inadvertently broken
if the code changes somewhere deep down the stack and a new error gets
propagated up to here.

OTOH now that the number of reconnection attempts is limited it seems
harmless to try reconnecting on any error.

So relax the condition of whether to retry connecting to check for any
error.

This patch amends a527e312b5 "vhost-user-blk: Implement reconnection
during realize".

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-2-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>


  Commit: e87975051ee6071dec12d318e45a28d4770c2dd0
      
https://github.com/qemu/qemu/commit/e87975051ee6071dec12d318e45a28d4770c2dd0
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev/char-socket: tcp_chr_recv: don't clobber errno

tcp_chr_recv communicates the specific error condition to the caller via
errno.  However, after setting it, it may call into some system calls or
library functions which can clobber the errno.

Avoid this by moving the errno assignment to the end of the function.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-3-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: 666265036fec3fd3eed2d55ae828c915a084a1d6
      
https://github.com/qemu/qemu/commit/666265036fec3fd3eed2d55ae828c915a084a1d6
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M chardev/char-socket.c

  Log Message:
  -----------
  chardev/char-socket: tcp_chr_sync_read: don't clobber errno

After the return from tcp_chr_recv, tcp_chr_sync_read calls into a
function which eventually makes a system call and may clobber errno.

Make a copy of errno right after tcp_chr_recv and restore the errno on
return from tcp_chr_sync_read.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-4-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


  Commit: 6dcae534e82520aa2280009de4b78a19059e8bbb
      
https://github.com/qemu/qemu/commit/6dcae534e82520aa2280009de4b78a19059e8bbb
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  vhost-backend: avoid overflow on memslots_limit

Fix the (hypothetical) potential problem when the value parsed out of
the vhost module parameter in sysfs overflows the return value from
vhost_kernel_memslots_limit.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-6-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394
      
https://github.com/qemu/qemu/commit/2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  vhost-backend: stick to -errno error return convention

Almost all VhostOps methods in kernel_ops follow the convention of
returning negated errno on error.

Adjust the only one that doesn't.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-7-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


  Commit: 3631151b3e3c53ce70c370e68241e9876e2dbb3a
      
https://github.com/qemu/qemu/commit/3631151b3e3c53ce70c370e68241e9876e2dbb3a
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  vhost-vdpa: stick to -errno error return convention

Almost all VhostOps methods in vdpa_ops follow the convention of
returning negated errno on error.

Adjust the few that don't.  To that end, rework vhost_vdpa_add_status to
check if setting of the requested status bits has succeeded and return
the respective error code it hasn't, and propagate the error codes
wherever it's appropriate.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-8-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 025faa872bcf919259465419bee443b8a3ce3da1
      
https://github.com/qemu/qemu/commit/025faa872bcf919259465419bee443b8a3ce3da1
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  vhost-user: stick to -errno error return convention

VhostOps methods in user_ops are not very consistent in their error
returns: some return negated errno while others just -1.

Make sure all of them consistently return negated errno.  This also
helps error propagation from the functions being called inside.
Besides, this synchronizes the error return convention with the other
two vhost backends, kernel and vdpa, and will therefore allow for
consistent error propagation in the generic vhost code (in a followup
patch).

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-9-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604
      
https://github.com/qemu/qemu/commit/5d33ae4b7a9a1f57cca4fde1dc8d16bc46d0f604
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/virtio/vhost.c

  Log Message:
  -----------
  vhost: stick to -errno error return convention

The generic vhost code expects that many of the VhostOps methods in the
respective backends set errno on errors.  However, none of the existing
backends actually bothers to do so.  In a number of those methods errno
from the failed call is clobbered by successful later calls to some
library functions; on a few code paths the generic vhost code then
negates and returns that errno, thus making failures look as successes
to the caller.

As a result, in certain scenarios (e.g. live migration) the device
doesn't notice the first failure and goes on through its state
transitions as if everything is ok, instead of taking recovery actions
(break and reestablish the vhost-user connection, cancel migration, etc)
before it's too late.

To fix this, consolidate on the convention to return negated errno on
failures throughout generic vhost, and use it for error propagation.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-10-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: fb767859345506d747876c23d181155b183f8e94
      
https://github.com/qemu/qemu/commit/fb767859345506d747876c23d181155b183f8e94
  Author: Roman Kagan <rvkagan@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/block/vhost-user-blk.c

  Log Message:
  -----------
  vhost-user-blk: propagate error return from generic vhost

Fix the only callsite that doesn't propagate the error code from the
generic vhost code.

Signed-off-by: Roman Kagan <rvkagan@yandex-team.ru>
Message-Id: <20211111153354.18807-11-rvkagan@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>


  Commit: 2fedf46e34d2377760b2d26cf85487b772bca6fa
      
https://github.com/qemu/qemu/commit/2fedf46e34d2377760b2d26cf85487b772bca6fa
  Author: Frederic Barrat <fbarrat@linux.ibm.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/pci/pci.c
    M include/hw/pci/pci.h

  Log Message:
  -----------
  pci: Export the pci_intx() function

Move the pci_intx() definition to the PCI header file, so that it can
be called from other PCI files. It is used by the next patch.

Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Message-Id: <20211116170133.724751-3-fbarrat@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>


  Commit: 20766514d602c50b870ae943aaa8e5b9e2e8a161
      
https://github.com/qemu/qemu/commit/20766514d602c50b870ae943aaa8e5b9e2e8a161
  Author: Frederic Barrat <fbarrat@linux.ibm.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/pci/pcie_aer.c

  Log Message:
  -----------
  pcie_aer: Don't trigger a LSI if none are defined

Skip triggering an LSI when the AER root error status is updated if no
LSI is defined for the device. We can have a root bridge with no LSI,
MSI and MSI-X defined, for example on POWER systems.

Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Message-Id: <20211116170133.724751-4-fbarrat@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>


  Commit: 10be11d0b48f508646509844bc32b983d4204d2b
      
https://github.com/qemu/qemu/commit/10be11d0b48f508646509844bc32b983d4204d2b
  Author: Eduardo Habkost <ehabkost@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/arm/virt.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/smbios/smbios.c
    M include/hw/firmware/smbios.h

  Log Message:
  -----------
  smbios: Rename SMBIOS_ENTRY_POINT_* enums

Rename the enums to match the naming style used by QAPI, and to
use "32" and "64" instead of "20" and "31".  This will allow us
to more easily move the enum to the QAPI schema later.

About the naming choice: "SMBIOS 2.1 entry point"/"SMBIOS 3.0
entry point" and "32-bit entry point"/"64-bit entry point" are
synonymous in the SMBIOS specification.  However, the phrases
"32-bit entry point" and "64-bit entry point" are used more often.

The new names also avoid confusion between the entry point format
and the actual SMBIOS version reported in the entry point
structure.  For example: currently the 32-bit entry point
actually report SMBIOS 2.8 support, not 2.1.

Based on portions of a patch submitted by Daniel P. Berrangé.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20211026151100.1691925-2-ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: bdf54a9a7bda0bde0c0b7b5767dd670f36ccc9e0
      
https://github.com/qemu/qemu/commit/bdf54a9a7bda0bde0c0b7b5767dd670f36ccc9e0
  Author: Eduardo Habkost <ehabkost@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M include/hw/firmware/smbios.h
    M qapi/machine.json

  Log Message:
  -----------
  hw/smbios: Use qapi for SmbiosEntryPointType

This prepares for exposing the SMBIOS entry point type as a
machine property on x86.

Based on a patch from Daniel P. Berrangé.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20211026151100.1691925-3-ehabkost@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@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>


  Commit: 0e4edb3b3b5770ac325f5df02689154be5e64963
      
https://github.com/qemu/qemu/commit/0e4edb3b3b5770ac325f5df02689154be5e64963
  Author: Eduardo Habkost <ehabkost@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  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

  Log Message:
  -----------
  hw/i386: expose a "smbios-entry-point-type" PC machine property

The i440fx and Q35 machine types are both hardcoded to use the
legacy SMBIOS 2.1 (32-bit) entry point. This is a sensible
conservative choice because SeaBIOS only supports SMBIOS 2.1

EDK2, however, can also support SMBIOS 3.0 (64-bit) entry points,
and QEMU already uses this on the ARM virt machine type.

This adds a property to allow the choice of SMBIOS entry point
versions For example to opt in to 64-bit SMBIOS entry point:

   $QEMU -machine q35,smbios-entry-point-type=64

Based on a patch submitted by Daniel Berrangé.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20211026151100.1691925-4-ehabkost@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@redhat.com>


  Commit: 0a963af3e3c12074ed93babe0b908a1bce79f84f
      
https://github.com/qemu/qemu/commit/0a963af3e3c12074ed93babe0b908a1bce79f84f
  Author: Andy Pei <andy.pei@intel.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/block/vhost-user-blk.c

  Log Message:
  -----------
  hw/vhost-user-blk: turn on VIRTIO_BLK_F_SIZE_MAX feature for virtio blk device

Turn on pre-defined feature VIRTIO_BLK_F_SIZE_MAX for virtio blk device to
avoid guest DMA request sizes which are too large for hardware spec.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Message-Id: <1641202092-149677-1-git-send-email-andy.pei@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com>


  Commit: 6c427ab926fd79e05ff650884babee962cdeaeb9
      
https://github.com/qemu/qemu/commit/6c427ab926fd79e05ff650884babee962cdeaeb9
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Let touch_all_pages() return an error

Let's prepare touch_all_pages() for returning differing errors. Return
an error from the thread and report the last processed error.

Translate SIGBUS to -EFAULT, as a SIGBUS can mean all different kind of
things (memory error, read error, out of memory). When allocating memory
fails via the current SIGBUS-based mechanism, we'll get:
    os_mem_prealloc: preallocating memory failed: Bad address

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-2-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: a384bfa32ed8d616d766cb33360011157ae2f5c7
      
https://github.com/qemu/qemu/commit/a384bfa32ed8d616d766cb33360011157ae2f5c7
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M include/qemu/osdep.h
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Support MADV_POPULATE_WRITE for os_mem_prealloc()

Let's sense support and use it for preallocation. MADV_POPULATE_WRITE
does not require a SIGBUS handler, doesn't actually touch page content,
and avoids context switches; it is, therefore, faster and easier to handle
than our current approach.

While MADV_POPULATE_WRITE is, in general, faster than manual
prefaulting, and especially faster with 4k pages, there is still value in
prefaulting using multiple threads to speed up preallocation.

More details on MADV_POPULATE_WRITE can be found in the Linux commits
4ca9b3859dac ("mm/madvise: introduce MADV_POPULATE_(READ|WRITE) to prefault
page tables") and eb2faa513c24 ("mm/madvise: report SIGBUS as -EFAULT for
MADV_POPULATE_(READ|WRITE)"), and in the man page proposal [1].

This resolves the TODO in do_touch_pages().

In the future, we might want to look into using fallocate(), eventually
combined with MADV_POPULATE_READ, when dealing with shared file/fd
mappings and not caring about memory bindings.

[1] https://lkml.kernel.org/r/20210816081922.5155-1-david@redhat.com

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-3-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: dba506788b0f84a45c69ee1e0100c65034edffaf
      
https://github.com/qemu/qemu/commit/dba506788b0f84a45c69ee1e0100c65034edffaf
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()

Let's minimize the number of global variables to prepare for
os_mem_prealloc() getting called concurrently and make the code a bit
easier to read.

The only consumer that really needs a global variable is the sigbus
handler, which will require protection via a mutex in the future either way
as we cannot concurrently mess with the SIGBUS handler.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-4-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 89aec6411c429adb662c53c94a986a5397961a7f
      
https://github.com/qemu/qemu/commit/89aec6411c429adb662c53c94a986a5397961a7f
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Don't create too many threads with small memory or little 
pages

Let's limit the number of threads to something sane, especially that
- We don't have more threads than the number of pages we have
- We don't have threads that initialize small (< 64 MiB) memory

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-5-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: ac86e5c37df4963846d1a2e999696bb5031a99cd
      
https://github.com/qemu/qemu/commit/ac86e5c37df4963846d1a2e999696bb5031a99cd
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Avoid creating a single thread with MADV_POPULATE_WRITE

Let's simplify the case when we only want a single thread and don't have
to mess with signal handlers.

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-6-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: a960d6642d39f7d255b7b2b8bda3c2ae4e4e649b
      
https://github.com/qemu/qemu/commit/a960d6642d39f7d255b7b2b8bda3c2ae4e4e649b
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Support concurrent os_mem_prealloc() invocation

Add a mutex to protect the SIGBUS case, as we cannot mess concurrently
with the sigbus handler and we have to manage the global variable
sigbus_memset_context. The MADV_POPULATE_WRITE path can run
concurrently.

Note that page_mutex and page_cond are shared between concurrent
invocations, which shouldn't be a problem.

This is a preparation for future virtio-mem prealloc code, which will call
os_mem_prealloc() asynchronously from an iothread when handling guest
requests.

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-7-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 29b838c05dc20fa00fc08e952f710478829aa1c7
      
https://github.com/qemu/qemu/commit/29b838c05dc20fa00fc08e952f710478829aa1c7
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M softmmu/cpus.c
    M util/oslib-posix.c

  Log Message:
  -----------
  util/oslib-posix: Forward SIGBUS to MCE handler under Linux

Temporarily modifying the SIGBUS handler is really nasty, as we might be
unlucky and receive an MCE SIGBUS while having our handler registered.
Unfortunately, there is no way around messing with SIGBUS when
MADV_POPULATE_WRITE is not applicable or not around.

Let's forward SIGBUS that don't belong to us to the already registered
handler and document the situation.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-8-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 09b3b7e092ca1d8c096fdda33d1d48b8c229d3c2
      
https://github.com/qemu/qemu/commit/09b3b7e092ca1d8c096fdda33d1d48b8c229d3c2
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio-mem: Support "prealloc=on" option

For scarce memory resources, such as hugetlb, we want to be able to
prealloc such memory resources in order to not crash later on access. On
simple user errors we could otherwise easily run out of memory resources
an crash the VM -- pretty much undesired.

For ordinary memory devices, such as DIMMs, we preallocate memory via the
memory backend for such use cases; however, with virtio-mem we're dealing
with sparse memory backends; preallocating the whole memory backend
destroys the whole purpose of virtio-mem.

Instead, we want to preallocate memory when actually exposing memory to the
VM dynamically, and fail plugging memory gracefully + warn the user in case
preallocation fails.

A common use case for hugetlb will be using "reserve=off,prealloc=off" for
the memory backend and "prealloc=on" for the virtio-mem device. This
way, no huge pages will be reserved for the process, but we can recover
if there are no actual huge pages when plugging memory. Libvirt is
already prepared for this.

Note that preallocation cannot protect from the OOM killer -- which
holds true for any kind of preallocation in QEMU. It's primarily useful
only for scarce memory resources such as hugetlb, or shared file-backed
memory. It's of little use for ordinary anonymous memory that can be
swapped, KSM merged, ... but we won't forbid it.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-9-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 750539c4c4f446e12deb13fdb95d52a3466e2dff
      
https://github.com/qemu/qemu/commit/750539c4c4f446e12deb13fdb95d52a3466e2dff
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  virtio: signal after wrapping packed used_idx

Packed Virtqueues wrap used_idx instead of letting it run freely like
Split Virtqueues do. If the used ring wraps more than once there is no
way to compare vq->signalled_used and vq->used_idx in
virtio_packed_should_notify() since they are modulo vq->vring.num.

This causes the device to stop sending used buffer notifications when
when virtio_packed_should_notify() is called less than once each time
around the used ring.

It is possible to trigger this with virtio-blk's dataplane
notify_guest_bh() irq coalescing optimization. The call to
virtio_notify_irqfd() (and virtio_packed_should_notify()) is deferred to
a BH. If the guest driver is polling it can complete and submit more
requests before the BH executes, causing the used ring to wrap more than
once. The result is that the virtio-blk device ceases to raise
interrupts and I/O hangs.

Cc: Tiwei Bie <tiwei.bie@intel.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211130134510.267382-1-stefanha@redhat.com>
Fixes: 86044b24e865fb9596ed77a4d0f3af8b90a088a1 ("virtio: basic packed 
virtqueue support")
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: d135536d5f33aeb0c5a937901bccc13fc0f01187
      
https://github.com/qemu/qemu/commit/d135536d5f33aeb0c5a937901bccc13fc0f01187
  Author: Ani Sinha <ani@anisinha.ca>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add a separate entry for acpi/VIOT tables

All work related to VIOT tables are being done by Jean. Adding him as the
maintainer for acpi VIOT table code in qemu.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <20211213045924.344214-1-ani@anisinha.ca>
Acked-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 3ff9b192de6501e5f15de2586b8560966436bf25
      
https://github.com/qemu/qemu/commit/3ff9b192de6501e5f15de2586b8560966436bf25
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M include/standard-headers/linux/virtio_mem.h

  Log Message:
  -----------
  linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

Let's synchronize the new feature flag, available in Linux since
v5.16-rc1.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134039.29670-2-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 23ad8dec8d324d1fa027612eac9288e23d796a14
      
https://github.com/qemu/qemu/commit/23ad8dec8d324d1fa027612eac9288e23d796a14
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE

With VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE, we signal the VM that reading
unplugged memory is not supported. We have to fail feature negotiation
in case the guest does not support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.

First, VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE is required to properly handle
memory backends (or architectures) without support for the shared zeropage
in the hypervisor cleanly. Without the shared zeropage, even reading an
unpopulated virtual memory location can populate real memory and
consequently consume memory in the hypervisor. We have a guaranteed shared
zeropage only on MAP_PRIVATE anonymous memory.

Second, we want VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE to be the default
long-term as even populating the shared zeropage can be problematic: for
example, without THP support (possible) or without support for the shared
huge zeropage with THP (unlikely), the PTE page tables to hold the shared
zeropage entries can consume quite some memory that cannot be reclaimed
easily.

Third, there are other optimizations+features (e.g., protection of
unplugged memory, reducing the total memory slot size and bitmap sizes)
that will require VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE.

We really only support x86 targets with virtio-mem for now (and
Linux similarly only support x86), but that might change soon, so prepare
for different targets already.

Add a new "unplugged-inaccessible" tristate property for x86 targets:
- "off" will keep VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE unset and legacy
  guests working.
- "on" will set VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE and stop legacy guests
  from using the device.
- "auto" selects the default based on support for the shared zeropage.

Warn in case the property is set to "off" and we don't have support for the
shared zeropage.

For existing compat machines, the property will default to "off", to
not change the behavior but eventually warn about a problematic setup.
Short-term, we'll set the property default to "auto" for new QEMU machines.
Mid-term, we'll set the property default to "on" for new QEMU machines.
Long-term, we'll deprecate the parameter and disallow legacy
guests completely.

The property has to match on the migration source and destination. "auto"
will result in the same VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE setting as long
as the qemu command line (esp. memdev) match -- so "auto" is good enough
for migration purposes and the parameter doesn't have to be migrated
explicitly.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134039.29670-3-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 60f1f77cabe42995fe8dff2bf8e874846339b5c0
      
https://github.com/qemu/qemu/commit/60f1f77cabe42995fe8dff2bf8e874846339b5c0
  Author: David Hildenbrand <david@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/i386/pc.c
    M hw/virtio/virtio-mem.c

  Log Message:
  -----------
  virtio-mem: Set "unplugged-inaccessible=auto" for the 7.0 machine on x86

Set the new default to "auto", keeping it set to "off" for compat
machines. This property is only available for x86 targets.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134039.29670-4-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 5178d78f4b61cad647d628f52922970cdfe119b6
      
https://github.com/qemu/qemu/commit/5178d78f4b61cad647d628f52922970cdfe119b6
  Author: Jason Wang <jasowang@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/i386/intel_iommu.c

  Log Message:
  -----------
  intel-iommu: correctly check passthrough during translation

When scalable mode is enabled, the passthrough more is not determined
by the context entry but PASID entry, so switch to use the logic of
vtd_dev_pt_enabled() to determine the passthrough mode in
vtd_do_iommu_translate().

Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220105041945.13459-2-jasowang@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 8cdb99af45365727ac17f45239a9b8c1d5155c6d
      
https://github.com/qemu/qemu/commit/8cdb99af45365727ac17f45239a9b8c1d5155c6d
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  acpi: fix QEMU crash when started with SLIC table

if QEMU is started with used provided SLIC table blob,

  -acpitable sig=SLIC,oem_id='CRASH 
',oem_table_id="ME",oem_rev=00002210,asl_compiler_id="",asl_compiler_rev=00000000,data=/dev/null
it will assert with:

  hw/acpi/aml-build.c:61:build_append_padded_str: assertion failed: (len <= 
maxlen)

and following backtrace:

  ...
  build_append_padded_str (array=0x555556afe320, str=0x555556afdb2e "CRASH ME", 
maxlen=0x6, pad=0x20) at hw/acpi/aml-build.c:61
  acpi_table_begin (desc=0x7fffffffd1b0, array=0x555556afe320) at 
hw/acpi/aml-build.c:1727
  build_fadt (tbl=0x555556afe320, linker=0x555557ca3830, f=0x7fffffffd318, 
oem_id=0x555556afdb2e "CRASH ME", oem_table_id=0x555556afdb34 "ME") at 
hw/acpi/aml-build.c:2064
  ...

which happens due to acpi_table_begin() expecting NULL terminated
oem_id and oem_table_id strings, which is normally the case, but
in case of user provided SLIC table, oem_id points to table's blob
directly and as result oem_id became longer than expected.

Fix issue by handling oem_id consistently and make acpi_get_slic_oem()
return NULL terminated strings.

PS:
After [1] refactoring, oem_id semantics became inconsistent, where
NULL terminated string was coming from machine and old way pointer
into byte array coming from -acpitable option. That used to work
since build_header() wasn't expecting NULL terminated string and
blindly copied the 1st 6 bytes only.

However commit [2] broke that by replacing build_header() with
acpi_table_begin(), which was expecting NULL terminated string
and was checking oem_id size.

1) 602b45820 ("acpi: Permit OEM ID and OEM table ID fields to be changed")
2)
Fixes: 4b56e1e4eb08 ("acpi: build_fadt: use acpi_table_begin()/acpi_table_end() 
instead of build_header()")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/786
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20211227193120.1084176-2-imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Denis Lisov <dennis.lissov@gmail.com>
Tested-by: Alexander Tsoy <alexander@tsoy.me>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: e71f6ab9d93a7d01e833647e7010c1079c4cef30
      
https://github.com/qemu/qemu/commit/e71f6ab9d93a7d01e833647e7010c1079c4cef30
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    A tests/data/acpi/q35/FACP.slic
    A tests/data/acpi/q35/SLIC.slic
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  tests: acpi: whitelist expected blobs before changing them

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20211227193120.1084176-3-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 11edfabee443b149468a82b5efc88c96d1d259ec
      
https://github.com/qemu/qemu/commit/11edfabee443b149468a82b5efc88c96d1d259ec
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  tests: acpi: add SLIC table test

When user uses '-acpitable' to add SLIC table, some ACPI
tables (FADT) will change its 'Oem ID'/'Oem Table ID' fields to
match that of SLIC. Test makes sure thati QEMU handles
those fields correctly when SLIC table is added with
'-acpitable' option.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20211227193120.1084176-4-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: c8adb4d222c42951a9d0367e5f5d4e1f5e2c9ad7
      
https://github.com/qemu/qemu/commit/c8adb4d222c42951a9d0367e5f5d4e1f5e2c9ad7
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M tests/data/acpi/q35/FACP.slic
    M tests/data/acpi/q35/SLIC.slic
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  tests: acpi: SLIC: update expected blobs

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20211227193120.1084176-5-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 784802689f84b716de1fbdd2cef30e303b73b3e8
      
https://github.com/qemu/qemu/commit/784802689f84b716de1fbdd2cef30e303b73b3e8
  Author: Ani Sinha <ani@anisinha.ca>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/acpi/pcihp.c

  Log Message:
  -----------
  acpihp: simplify acpi_pcihp_disable_root_bus

Get rid of the static variable that keeps track of whether hotplug has been
disabled on the root pci bus. Simply use qbus_is_hotpluggable() api to
perform the same check. This eliminates additional if conditional and
simplifies the function.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Message-Id: <1640764674-7784-1-git-send-email-ani@anirban.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 44bff3767ced18845adb2612a2cf9691d8769d41
      
https://github.com/qemu/qemu/commit/44bff3767ced18845adb2612a2cf9691d8769d41
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  hw/i386/pc: Add missing property descriptions

When running "qemu-system-x86_64 -M pc,help" I noticed that some
properties were still missing their description. Add them now so
that users get at least a slightly better idea what they are all
about.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211206134255.94784-1-thuth@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 14dc58e3e0b12595e407502b93a8bb7e69621cbb
      
https://github.com/qemu/qemu/commit/14dc58e3e0b12595e407502b93a8bb7e69621cbb
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M MAINTAINERS
    M docs/interop/index.rst
    A docs/interop/virtio-balloon-stats.rst
    R docs/virtio-balloon-stats.txt

  Log Message:
  -----------
  docs: reSTify virtio-balloon-stats documentation and move to docs/interop

The virtio-balloon-stats documentation might be useful for people that
are implementing software that talks to QEMU via QMP, so this should
reside in the docs/interop/ directory. While we're at it, also convert
the file to restructured text and mention it in the MAINTAINERS file.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220105115245.420945-1-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b259772afc29ef6af4e911d8e695dd7e2ed31066
      
https://github.com/qemu/qemu/commit/b259772afc29ef6af4e911d8e695dd7e2ed31066
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/scsi/vhost-scsi.c

  Log Message:
  -----------
  hw/scsi/vhost-scsi: don't leak vqs on error

vhost_dev_init calls vhost_dev_cleanup in case of an error during
initialization, which zeroes out the entire vsc->dev as well as the
vsc->dev.vqs pointer. This prevents us from properly freeing it in free_vqs.
Keep a local copy of the pointer so we can free it later.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Message-Id: <20211129132358.1110372-1-d-tatianin@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 539ba1acacb11a0f27a7e7ff7e2a7c1294e0a1ea
      
https://github.com/qemu/qemu/commit/539ba1acacb11a0f27a7e7ff7e2a7c1294e0a1ea
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M hw/scsi/vhost-scsi.c

  Log Message:
  -----------
  hw/scsi/vhost-scsi: don't double close vhostfd on error

vhost_dev_init calls vhost_dev_cleanup on error, which closes vhostfd,
don't double close it.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Message-Id: <20211129132358.1110372-2-d-tatianin@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d731ab31196579144457c7f2fa3649338bfb21f2
      
https://github.com/qemu/qemu/commit/d731ab31196579144457c7f2fa3649338bfb21f2
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  virtio/vhost-vsock: don't double close vhostfd, remove redundant cleanup

In case of an error during initialization in vhost_dev_init, vhostfd is
closed in vhost_dev_cleanup. Remove close from err_virtio as it's both
redundant and causes a double close on vhostfd.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Message-Id: <20211129125204.1108088-1-d-tatianin@yandex-team.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: b193e5f9cccb322b0febd5a2aba48618506ed809
      
https://github.com/qemu/qemu/commit/b193e5f9cccb322b0febd5a2aba48618506ed809
  Author: Stefan Berger <stefanb@linux.ibm.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  tests: acpi: prepare for updated TPM related tables

Replace existing TPM related tables, that are about to change, with
empty files.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Acked-by: Ani Sinha <ani@anisinha.ca>
Message-id: 20211223022310.575496-2-stefanb@linux.ibm.com
Message-Id: <20220104175806.872996-2-stefanb@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>


  Commit: 5903646d3913af6544680f6645fcb7296d0b3a1c
      
https://github.com/qemu/qemu/commit/5903646d3913af6544680f6645fcb7296d0b3a1c
  Author: Stefan Berger <stefanb@linux.ibm.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  acpi: tpm: Add missing device identification objects

Add missing TPM device identification objects _STR and _UID. They will
appear as files 'description' and 'uid' under Linux sysfs.

Following inspection of sysfs entries for hardware TPMs we chose
uid '1'.

Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/708
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Shannon Zhao <shannon.zhaosl@gmail.com>
Message-id: 20211223022310.575496-3-stefanb@linux.ibm.com
Message-Id: <20220104175806.872996-3-stefanb@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>


  Commit: ca745d2277496464b54fd832c15c45d0227325bb
      
https://github.com/qemu/qemu/commit/ca745d2277496464b54fd832c15c45d0227325bb
  Author: Stefan Berger <stefanb@linux.ibm.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

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

  Log Message:
  -----------
  tests: acpi: Add updated TPM related tables

The updated TPM related tables have the following additions:

   Device (TPM)
   {
       Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */)  // _HID: Hardware 
ID
+      Name (_STR, "TPM 2.0 Device")  // _STR: Description String
+      Name (_UID, One)  // _UID: Unique ID
       Name (_STA, 0x0F)  // _STA: Status
       Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Acked-by: Ani Sinha <ani@anisinha.ca>
Message-id: 20211223022310.575496-4-stefanb@linux.ibm.com
Message-Id: <20220104175806.872996-4-stefanb@linux.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d70075373af51b6aa1d637962c962120e201fc98
      
https://github.com/qemu/qemu/commit/d70075373af51b6aa1d637962c962120e201fc98
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M MAINTAINERS
    M chardev/char-socket.c
    M docs/interop/index.rst
    A docs/interop/virtio-balloon-stats.rst
    R docs/virtio-balloon-stats.txt
    M hw/acpi/core.c
    M hw/acpi/pcihp.c
    M hw/arm/virt-acpi-build.c
    M hw/arm/virt.c
    M hw/block/vhost-user-blk.c
    M hw/display/vhost-user-gpu.c
    M hw/i386/acpi-build.c
    M hw/i386/intel_iommu.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/net/vhost_net-stub.c
    M hw/net/vhost_net.c
    M hw/net/virtio-net.c
    M hw/pci/pci.c
    M hw/pci/pci_host.c
    M hw/pci/pcie_aer.c
    M hw/pci/trace-events
    M hw/scsi/vhost-scsi.c
    M hw/smbios/smbios.c
    M hw/virtio/trace-events
    M hw/virtio/vhost-backend.c
    M hw/virtio/vhost-user-fs.c
    M hw/virtio/vhost-user.c
    M hw/virtio/vhost-vdpa.c
    M hw/virtio/vhost-vsock-common.c
    M hw/virtio/vhost-vsock.c
    M hw/virtio/vhost.c
    M hw/virtio/virtio-crypto.c
    M hw/virtio/virtio-mem.c
    M hw/virtio/virtio-mmio.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h
    M hw/virtio/virtio.c
    M include/hw/firmware/smbios.h
    M include/hw/i386/pc.h
    M include/hw/pci/pci.h
    M include/hw/virtio/vhost-backend.h
    M include/hw/virtio/vhost.h
    M include/hw/virtio/virtio-mem.h
    M include/hw/virtio/virtio.h
    M include/net/vhost_net.h
    M include/qemu/osdep.h
    M include/standard-headers/linux/virtio_mem.h
    M qapi/machine.json
    M softmmu/cpus.c
    M tests/data/acpi/q35/DSDT.tis.tpm12
    M tests/data/acpi/q35/DSDT.tis.tpm2
    A tests/data/acpi/q35/FACP.slic
    A tests/data/acpi/q35/SLIC.slic
    M tests/qtest/bios-tables-test.c
    M util/oslib-posix.c

  Log Message:
  -----------
  Merge tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu 
into staging

virtio,pci,pc: features,fixes,cleanups

New virtio mem options.
A vhost-user cleanup.
Control over smbios entry point type.
Config interrupt support for vdpa.
Fixes, cleanups all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Fri 07 Jan 2022 04:30:41 PM PST
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [undefined]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [undefined]
# 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: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (55 
commits)
  tests: acpi: Add updated TPM related tables
  acpi: tpm: Add missing device identification objects
  tests: acpi: prepare for updated TPM related tables
  virtio/vhost-vsock: don't double close vhostfd, remove redundant cleanup
  hw/scsi/vhost-scsi: don't double close vhostfd on error
  hw/scsi/vhost-scsi: don't leak vqs on error
  docs: reSTify virtio-balloon-stats documentation and move to docs/interop
  hw/i386/pc: Add missing property descriptions
  acpihp: simplify acpi_pcihp_disable_root_bus
  tests: acpi: SLIC: update expected blobs
  tests: acpi: add SLIC table test
  tests: acpi: whitelist expected blobs before changing them
  acpi: fix QEMU crash when started with SLIC table
  intel-iommu: correctly check passthrough during translation
  virtio-mem: Set "unplugged-inaccessible=auto" for the 7.0 machine on x86
  virtio-mem: Support VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
  linux-headers: sync VIRTIO_MEM_F_UNPLUGGED_INACCESSIBLE
  MAINTAINERS: Add a separate entry for acpi/VIOT tables
  virtio: signal after wrapping packed used_idx
  virtio-mem: Support "prealloc=on" option
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/c87507a8cfb5...d70075373af5



reply via email to

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