[PULL 12/16] virtio-iommu: Remove set_config callback

2021-12-14 Thread Thomas Huth
From: Eric Auger The spec says "the driver must not write to device configuration fields". So remove the set_config() callback which anyway did not do anything. Signed-off-by: Eric Auger Reviewed-by: Jean-Philippe Brucker Message-Id: <20211127072910.1261824-2-eric.au...@redhat.com> Signed-off-

[PULL 07/16] tests/qtest: Add a function that gets a list with available machine types

2021-12-14 Thread Thomas Huth
For the upcoming patches, we will need a way to gets a list with all available machine types. Refactor the qtest_cb_for_every_machine() to split the related code out into a separate new function, and gather the aliases of the various machine types, too. Message-Id: <20211201104347.51922-4-th...@re

[PULL 02/16] tests/qtest: add some tests for virtio-net failover

2021-12-14 Thread Thomas Huth
From: Laurent Vivier Add test cases to test several error cases that must be generated by invalid failover configuration. Add a combination of coldplug and hotplug test cases to be sure the primary is correctly managed according the presence or not of the STANDBY feature. Signed-off-by: Laurent

[PULL 15/16] tests: qtest: Add virtio-iommu test

2021-12-14 Thread Thomas Huth
From: Eric Auger Add the framework to test the virtio-iommu-pci device and tests exercising the attach/detach, map/unmap API. Signed-off-by: Eric Auger Tested-by: Jean-Philippe Brucker Reviewed-by: Jean-Philippe Brucker Acked-by: Thomas Huth Message-Id: <20211127072910.1261824-5-eric.au...@r

[PULL 06/16] tests/qtest: Fence the tests that need xlnx-zcu102 with CONFIG_XLNX_ZYNQMP_ARM

2021-12-14 Thread Thomas Huth
The 'xlnx-can-test' and the 'fuzz-xlnx-dp-test' need the "xlnx-zcu102" machine and thus should only be built and run if CONFIG_XLNX_ZYNQMP_ARM is enabled. Message-Id: <20211201104347.51922-3-th...@redhat.com> Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 3 +-- 1 file changed, 1 inser

[PULL 08/16] tests/qtest: Add a function to check whether a machine is available

2021-12-14 Thread Thomas Huth
It is nowadays possible to build QEMU with a reduced set of machines in each binary. However, the qtests still hard-code the expected machines and fail if the binary does not feature the required machine. Let's get a little bit more flexible here: Add a function that can be used to query whether a

[PULL 01/16] qtest/libqos: add a function to initialize secondary PCI buses

2021-12-14 Thread Thomas Huth
From: Laurent Vivier Scan the PCI devices to find bridge and set PCI_SECONDARY_BUS and PCI_SUBORDINATE_BUS (algorithm from seabios) Signed-off-by: Laurent Vivier Acked-by: Thomas Huth Message-Id: <20211208130350.10178-2-lviv...@redhat.com> Signed-off-by: Thomas Huth --- include/hw/pci/pci_br

[PULL 11/16] gitlab-ci: Add cirrus-ci based tests for NetBSD and OpenBSD

2021-12-14 Thread Thomas Huth
Cirrus-CI provides KVM in their Linux containers, so we can also run our VM-based NetBSD and OpenBSD build jobs there. Since the VM installation might take a while, we only run the "help" target on the first invocation to avoid timeouts, and then only check the build during the next run, once the b

[PULL 10/16] gitlab-ci.d/buildtest: Add jobs that run the device-crash-test

2021-12-14 Thread Thomas Huth
The device-crash-test script has been quite neglected in the past, so that it bit-rot quite often. Let's add CI jobs that run this script for at least some targets, so that this script does not regress that easily anymore. Message-Id: <20211126162724.1162049-1-th...@redhat.com> Reviewed-by: Philip

[PULL 04/16] tests/libqtest: add a migration test with two couples of failover devices

2021-12-14 Thread Thomas Huth
From: Laurent Vivier Signed-off-by: Laurent Vivier Acked-by: Thomas Huth Message-Id: <20211208130350.10178-5-lviv...@redhat.com> Signed-off-by: Thomas Huth --- tests/qtest/virtio-net-failover.c | 282 ++ 1 file changed, 282 insertions(+) diff --git a/tests/qtest/v

[PULL 03/16] tests/libqtest: add some virtio-net failover migration cancelling tests

2021-12-14 Thread Thomas Huth
From: Laurent Vivier Add some tests to check the state of the machine if the migration is cancelled while we are using virtio-net failover. Signed-off-by: Laurent Vivier Acked-by: Thomas Huth Message-Id: <20211208130350.10178-4-lviv...@redhat.com> Signed-off-by: Thomas Huth --- tests/qtest/v

[PULL 09/16] Move the libssh setup from configure to meson.build

2021-12-14 Thread Thomas Huth
It's easier to do this in meson.build now. Message-Id: <20211209144801.148388-1-th...@redhat.com> Acked-by: Richard W.M. Jones Signed-off-by: Thomas Huth --- configure | 27 --- meson.build | 13 + meson_options.txt

[PULL 05/16] tests/qtest: Run the PPC 32-bit tests with the 64-bit target binary, too

2021-12-14 Thread Thomas Huth
The ppc64 target is a superset of the 32-bit target, so we should include the tests here, too. This used to be done in the past already, but it got lost during the conversion to meson. Fixes: a2ce7dbd91 ("meson: convert tests/qtest to meson") Message-Id: <20211201104347.51922-2-th...@redhat.com> S

[PULL 00/16] qtest and gitlab-CI improvements

2021-12-14 Thread Thomas Huth
Hi! The following changes since commit 76b56fdfc9fa43ec6e5986aee33f108c6c6a511e: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2021-12-14 12:46:18 -0800) are available in the Git repository at: https://gitlab.com/thuth/qemu.git tags/pull-request-2021-12-

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Michael S. Tsirkin
On Wed, Dec 15, 2021 at 08:03:50AM +0100, Thomas Huth wrote: > So if changing netdev parameters on the fly is something that we want, we > should implement this properly instead indeed, and not via such an > accidental bug. How to do it is a separate thing, users don't really care at all. -- MST

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Michael S. Tsirkin
On Wed, Dec 15, 2021 at 07:48:06AM +0100, Markus Armbruster wrote: > Jason Wang writes: > > > On Tue, Dec 14, 2021 at 10:53 PM Michael S. Tsirkin wrote: > >> > >> On Mon, Dec 13, 2021 at 09:02:15AM +0100, Thomas Huth wrote: > >> > Hi! > >> > > >> > On 10/12/2021 18.02, Alexander Sosedkin wrote:

Re: [PATCH v10 2/3] cpu-throttle: implement virtual CPU throttle

2021-12-14 Thread Markus Armbruster
huang...@chinatelecom.cn writes: > From: Hyman Huang(黄勇) > > Setup a negative feedback system when vCPU thread > handling KVM_EXIT_DIRTY_RING_FULL exit by introducing > throttle_us_per_full field in struct CPUState. Sleep > throttle_us_per_full microseconds to throttle vCPU > if dirtylimit is ena

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Michael S. Tsirkin
On Wed, Dec 15, 2021 at 08:03:50AM +0100, Thomas Huth wrote: > On 15/12/2021 04.31, Jason Wang wrote: > > On Tue, Dec 14, 2021 at 10:53 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Dec 13, 2021 at 09:02:15AM +0100, Thomas Huth wrote: > > > > Hi! > > > > > > > > On 10/12/2021 18.02, Alexand

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Thomas Huth
On 15/12/2021 04.31, Jason Wang wrote: On Tue, Dec 14, 2021 at 10:53 PM Michael S. Tsirkin wrote: On Mon, Dec 13, 2021 at 09:02:15AM +0100, Thomas Huth wrote: Hi! On 10/12/2021 18.02, Alexander Sosedkin wrote: With QEMU 5 I could totally issue a QMP netdev_add with the same ID to adjust t

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Markus Armbruster
Jason Wang writes: > On Tue, Dec 14, 2021 at 10:53 PM Michael S. Tsirkin wrote: >> >> On Mon, Dec 13, 2021 at 09:02:15AM +0100, Thomas Huth wrote: >> > Hi! >> > >> > On 10/12/2021 18.02, Alexander Sosedkin wrote: >> > > With QEMU 5 I could totally issue a QMP netdev_add >> > > with the same ID

Re: [PATCH 08/12] s390x/pci: don't fence interpreted devices without MSI-X

2021-12-14 Thread Pierre Morel
On 12/7/21 22:04, Matthew Rosato wrote: Lack of MSI-X support is not an issue for interpreted passthrough devices, so let's let these in. This will allow, for example, ISM devices to be passed through -- but only when interpretation is available and being used. Signed-off-by: Matthew Rosato

Re: [PATCH 1/1] pcie: Do not set power state for some hot-plugged devices

2021-12-14 Thread Gerd Hoffmann
On Tue, Dec 14, 2021 at 09:53:12PM +, Annie Li wrote: > After the PCIe device is hot-plugged, the device's power state is > initialized as ON. However, the device isn't powered on yet, i.e. > the PCI_EXP_SYSCTL_PCC bit isn't set to PCI_EXP_SLTCTL_PWR_ON. > Later on, its power state will set bac

Re: modify NetdevUserOptions through QMP in QEMU 6 - how?

2021-12-14 Thread Jason Wang
On Tue, Dec 14, 2021 at 10:53 PM Michael S. Tsirkin wrote: > > On Mon, Dec 13, 2021 at 09:02:15AM +0100, Thomas Huth wrote: > > Hi! > > > > On 10/12/2021 18.02, Alexander Sosedkin wrote: > > > With QEMU 5 I could totally issue a QMP netdev_add > > > with the same ID to adjust the NetdevUserOption

Re: [PATCH v10 06/10] ACPI ERST: build the ACPI ERST table

2021-12-14 Thread Ani Sinha
On Tue, Dec 14, 2021 at 11:42 PM Eric DeVolder wrote: > > Ani, one quick question below. > eric > > On 12/13/21 20:58, Ani Sinha wrote: > > On Tue, Dec 14, 2021 at 2:57 AM Eric DeVolder > > wrote: > >> > >> Hi Ani, > >> inline response below. > >> Eric > >> > >> On 12/12/21 07:43, Ani Sinha wrot

Re: [RFC] vhost-vdpa-net: add vhost-vdpa-net host device support

2021-12-14 Thread Jason Wang
On Tue, Dec 14, 2021 at 9:11 PM Stefan Hajnoczi wrote: > > On Tue, Dec 14, 2021 at 10:22:53AM +0800, Jason Wang wrote: > > On Mon, Dec 13, 2021 at 11:14 PM Stefan Hajnoczi > > wrote: > > > > > > On Mon, Dec 13, 2021 at 10:47:00AM +0800, Jason Wang wrote: > > > > On Sun, Dec 12, 2021 at 5:30 PM M

Re: [PATCH v3 23/23] migration: Use multifd before we check for the zero page

2021-12-14 Thread Peter Xu
On Mon, Dec 13, 2021 at 10:03:53AM +0100, Juan Quintela wrote: > Peter Xu wrote: > > On Thu, Dec 02, 2021 at 06:38:27PM +0100, Juan Quintela wrote: > >> This needs to be improved to be compatible with old versions. > > > > Any plan to let new binary work with old binary? > > Yes, but I was waitin

Re: [PATCH v5 16/23] hw/riscv: virt: Use AIA INTC compatible string when available

2021-12-14 Thread Kip Walker
On Fri, Dec 10, 2021 at 8:35 PM Anup Patel wrote: > > We should use the AIA INTC compatible string in the CPU INTC > DT nodes when the CPUs support AIA feature. This will allow > Linux INTC driver to use AIA local interrupt CSRs. > > Signed-off-by: Anup Patel > Reviewed-by: Alistair Francis > --

[PATCH 08/47] vhost-user: fix duplicated notifier MR init

2021-12-14 Thread Michael Roth
From: Xueming Li In case of device resume after suspend, VQ notifier MR still valid. Duplicated registrations explode memory block list and slow down device resume. Fixes: 44866521bd6e ("vhost-user: support registering external host notifiers") Cc: tiwei@intel.com Cc: qemu-sta...@nongnu.org

[PATCH 05/47] hmp: Unbreak "change vnc"

2021-12-14 Thread Michael Roth
From: Markus Armbruster HMP command "change vnc" can take the password as argument, or prompt for it: (qemu) change vnc password 123 (qemu) change vnc password Password: *** (qemu) This regressed in commit cfb5387a1d "hmp: remove "change vnc TARGET" command", v6.0.0. (qemu)

[PATCH 47/47] e1000: fix tx re-entrancy problem

2021-12-14 Thread Michael Roth
From: Jon Maloy The fact that the MMIO handler is not re-entrant causes an infinite loop under certain conditions: Guest write to TDT -> Loopback -> RX (DMA to TDT) -> TX We now eliminate the effect of this problem locally in e1000, by adding a boolean in struct E1000State indicating when the

[PATCH 04/47] qemu-nbd: Change default cache mode to writeback

2021-12-14 Thread Michael Roth
From: Nir Soffer Both qemu and qemu-img use writeback cache mode by default, which is already documented in qemu(1). qemu-nbd uses writethrough cache mode by default, and the default cache mode is not documented. According to the qemu-nbd(8): --cache=CACHE The cache mode to be u

[PATCH 06/47] virtio-mem-pci: Fix memory leak when creating MEMORY_DEVICE_SIZE_CHANGE event

2021-12-14 Thread Michael Roth
From: David Hildenbrand Apparently, we don't have to duplicate the string. Fixes: 722a3c783ef4 ("virtio-pci: Send qapi events when the virtio-mem size changes") Cc: qemu-sta...@nongnu.org Signed-off-by: David Hildenbrand Reviewed-by: Markus Armbruster Message-Id: <20210929162445.64060-2-da...

[PATCH 37/47] virtio: use virtio accessor to access packed event

2021-12-14 Thread Michael Roth
From: Jason Wang We used to access packed descriptor event and off_wrap via address_space_{write|read}_cached(). When we hit the cache, memcpy() is used which is not atomic which may lead a wrong value to be read or wrote. This patch fixes this by switching to use virito_{stw|lduw}_phys_cached()

[PATCH 07/47] uas: add stream number sanity checks.

2021-12-14 Thread Michael Roth
From: Gerd Hoffmann The device uses the guest-supplied stream number unchecked, which can lead to guest-triggered out-of-band access to the UASDevice->data3 and UASDevice->status3 fields. Add the missing checks. Fixes: CVE-2021-3713 Signed-off-by: Gerd Hoffmann Reported-by: Chen Zhe Reported-

[PATCH 34/47] accel/tcg: Register a force_rcu notifier

2021-12-14 Thread Michael Roth
From: Greg Kurz A TCG vCPU doing a busy loop systematicaly hangs the QEMU monitor if the user passes 'device_add' without argument. This is because drain_cpu_all() which is called from qmp_device_add() cannot return if readers don't exit read-side critical sections. That is typically what busy-lo

[PATCH 46/47] net: vmxnet3: validate configuration values during activate (CVE-2021-20203)

2021-12-14 Thread Michael Roth
From: Prasad J Pandit While activating device in vmxnet3_acticate_device(), it does not validate guest supplied configuration values against predefined minimum - maximum limits. This may lead to integer overflow or OOB access issues. Add checks to avoid it. Fixes: CVE-2021-20203 Buglink: https:/

[PATCH 40/47] hw/nvme: fix buffer overrun in nvme_changed_nslist (CVE-2021-3947)

2021-12-14 Thread Michael Roth
From: Klaus Jensen Fix missing offset verification. Cc: qemu-sta...@nongnu.org Cc: Philippe Mathieu-Daudé Reported-by: Qiuhao Li Fixes: f432fdfa121 ("support changed namespace asynchronous event") Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Klaus Jensen (cherry picked from commit e2c5

[PATCH 45/47] virtio-blk: Fix clean up of host notifiers for single MR transaction.

2021-12-14 Thread Michael Roth
From: Mark Mielke The code that introduced "virtio-blk: Configure all host notifiers in a single MR transaction" introduced a second loop variable to perform cleanup in second loop, but mistakenly still refers to the first loop variable within the second loop body. Fixes: d0267da61489 ("virtio-b

[PATCH 44/47] tests/qtest/fdc-test: Add a regression test for CVE-2021-20196

2021-12-14 Thread Michael Roth
From: Philippe Mathieu-Daudé Without the previous commit, when running 'make check-qtest-i386' with QEMU configured with '--enable-sanitizers' we get: AddressSanitizer:DEADLYSIGNAL = ==287878==ERROR: AddressSanitizer: SEGV on

[PATCH 43/47] hw/block/fdc: Kludge missing floppy drive to fix CVE-2021-20196

2021-12-14 Thread Michael Roth
From: Philippe Mathieu-Daudé Guest might select another drive on the bus by setting the DRIVE_SEL bit of the DIGITAL OUTPUT REGISTER (DOR). The current controller model doesn't expect a BlockBackend to be NULL. A simple way to fix CVE-2021-20196 is to create an empty BlockBackend when it is missi

[PATCH 28/47] Partially revert "build: -no-pie is no functional linker flag"

2021-12-14 Thread Michael Roth
From: Jessica Clarke This partially reverts commit bbd2d5a8120771ec59b86a80a1f51884e0a26e53. This commit was misguided and broke using --disable-pie on any distro that enables PIE by default in their compiler driver, including Debian and its derivatives. Whilst -no-pie is not a linker flag, it i

[PATCH 30/47] target-i386: mmu: fix handling of noncanonical virtual addresses

2021-12-14 Thread Michael Roth
From: Paolo Bonzini mmu_translate is supposed to return an error code for page faults; it is not able to handle other exceptions. The #GP case for noncanonical virtual addresses is not handled correctly, and incorrectly raised as a page fault with error code 1. Since it cannot happen for nested

[PATCH 42/47] hw/block/fdc: Extract blk_create_empty_drive()

2021-12-14 Thread Michael Roth
From: Philippe Mathieu-Daudé We are going to re-use this code in the next commit, so extract it as a new blk_create_empty_drive() function. Inspired-by: Hanna Reitz Signed-off-by: Philippe Mathieu-Daudé Message-id: 20211124161536.631563-2-phi...@redhat.com Signed-off-by: John Snow (cherry pic

[PATCH 03/47] virtio-net: fix use after unmap/free for sg

2021-12-14 Thread Michael Roth
From: Jason Wang When mergeable buffer is enabled, we try to set the num_buffers after the virtqueue elem has been unmapped. This will lead several issues, E.g a use after free when the descriptor has an address which belongs to the non direct access region. In this case we use bounce buffer that

[PATCH 27/47] block/file-posix: Fix return value translation for AIO discards

2021-12-14 Thread Michael Roth
From: Ari Sundholm AIO discards regressed as a result of the following commit: 0dfc7af2 block/file-posix: Optimize for macOS When trying to run blkdiscard within a Linux guest, the request would fail, with some errors in dmesg: [ snip ] [4.010070] sd 2:0:0:0: [sda] tag#0 F

[PATCH 25/47] tests/acpi/pcihp: add unit tests for hotplug on multifunction bridges for q35

2021-12-14 Thread Michael Roth
From: Ani Sinha commit d7346e614f4ec ("acpi: x86: pcihp: add support hotplug on multifunction bridges") added ACPI hotplug descriptions for cold plugged bridges for functions other than 0. For all other devices, the ACPI hotplug descriptions are limited to function 0 only. This change adds unit

[PATCH 41/47] chardev/wctable: don't free the instance in wctablet_chr_finalize

2021-12-14 Thread Michael Roth
From: Daniil Tatianin Object is supposed to be freed by invoking obj->free, and not obj->instance_finalize. This would lead to use-after-free followed by double free in object_unref/object_finalize. Signed-off-by: Daniil Tatianin Reviewed-by: Marc-André Lureau Message-Id: <2027142349.83627

[PATCH 39/47] nbd/server: Don't complain on certain client disconnects

2021-12-14 Thread Michael Roth
From: Eric Blake When a client disconnects abruptly, but did not have any pending requests (for example, when using nbdsh without calling h.shutdown), we used to output the following message: $ qemu-nbd -f raw file $ nbdsh -u 'nbd://localhost:10809' -c 'h.trim(1,0)' qemu-nbd: Disconnect client,

[PATCH 26/47] tests/acpi/bios-tables-test: update DSDT blob for multifunction bridge test

2021-12-14 Thread Michael Roth
From: Ani Sinha We added a new unit test for testing acpi hotplug on multifunction bridges in q35 machines. Here, we update the DSDT table gloden master blob for this unit test. The test adds the following devices to qemu and then checks the changes introduced in the DSDT table due to the additi

[PATCH 24/47] tests/acpi/bios-tables-test: add and allow changes to a new q35 DSDT table blob

2021-12-14 Thread Michael Roth
From: Ani Sinha We are adding a new unit test to cover the acpi hotplug support in q35 for multi-function bridges. This test uses a new table DSDT.multi-bridge. We need to allow changes in DSDT acpi table for addition of this new unit test. Signed-off-by: Ani Sinha Message-Id: <20211007135750.1

[PATCH 38/47] vfio: Fix memory leak of hostwin

2021-12-14 Thread Michael Roth
From: Peng Liang hostwin is allocated and added to hostwin_list in vfio_host_win_add, but it is only deleted from hostwin_list in vfio_host_win_del, which causes a memory leak. Also, freeing all elements in hostwin_list is missing in vfio_disconnect_container. Fix: 2e4109de8e58 ("vfio/spapr: Cr

[PATCH 23/47] pci: fix PCI resource reserve capability on BE

2021-12-14 Thread Michael Roth
From: "Michael S. Tsirkin" PCI resource reserve capability should use LE format as all other PCI things. If we don't then seabios won't boot: === PCI new allocation pass #1 === PCI: check devices PCI: QEMU resource reserve cap: size 10 type io PCI: secondary bus 1 size 10

[PATCH 32/47] hw: m68k: virt: Add compat machine for 6.1

2021-12-14 Thread Michael Roth
From: Laurent Vivier Add the missing machine type for m68k/virt Cc: qemu-sta...@nongnu.org Signed-off-by: Laurent Vivier Message-Id: <20211106194158.4068596-2-laur...@vivier.eu> Signed-off-by: Laurent Vivier (cherry picked from commit 6837f299762679429924242a63f16490862578e3) Signed-off-by: Mi

[PATCH 21/47] bios-tables-test: Update ACPI DSDT table golden blobs for q35

2021-12-14 Thread Michael Roth
From: Ani Sinha We have modified the IO address range for ACPI pci hotplug in q35. See change: 5adcc9e39e6a5 ("hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35") The ACPI DSDT table golden blobs must be regenrated in order to make the unit tests pass. This change upd

[PATCH 36/47] virtio: use virtio accessor to access packed descriptor flags

2021-12-14 Thread Michael Roth
From: Jason Wang We used to access packed descriptor flags via address_space_{write|read}_cached(). When we hit the cache, memcpy() is used which is not an atomic operation which may lead a wrong value is read or wrote. So this patch switches to use virito_{stw|lduw}_phys_cached() to make sure t

[PATCH 22/47] block: introduce max_hw_iov for use in scsi-generic

2021-12-14 Thread Michael Roth
From: Paolo Bonzini Linux limits the size of iovecs to 1024 (UIO_MAXIOV in the kernel sources, IOV_MAX in POSIX). Because of this, on some host adapters requests with many iovecs are rejected with -EINVAL by the io_submit() or readv()/writev() system calls. In fact, the same limit applies to SG

[PATCH 31/47] hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands

2021-12-14 Thread Michael Roth
From: Mauro Matteo Cascella This avoids an off-by-one read of 'mode_sense_valid' buffer in hw/scsi/scsi-disk.c:mode_sense_page(). Fixes: CVE-2021-3930 Cc: qemu-sta...@nongnu.org Reported-by: Alexander Bulekov Fixes: a8f4bbe2900 ("scsi-disk: store valid mode pages in a table") Fixes: #546 Report

[PATCH 20/47] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35

2021-12-14 Thread Michael Roth
From: Ani Sinha Change caf108bc58790 ("hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35") selects an IO address range for acpi based PCI hotplug for q35 arbitrarily. It starts at address 0x0cc4 and ends at 0x0cdb. At the time when the patch was written but the final version of the patch

[PATCH 35/47] pcie: rename 'native-hotplug' to 'x-native-hotplug'

2021-12-14 Thread Michael Roth
From: Igor Mammedov Mark property as experimental/internal adding 'x-' prefix. Property was introduced in 6.1 and it should have provided ability to turn on native PCIE hotplug on port even when ACPI PCI hotplug is in use is user explicitly sets property on CLI. However that never worked since s

[PATCH 01/47] virtio-balloon: don't start free page hinting if postcopy is possible

2021-12-14 Thread Michael Roth
From: David Hildenbrand Postcopy never worked properly with 'free-page-hint=on', as there are at least two issues: 1) With postcopy, the guest will never receive a VIRTIO_BALLOON_CMD_ID_DONE and consequently won't release free pages back to the OS once migration finishes. The issue is

[PATCH 16/47] vhost-vsock: fix migration issue when seqpacket is supported

2021-12-14 Thread Michael Roth
From: Stefano Garzarella Commit 1e08fd0a46 ("vhost-vsock: SOCK_SEQPACKET feature bit support") enabled the SEQPACKET feature bit. This commit is released with QEMU 6.1, so if we try to migrate a VM where the host kernel supports SEQPACKET but machine type version is less than 6.1, we get the foll

[PATCH 33/47] rcu: Introduce force_rcu notifier

2021-12-14 Thread Michael Roth
From: Greg Kurz The drain_rcu_call() function can be blocked as long as an RCU reader stays in a read-side critical section. This is typically what happens when a TCG vCPU is executing a busy loop. It can deadlock the QEMU monitor as reported in https://gitlab.com/qemu-project/qemu/-/issues/650 .

[PATCH 29/47] target-i386: mmu: use pg_mode instead of HF_LMA_MASK

2021-12-14 Thread Michael Roth
From: Paolo Bonzini Correctly look up the paging mode of the hypervisor when it is using 64-bit mode but the guest is not. Fixes: 68746930ae ("target/i386: use mmu_translate for NPT walk", 2021-05-11) Cc: qemu-sta...@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 93eae358325

[PATCH 17/47] hw/arm/virt: Rename default_bus_bypass_iommu

2021-12-14 Thread Michael Roth
From: Jean-Philippe Brucker Since commit d8fb7d0969d5 ("vl: switch -M parsing to keyval"), machine parameter definitions cannot use underscores, because keyval_dashify() transforms them to dashes and the parser doesn't find the parameter. This affects option default_bus_bypass_iommu which was in

[PATCH 02/47] target/arm: Don't skip M-profile reset entirely in user mode

2021-12-14 Thread Michael Roth
From: Peter Maydell Currently all of the M-profile specific code in arm_cpu_reset() is inside a !defined(CONFIG_USER_ONLY) ifdef block. This is unintentional: it happened because originally the only M-profile-specific handling was the setup of the initial SP and PC from the vector table, which i

[PATCH 11/47] i386/cpu: Remove AVX_VNNI feature from Cooperlake cpu model

2021-12-14 Thread Michael Roth
From: Yang Zhong The AVX_VNNI feature is not in Cooperlake platform, remove it from cpu model. Signed-off-by: Yang Zhong Message-Id: <20210820054611.84303-1-yang.zh...@intel.com> Fixes: c1826ea6a052 ("i386/cpu: Expose AVX_VNNI instruction to guest") Cc: qemu-sta...@nongnu.org Signed-off-by: Edu

[PATCH 15/47] qemu-sockets: fix unix socket path copy (again)

2021-12-14 Thread Michael Roth
From: Michael Tokarev Commit 4cfd970ec188558daa6214f26203fe553fb1e01f added an assert which ensures the path within an address of a unix socket returned from the kernel is at least one byte and does not exceed sun_path buffer. Both of this constraints are wrong: A unix socket can be unnamed, in

[PATCH 19/47] bios-tables-test: allow changes in DSDT ACPI tables for q35

2021-12-14 Thread Michael Roth
From: Ani Sinha We are going to commit a change to fix IO address range allocated for acpi pci hotplug in q35. This affects DSDT tables. This change allows DSDT table modification so that unit tests are not broken. Signed-off-by: Ani Sinha Acked-by: Igor Mammedov Message-Id: <20210916132838.34

[PATCH 13/47] plugins/execlog: removed unintended "s" at the end of log lines.

2021-12-14 Thread Michael Roth
From: Mahmoud Mandour Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210803151428.125323-1-ma.mando...@gmail.com> Message-Id: <20210806141015.2487502-2-alex.ben...@linaro.org> Cc: qemu-sta...@nongnu.org (cherry picked from commit b40310616d2bd550279dd22b05483c3c613a00f

[PATCH 18/47] hw/i386: Rename default_bus_bypass_iommu

2021-12-14 Thread Michael Roth
From: Jean-Philippe Brucker Since commit d8fb7d0969d5 ("vl: switch -M parsing to keyval"), machine parameter definitions cannot use underscores, because keyval_dashify() transforms them to dashes and the parser doesn't find the parameter. This affects option default_bus_bypass_iommu which was in

[PATCH 14/47] plugins: do not limit exported symbols if modules are active

2021-12-14 Thread Michael Roth
From: Paolo Bonzini On Mac --enable-modules and --enable-plugins are currently incompatible, because the Apple -Wl,-exported_symbols_list command line options prevents the export of any symbols needed by the modules. On x86 -Wl,--dynamic-list does not have this effect, but only because the -Wl

[PATCH 12/47] 9pfs: fix crash in v9fs_walk()

2021-12-14 Thread Michael Roth
From: Christian Schoenebeck v9fs_walk() utilizes the v9fs_co_run_in_worker({...}) macro to run the supplied fs driver code block on a background worker thread. When either the 'Twalk' client request was interrupted or if the client requested fid for that 'Twalk' request caused a stat error then

[PATCH 00/47] Patch Round-up for stable 6.1.1, freeze on 2021-12-21

2021-12-14 Thread Michael Roth
Hi everyone, The following new patches are queued for QEMU stable v6.1.1: https://gitlab.com/qemu-project/qemu/-/commits/stable-6.1-staging/ Patch freeze is 2021-12-21, and the release is planned for 2021-12-23: https://wiki.qemu.org/Planning/6.1 Please respond here or CC qemu-sta...@nongn

[PATCH 10/47] hw/display/artist: Fix bug in coordinate extraction in artist_vram_read() and artist_vram_write()

2021-12-14 Thread Michael Roth
From: Helge Deller The CDE desktop on HP-UX 10 shows wrongly rendered pixels when the local screen menu is closed. This bug was introduced by commit c7050f3f167b ("hw/display/artist: Refactor x/y coordination extraction") which converted the coordinate extraction in artist_vram_read() and artist_

[PATCH 09/47] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr

2021-12-14 Thread Michael Roth
From: David Hildenbrand We end up not copying the mmap_addr of all existing regions, resulting in a SEGFAULT once we actually try to map/access anything within our memory regions. Fixes: 875b9fd97b34 ("Support individual region unmap in libvhost-user") Cc: qemu-sta...@nongnu.org Cc: Michael S. T

Re: [PATCH v2] MIPS - fix cycle counter timing calculations

2021-12-14 Thread Simon Burge
=?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= wrote: > Minor comment, it is better to post patch iterations as new thread, > and not as reply to older patch, because in thread view your new > patch might ended hidden / lost. Ah, my bad. I misread the part about using in-reply-to in the patch submissio

Re: [PATCH v7 04/15] linux-user/host/sparc64: Add safe-syscall.inc.S

2021-12-14 Thread Richard Henderson
On 12/14/21 7:30 AM, Philippe Mathieu-Daudé wrote: Hi Richard, On 12/14/21 01:25, Richard Henderson wrote: Signed-off-by: Richard Henderson --- linux-user/host/sparc64/hostdep.h | 3 + linux-user/host/sparc64/safe-syscall.inc.S | 89 ++ 2 files changed, 92 ins

Re: [PATCH v6 0/8] target/riscv: support Zfh, Zfhmin extension v0.1

2021-12-14 Thread Alistair Francis
On Fri, Dec 10, 2021 at 5:44 PM wrote: > > From: Frank Chang > > Zfh - Half width floating point > Zfhmin - Subset of half width floating point > > Zfh, Zfhmin v0.1 is now in public review period and is required by > RVV extension: > https://groups.google.com/a/groups.riscv.org/g/isa-dev/c/63gDCi

[ANNOUNCE] QEMU 6.2.0 is now available

2021-12-14 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the QEMU 6.2.0 release. This release contains 2300+ commits from 189 authors. You can grab the tarball from our download page here: https://www.qemu.org/download/#source The full list of changes are available at: h

Re: [PULL 0/1] Block patches

2021-12-14 Thread Richard Henderson
On 12/9/21 7:21 AM, Stefan Hajnoczi wrote: The following changes since commit a3607def89f9cd68c1b994e1030527df33aa91d0: Update version for v6.2.0-rc4 release (2021-12-07 17:51:38 -0800) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request

Re: [RFC PATCH 1/3] target/riscv: add support for svnapot extension

2021-12-14 Thread Alistair Francis
On Sun, Nov 28, 2021 at 11:54 PM liweiwei wrote: > Can you add a commit message that describes what you are changing? Alistair > Signed-off-by: liweiwei > Signed-off-by: wangjunqiang > --- > target/riscv/cpu_bits.h | 1 + > target/riscv/cpu_helper.c | 18 -- > 2 files chan

[PATCH 1/1] pcie: Do not set power state for some hot-plugged devices

2021-12-14 Thread Annie Li
After the PCIe device is hot-plugged, the device's power state is initialized as ON. However, the device isn't powered on yet, i.e. the PCI_EXP_SYSCTL_PCC bit isn't set to PCI_EXP_SLTCTL_PWR_ON. Later on, its power state will set back to OFF due to the non PCI_EXP_SLTCTL_PWR_ON state. The device is

Re: [PATCH] target/riscv/pmp: fix no pmp illegal intrs

2021-12-14 Thread Richard Henderson
On 12/14/21 1:12 PM, Richard Henderson wrote: On 12/14/21 1:26 AM, Nikita Shubin wrote: -    if (!pmp_get_num_rules(env) && (prev_priv != PRV_M)) { +    if (riscv_feature(env, RISCV_FEATURE_PMP) && +    !pmp_get_num_rules(env) && (prev_priv != PRV_M)) { When would the number of rules becom

Re: [PATCH] target/riscv/pmp: fix no pmp illegal intrs

2021-12-14 Thread Richard Henderson
On 12/14/21 1:26 AM, Nikita Shubin wrote: -if (!pmp_get_num_rules(env) && (prev_priv != PRV_M)) { +if (riscv_feature(env, RISCV_FEATURE_PMP) && +!pmp_get_num_rules(env) && (prev_priv != PRV_M)) { When would the number of rules become non-zero with PMP disabled? When does this te

Re: [PATCH v9 28/31] common-user: Add safe syscall handling for loongarch64 hosts

2021-12-14 Thread Peter Maydell
On Tue, 14 Dec 2021 at 19:29, Richard Henderson wrote: > For loongarch64, according to glibc, > > #define __SYSCALL_CLOBBERS \ >"$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8", "memory" > > which does suggest that a6 is unused, saved across the syscall, and also > call-clobbered

Re: [PATCH 6/6] target/arm: Implement FEAT_LPA2

2021-12-14 Thread Richard Henderson
On 12/14/21 6:57 AM, Alex Bennée wrote: +static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) +{ +return sextract64(id->id_aa64mmfr0, + R_ID_AA64MMFR0_TGRAN4_SHIFT, + R_ID_AA64MMFR0_TGRAN4_LENGTH) >= 1; Is this correct - it sh

Re: [PATCH v2 for-7.0] scripts: Explain the difference between linux-headers and standard-headers

2021-12-14 Thread Alex Bennée
Peter Maydell writes: > If you don't know it, it's hard to figure out the difference between > the linux-headers folder and the include/standard-headers folder. > So let's add a short explanation to clarify the difference. > > Suggested-by: Thomas Huth > Signed-off-by: Peter Maydell Reviewed

Re: error in qemu mac install ..

2021-12-14 Thread Alex Bennée
גיא writes: > Hey > > trying to install for the 1st time and i got a message to contact you. > > also, the mouse is caught by the qemu but not moving ... so not possible to > format the hdd .. and continue. > > guy@guyaHP:~/Downloads/macOS-Simple-KVM-master$ sudo ./basic.sh without seeing the

Re: [PATCH v9 10/10] target/ppc/excp_helper.c: EBB handling adjustments

2021-12-14 Thread Daniel Henrique Barboza
On 12/8/21 22:52, David Gibson wrote: On Wed, Dec 01, 2021 at 12:17:34PM -0300, Daniel Henrique Barboza wrote: The current logic is only considering event-based exceptions triggered by the performance monitor. This is true now, but we might want to add support for external event-based excepti

Re: Qemu Userspace Emulator with library + method

2021-12-14 Thread Alex Bennée
Marcus Engene writes: > Hi, > > I'd like to do instruction traces with library+function name included. > > From what I understand in_asm only shows instructions when they are being > JIT:ed. > If I call a function twice I only see the instructions once so it makes sense. > > As a workaround,

[PATCH v2] monitor: move x-query-profile into accel/tcg to fix build

2021-12-14 Thread Alex Bennée
As --enable-profiler isn't defended in CI we missed this breakage. Move the qmp handler into accel/tcg so we have access to the helpers we need. While we are at it ensure we gate the feature on CONFIG_TCG. Signed-off-by: Alex Bennée Suggested-by: Daniel P. Berrangé Reported-by: Mark Cave-Ayland

Re: [PATCH v5 09/31] block: introduce assert_bdrv_graph_writable

2021-12-14 Thread Emanuele Giuseppe Esposito
On 10/12/2021 18:43, Hanna Reitz wrote: On 24.11.21 07:43, Emanuele Giuseppe Esposito wrote: We want to be sure that the functions that write the child and parent list of a bs are under BQL and drain. BQL prevents from concurrent writings from the GS API, while drains protect from I/O. TODO

[PATCH] Hexagon (tests/tcg/hexagon) change .ref files for changes in test source

2021-12-14 Thread Taylor Simpson
This update changes the Hexagon reference files to match the test changes from Richard Henderson . The test changes can be found here https://gitlab.com/rth7680/qemu/-/commits/fix-sfp-test Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/float_convs.ref | 152 +++-

Re: [PATCH v9 28/31] common-user: Add safe syscall handling for loongarch64 hosts

2021-12-14 Thread Richard Henderson
On 12/14/21 12:01 AM, WANG Xuerui wrote: +move$t0, $a0/* signal_pending pointer */ ... +safe_syscall_start: +/* If signal_pending is non-zero, don't do the call */ +ld.w$t1, $t0, 0 +bnez$t1, 2f +syscall 0 We need a non-syscall clobbe

Re: [PATCH] monitor: move x-query-profile into accel/tcg to fix build

2021-12-14 Thread Daniel P . Berrangé
On Tue, Dec 14, 2021 at 06:22:07PM +, Alex Bennée wrote: > As --enable-profiler isn't defended in CI we missed this breakage. > Move the qmp handler into accel/tcg so we have access to the helpers > we need. While we are at it ensure we gate the feature on CONFIG_TCG. > > Signed-off-by: Alex B

Re: [PATCH] docs: Add measurement calculation details to amd-memory-encryption.txt

2021-12-14 Thread Daniel P . Berrangé
On Tue, Dec 14, 2021 at 01:59:10PM +, Dov Murik wrote: > Add a section explaining how the Guest Owner should calculate the > expected guest launch measurement for SEV and SEV-ES. > > Also update the name and link to the SEV API Spec document. > > Signed-off-by: Dov Murik > Suggested-by: Dani

[PATCH] monitor: move x-query-profile into accel/tcg to fix build

2021-12-14 Thread Alex Bennée
As --enable-profiler isn't defended in CI we missed this breakage. Move the qmp handler into accel/tcg so we have access to the helpers we need. While we are at it ensure we gate the feature on CONFIG_TCG. Signed-off-by: Alex Bennée Suggested-by: Daniel P. Berrangé Reported-by: Mark Cave-Ayland

Re: [PATCH v10 06/10] ACPI ERST: build the ACPI ERST table

2021-12-14 Thread Eric DeVolder
Ani, one quick question below. eric On 12/13/21 20:58, Ani Sinha wrote: On Tue, Dec 14, 2021 at 2:57 AM Eric DeVolder wrote: Hi Ani, inline response below. Eric On 12/12/21 07:43, Ani Sinha wrote: . On Thu, Dec 9, 2021 at 11:28 PM Eric DeVolder wrote: This builds the ACPI ERST table to

Re: [RFC PATCH 0/6] Removal of Aiocontext lock and usage of subtree drains in aborted transactions

2021-12-14 Thread Emanuele Giuseppe Esposito
On 13/12/2021 15:52, Stefan Hajnoczi wrote: Off-topic: I don't understand the difference between the effects of bdrv_drained_begin() and bdrv_subtree_drained_begin(). Both call aio_disable_external(aio_context) and aio_poll(). bdrv_drained_begin() only polls parents and itself, while bdrv_subt

Re: [PATCH for-7.0 0/6] target/arm: Implement LVA, LPA, LPA2 features

2021-12-14 Thread Richard Henderson
On 12/14/21 8:37 AM, Alex Bennée wrote: Richard Henderson writes: These features are all related and relatively small. Testing so far has been limited to booting a kernel with 64k pages and VA and PA set to 52 bits, which excercises LVA and LPA. Do any distros ship with 64k pages that we c

  1   2   3   >