Re: [PATCH v5 4/4] vdpa: add vdpa-dev-pci support

2022-05-12 Thread Stefano Garzarella
On Thu, May 12, 2022 at 02:21:03PM +0800, Longpeng(Mike) wrote: From: Longpeng Supports vdpa-dev-pci, we can use the device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Signed-off-by: Longpeng --- hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev-pci.c | 101

Re: [PATCH v2] docs/about: Update the support statement for Windows

2022-05-12 Thread Stefan Weil via
Am 12.05.22 um 16:30 schrieb Thomas Huth: On 12/05/2022 10.37, Daniel P. Berrangé wrote: On Thu, May 12, 2022 at 09:39:29AM +0200, Thomas Huth wrote: Our support statement for Windows currently talks about "Vista / Server 2008" - which is related to the API of Windows, and this is not easy to

Re: [PATCH 00/17] powernv: introduce pnv-phb unified devices

2022-05-12 Thread Cédric Le Goater
As a rough outline for a pnv-phb device, I'd aim for creating a proxy for the underlying device rather than manually invoking the QOM instance and qdev-related functions: struct PnvPHB {         uint32_t version;     Object *phb_dev;  /* Could be PHBCommonBase if it exists */ }; DECLA

[PATCH v2 3/6] hw/intc/arm_gicv3_kvm.c: Stop using GIC_MIN_BPR constant

2022-05-12 Thread Peter Maydell
The GIC_MIN_BPR constant defines the minimum BPR value that the TCG emulated GICv3 supports. We're currently using this also as the value we reset the KVM GICv3 ICC_BPR registers to, but this is only right by accident. We want to make the emulated GICv3 use a configurable number of priority bits,

[PATCH v2 0/6] gicv3: Use right number of prio bits for the CPU

2022-05-12 Thread Peter Maydell
This patchset fills in an odd inconsistency in our GICv3 emulation that I noticed while I was doing the GICv4 work. At the moment we allow the CPU to specify the number of bits of virtual priority (via the ARMCPU::gic_vpribits field), but we always use 8 bits of physical priority, even though to m

[PATCH v2 5/6] hw/intc/arm_gicv3: Use correct number of priority bits for the CPU

2022-05-12 Thread Peter Maydell
Make the GICv3 set its number of bits of physical priority from the implementation-specific value provided in the CPU state struct, in the same way we already do for virtual priority bits. Because this would be a migration compatibility break, we provide a property force-8-bit-prio which is enable

[PATCH v2 2/6] hw/intc/arm_gicv3: report correct PRIbits field in ICV_CTLR_EL1

2022-05-12 Thread Peter Maydell
As noted in the comment, the PRIbits field in ICV_CTLR_EL1 is supposed to match the ICH_VTR_EL2 PRIbits setting; that is, it is the virtual priority bit setting, not the physical priority bit setting. (For QEMU currently we always implement 8 bits of physical priority, so the PRIbits field was prev

[PATCH v2 6/6] hw/intc/arm_gicv3: Provide ich_num_aprs()

2022-05-12 Thread Peter Maydell
We previously open-coded the expression for the number of virtual APR registers and the assertion that it was not going to cause us to overflow the cs->ich_apr[] array. Factor this out into a new ich_num_aprs() function, for consistency with the icc_num_aprs() function we just added for the physic

[PATCH v2 1/6] hw/intc/arm_gicv3_cpuif: Handle CPUs that don't specify GICv3 parameters

2022-05-12 Thread Peter Maydell
We allow a GICv3 to be connected to any CPU, but we don't do anything to handle the case where the CPU type doesn't in hardware have a GICv3 CPU interface and so the various GIC configuration fields (gic_num_lrs, vprebits, vpribits) are not specified. The current behaviour is that we will add the

[PATCH v2 4/6] hw/intc/arm_gicv3: Support configurable number of physical priority bits

2022-05-12 Thread Peter Maydell
The GICv3 code has always supported a configurable number of virtual priority and preemption bits, but our implementation currently hardcodes the number of physical priority bits at 8. This is not what most hardware implementations provide; for instance the Cortex-A53 provides only 5 bits of physi

[PULL 01/10] coroutine: Rename qemu_coroutine_inc/dec_pool_size()

2022-05-12 Thread Kevin Wolf
It's true that these functions currently affect the batch size in which coroutines are reused (i.e. moved from the global release pool to the allocation pool of a specific thread), but this is a bug and will be fixed in a separate patch. In fact, the comment in the header file already just promise

[PULL 07/10] tests/qtest/fdc-test: Add a regression test for CVE-2021-3507

2022-05-12 Thread Kevin Wolf
From: Philippe Mathieu-Daudé Add the reproducer from https://gitlab.com/qemu-project/qemu/-/issues/339 Without the previous commit, when running 'make check-qtest-i386' with QEMU configured with '--enable-sanitizers' we get: ==4028352==ERROR: AddressSanitizer: heap-buffer-overflow on address

[PULL 00/10] Block layer patches

2022-05-12 Thread Kevin Wolf
The following changes since commit ec11dc41eec5142b4776db1296972c6323ba5847: Merge tag 'pull-misc-2022-05-11' of git://repo.or.cz/qemu/armbru into staging (2022-05-11 09:00:26 -0700) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch

[PULL 08/10] qemu-nbd: Pass max connections to blockdev layer

2022-05-12 Thread Kevin Wolf
From: Eric Blake The next patch wants to adjust whether the NBD server code advertises MULTI_CONN based on whether it is known if the server limits to exactly one client. For a server started by QMP, this information is obtained through nbd_server_start (which can support more than one export);

[PULL 02/10] coroutine: Revert to constant batch size

2022-05-12 Thread Kevin Wolf
Commit 4c41c69e changed the way the coroutine pool is sized because for virtio-blk devices with a large queue size and heavy I/O, it was just too small and caused coroutines to be deleted and reallocated soon afterwards. The change made the size dynamic based on the number of queues and the queue s

[PULL 03/10] iotests/testrunner: Flush after run_test()

2022-05-12 Thread Kevin Wolf
From: Hanna Reitz When stdout is not a terminal, the buffer may not be flushed at each end of line, so we should flush after each test is done. This is especially apparent when run by check-block, in two ways: First, when running make check-block -jX with X > 1, progress indication was missing,

[PULL 05/10] .gitlab-ci.d: export meson testlog.txt as an artifact

2022-05-12 Thread Kevin Wolf
From: Daniel P. Berrangé When running 'make check' we only get a summary of progress on the console. Fortunately meson/ninja have saved the raw test output to a logfile. Exposing this log will make it easier to debug failures that happen in CI. Signed-off-by: Daniel P. Berrangé Message-Id: <202

[PULL 04/10] tests/qemu-iotests: print intent to run a test in TAP mode

2022-05-12 Thread Kevin Wolf
From: Daniel P. Berrangé When running I/O tests using TAP output mode, we get a single TAP test with a sub-test reported for each I/O test that is run. The output looks something like this: 1..123 ok qcow2 011 ok qcow2 012 ok qcow2 013 ok qcow2 217 ... If everything runs or fails normally

[PULL 06/10] hw/block/fdc: Prevent end-of-track overrun (CVE-2021-3507)

2022-05-12 Thread Kevin Wolf
From: Philippe Mathieu-Daudé Per the 82078 datasheet, if the end-of-track (EOT byte in the FIFO) is more than the number of sectors per side, the command is terminated unsuccessfully: * 5.2.5 DATA TRANSFER TERMINATION The 82078 supports terminal count explicitly through the TC pin and impli

[PATCH 4/9] vfio/migration: Skip pre-copy if dirty page tracking is not supported

2022-05-12 Thread Avihai Horon
Currently, if IOMMU of a VFIO container doesn't support dirty page tracking, migration is blocked completely. This is because a DMA-able VFIO device can dirty RAM pages without updating QEMU about it, thus breaking the migration. However, this doesn't mean that migration can't be done at all. If m

[PATCH 0/9] vfio/migration: Implement VFIO migration protocol v2

2022-05-12 Thread Avihai Horon
Hello, Following VFIO migration protocol v2 acceptance in kernel, this series implements VFIO migration according to the new v2 protocol and replaces the now deprecated v1 implementation. The main differences between v1 and v2 migration protocols are: 1. VFIO device state is represented as a fini

[PATCH 3/9] vfio/migration: Fix NULL pointer dereference bug

2022-05-12 Thread Avihai Horon
As part of its error flow, vfio_vmstate_change() accesses MigrationState->to_dst_file without any checks. This can cause a NULL pointer dereference if the error flow is taken and MigrationState->to_dst_file is not set. For example, this can happen if VM is started or stopped not during migration a

[PULL 10/10] qemu-iotests: inline common.config into common.rc

2022-05-12 Thread Kevin Wolf
From: Paolo Bonzini common.rc has some complicated logic to find the common.config that dates back to xfstests and is completely unnecessary now. Just include the contents of the file. Signed-off-by: Paolo Bonzini Message-Id: <20220505094723.732116-1-pbonz...@redhat.com> Signed-off-by: Kevin W

[PATCH 5/9] migration/qemu-file: Add qemu_file_get_to_fd()

2022-05-12 Thread Avihai Horon
Add new function qemu_file_get_to_fd() that allows reading data from QEMUFile and writing it straight into a given fd. This will be used later in VFIO migration code. Signed-off-by: Avihai Horon --- migration/qemu-file.c | 34 ++ migration/qemu-file.h | 1 + 2 f

[PATCH 9/9] docs/devel: Align vfio-migration docs to VFIO migration v2

2022-05-12 Thread Avihai Horon
Align the vfio-migration documentation to VFIO migration protocol v2. Signed-off-by: Avihai Horon --- docs/devel/vfio-migration.rst | 77 +++ 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/docs/devel/vfio-migration.rst b/docs/devel/vfio-migration.

[PULL 09/10] nbd/server: Allow MULTI_CONN for shared writable exports

2022-05-12 Thread Kevin Wolf
From: Eric Blake According to the NBD spec, a server that advertises NBD_FLAG_CAN_MULTI_CONN promises that multiple client connections will not see any cache inconsistencies: when properly separated by a single flush, actions performed by one client will be visible to another client, regardless o

[PATCH] qga-vss: Add auto generated headers to dependencies

2022-05-12 Thread Konstantin Kostiuk
Signed-off-by: Konstantin Kostiuk --- qga/vss-win32/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build index 26c5dd6e0e..9483ccd3b8 100644 --- a/qga/vss-win32/meson.build +++ b/qga/vss-win32/meson.build @@ -7,7 +7,

Re: [PATCH v2] block/gluster: correctly set max_pdiscard

2022-05-12 Thread Stefano Garzarella
On Thu, May 12, 2022 at 12:30:48PM +0200, Fabian Ebner wrote: On 64-bit platforms, SIZE_MAX is too large for max_pdiscard, which is The main problem is that SIZE_MAX for an int64_t is a negative value. int64_t, and the following assertion would be triggered: qemu-system-x86_64: ../block/io.c:

[PATCH 6/9] vfio/migration: Implement VFIO migration protocol v2

2022-05-12 Thread Avihai Horon
Replace the current VFIO migration protocol v1 implementation with a new implementation corresponding to VFIO migration protocol v2. The main changes are: - VFIO device state is now represented as a finite state machine instead of a bitmap. - Migration interface with kernel is now done using VF

Re: [PATCH] util: Return void on iova_tree_remove

2022-05-12 Thread Eugenio Perez Martin
On Wed, Apr 27, 2022 at 5:50 PM Eugenio Pérez wrote: > > It always returns IOVA_OK so nobody uses it. > > Acked-by: Jason Wang > Reviewed-by: Peter Xu > Signed-off-by: Eugenio Pérez Hi! Friendly ping about this, is it something pending from my side? Thanks! > --- > include/qemu/iova-tree.h

[PATCH 7/9] vfio/migration: Reset device if setting recover state fails

2022-05-12 Thread Avihai Horon
If vfio_migration_set_state() fails to set the device in the requested state it tries to put it in a recover state. If setting the device in the recover state fails as well, hw_error is triggered and the VM is aborted. To improve user experience and avoid VM data loss, reset the device with VFIO_R

[PATCH 1/9] linux-headers: Update headers to v5.18-rc6

2022-05-12 Thread Avihai Horon
Signed-off-by: Avihai Horon --- .../linux/input-event-codes.h | 25 +- .../standard-headers/linux/virtio_config.h| 6 + .../standard-headers/linux/virtio_crypto.h| 82 +++- linux-headers/asm-arm64/kvm.h | 16 + linux-headers/asm-generic/mman-common.h

Re: [PULL V3 08/15] vhost: Shadow virtqueue buffers forwarding

2022-05-12 Thread Peter Maydell
On Tue, 15 Mar 2022 at 06:14, Jason Wang wrote: > > From: Eugenio Pérez > > Initial version of shadow virtqueue that actually forward buffers. There > is no iommu support at the moment, and that will be addressed in future > patches of this series. Since all vhost-vdpa devices use forced IOMMU, >

[PATCH 8/9] vfio: Alphabetize migration section of VFIO trace-events file

2022-05-12 Thread Avihai Horon
Sort the migration section of VFIO trace events file alphabetically and move two misplaced traces to common.c section. Signed-off-by: Avihai Horon --- hw/vfio/trace-events | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/vfio/trace-events b/hw/vfio/tr

[PATCH] qga-vss: Use a proper function for free memory

2022-05-12 Thread Konstantin Kostiuk
volume_name_wchar is allocated by 'void* operator new [](long long unsigned int) Signed-off-by: Konstantin Kostiuk --- qga/vss-win32/requester.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 4513324dd2..b

[PATCH 2/9] vfio: Fix compilation errors caused by VFIO migration v1 deprecation

2022-05-12 Thread Avihai Horon
VFIO migration protocol v1 was deprecated and as part of it some of the uAPI definitions were renamed. This caused compilation errors. Fix them. Signed-off-by: Avihai Horon --- hw/vfio/common.c| 6 +++--- hw/vfio/migration.c | 29 - 2 files changed, 19 insertions

Re: [PATCH] util: Return void on iova_tree_remove

2022-05-12 Thread Peter Xu
On Thu, May 12, 2022 at 05:48:47PM +0200, Eugenio Perez Martin wrote: > On Wed, Apr 27, 2022 at 5:50 PM Eugenio Pérez wrote: > > > > It always returns IOVA_OK so nobody uses it. > > > > Acked-by: Jason Wang > > Reviewed-by: Peter Xu > > Signed-off-by: Eugenio Pérez > > Hi! Friendly ping about

Re: [PATCH] vhost-user-scsi: avoid unlink(NULL) with fd passing

2022-05-12 Thread Peter Maydell
On Wed, 27 Apr 2022 at 11:04, Stefan Hajnoczi wrote: > > Commit 747421e949fc1eb3ba66b5fcccdb7ba051918241 ("Implements Backend > Program conventions for vhost-user-scsi") introduced fd-passing support > as part of implementing the vhost-user backend program conventions. > > When fd passing is used

Re: [PATCH v2] block/gluster: correctly set max_pdiscard

2022-05-12 Thread Stefano Garzarella
On Thu, May 12, 2022 at 05:44:13PM +0200, Stefano Garzarella wrote: On Thu, May 12, 2022 at 12:30:48PM +0200, Fabian Ebner wrote: On 64-bit platforms, SIZE_MAX is too large for max_pdiscard, which is The main problem is that SIZE_MAX for an int64_t is a negative value. int64_t, and the follo

Re: [PATCH v5 10/10] test: tpm-tis: Add Sysbus TPM-TIS device test

2022-05-12 Thread Eric Auger
Hi Peter, On 5/12/22 15:08, Peter Maydell wrote: > On Thu, 5 Mar 2020 at 16:52, Eric Auger wrote: >> The tests themselves are the same as the ISA device ones. >> Only the main() changes as the "tpm-tis-device" device gets >> instantiated. Also the base address of the device is not >> 0xFED4 a

Re: [PULL 06/13] nbd: remove peppering of nbd_client_connected

2022-05-12 Thread Peter Maydell
On Tue, 26 Apr 2022 at 21:21, Eric Blake wrote: > > From: Paolo Bonzini > > It is unnecessary to check nbd_client_connected() because every time > s->state is moved out of NBD_CLIENT_CONNECTED the socket is shut down > and all coroutines are resumed. Hi; Coverity points out (CID 1488362) that th

Re: [PATCH] Fix aarch64 debug register names.

2022-05-12 Thread Richard Henderson
On 5/12/22 02:42, Chris Howard wrote: From 5de17d5aacb9cf21de4c9736b227b0498c607709 Mon Sep 17 00:00:00 2001 From: CHRIS HOWARD Date: Thu, 12 May 2022 11:35:17 +0200 Subject: [PATCH] Fix aarch64 debug register names. Signed-off-by: CHRIS HOWARD --- target/arm/helper.c | 16

Re: [PULL 12/15] migration/block: rename BLOCK_SIZE macro

2022-05-12 Thread Peter Maydell
On Fri, 28 Feb 2020 at 09:30, Juan Quintela wrote: > > From: Stefan Hajnoczi > > Both and define BLOCK_SIZE macros. Avoiding > using that name in block/migration.c. > > I noticed this when including (Linux io_uring) from > "block/aio.h" and compilation failed. Although patches adding that >

Re: [PULL v2 18/24] ACPI ERST: support for ACPI ERST feature

2022-05-12 Thread Peter Maydell
On Sun, 6 Feb 2022 at 09:38, Michael S. Tsirkin wrote: > > From: Eric DeVolder > > This implements a PCI device for ACPI ERST. This implements the > non-NVRAM "mode" of operation for ERST as it is supported by > Linux and Windows. > > Signed-off-by: Eric DeVolder > Reviewed-by: Ani Sinha > Mess

Re: [PATCH v5 10/10] test: tpm-tis: Add Sysbus TPM-TIS device test

2022-05-12 Thread Peter Maydell
On Thu, 12 May 2022 at 16:59, Eric Auger wrote: > > Hi Peter, > > On 5/12/22 15:08, Peter Maydell wrote: > > On Thu, 5 Mar 2020 at 16:52, Eric Auger wrote: > >> The tests themselves are the same as the ISA device ones. > >> Only the main() changes as the "tpm-tis-device" device gets > >> instanti

Re: [PATCH v5 11/21] migration: Postcopy preemption preparation on channel creation

2022-05-12 Thread Peter Xu
On Wed, May 11, 2022 at 10:38:00PM +0530, manish.mishra wrote: > LGTM Manish, Do you mean you reviewed the patch? Do you want me to attach this as a Reviewed-By tag in my next post? It'll be great if you can provide it by replying with the R-b tag. I can also attach it after your confirmation.

Re: [PATCH v4 10/19] migration: Postcopy preemption enablement

2022-05-12 Thread Peter Xu
Hi, Manish, On Wed, May 11, 2022 at 09:24:28PM +0530, manish.mishra wrote: > > @@ -1962,9 +2038,17 @@ static bool get_queued_page(RAMState *rs, > > PageSearchStatus *pss) > > RAMBlock *block; > > ram_addr_t offset; > > +again: > > block = unqueue_page(rs, &offset); > > -if

Re: [PULL v2 01/31] hw/ssi: Add Ibex SPI device model

2022-05-12 Thread Peter Maydell
On Fri, 22 Apr 2022 at 01:40, Alistair Francis wrote: > > From: Wilfred Mallawa > > Adds the SPI_HOST device model for ibex. The device specification is as per > [1]. The model has been tested on opentitan with spi_host unit tests > written for TockOS. > > [1] https://docs.opentitan.org/hw/ip/spi

Re: [PATCH v2 1/6] hw/intc/arm_gicv3_cpuif: Handle CPUs that don't specify GICv3 parameters

2022-05-12 Thread Richard Henderson
On 5/12/22 08:14, Peter Maydell wrote: We allow a GICv3 to be connected to any CPU, but we don't do anything to handle the case where the CPU type doesn't in hardware have a GICv3 CPU interface and so the various GIC configuration fields (gic_num_lrs, vprebits, vpribits) are not specified. The c

Re: [PATCH] util: Return void on iova_tree_remove

2022-05-12 Thread Laurent Vivier
On 12/05/2022 18:03, Peter Xu wrote: On Thu, May 12, 2022 at 05:48:47PM +0200, Eugenio Perez Martin wrote: On Wed, Apr 27, 2022 at 5:50 PM Eugenio Pérez wrote: It always returns IOVA_OK so nobody uses it. Acked-by: Jason Wang Reviewed-by: Peter Xu Signed-off-by: Eugenio Pérez Hi! Friend

Re: [PULL 00/10] Block layer patches

2022-05-12 Thread Richard Henderson
On 5/12/22 08:33, Kevin Wolf wrote: The following changes since commit ec11dc41eec5142b4776db1296972c6323ba5847: Merge tag 'pull-misc-2022-05-11' of git://repo.or.cz/qemu/armbru into staging (2022-05-11 09:00:26 -0700) are available in the Git repository at: git://repo.or.cz/qemu/kevin.

Re: [PATCH] qga-vss: Add auto generated headers to dependencies

2022-05-12 Thread Marc-André Lureau
Hi On Thu, May 12, 2022 at 5:49 PM Konstantin Kostiuk wrote: > > Signed-off-by: Konstantin Kostiuk > --- > qga/vss-win32/meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build > index 26c5dd6e0e..9483ccd3b8 1006

Re: [PATCH] qga-vss: Use a proper function for free memory

2022-05-12 Thread Marc-André Lureau
On Thu, May 12, 2022 at 5:49 PM Konstantin Kostiuk wrote: > > volume_name_wchar is allocated by 'void* operator new [](long long unsigned > int) > > Signed-off-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau > --- > qga/vss-win32/requester.cpp | 4 ++-- > 1 file changed, 2 insertions(+

Re: [PATCH] qga-vss: Add auto generated headers to dependencies

2022-05-12 Thread Konstantin Kostiuk
Hi On Thu, May 12, 2022 at 8:00 PM Marc-André Lureau < marcandre.lur...@redhat.com> wrote: > Hi > > On Thu, May 12, 2022 at 5:49 PM Konstantin Kostiuk > wrote: > > > > Signed-off-by: Konstantin Kostiuk > > --- > > qga/vss-win32/meson.build | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion

[PULL 00/27] Misc patches for 2022-05-12

2022-05-12 Thread Paolo Bonzini
The following changes since commit ec11dc41eec5142b4776db1296972c6323ba5847: Merge tag 'pull-misc-2022-05-11' of git://repo.or.cz/qemu/armbru into staging (2022-05-11 09:00:26 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fe

[PULL 05/27] meson: Make mremap() detecting works correctly

2022-05-12 Thread Paolo Bonzini
From: Juan Quintela Without this (at least in Fedora 35) it don't detect mremap() correctly. Signed-off-by: Juan Quintela Message-Id: <20220502131119.2345-1-quint...@redhat.com> [Also switch the LEGACY_RDMA_REG_MR test to cc.links, otherwise Debian fails to build. - Paolo] Signed-off-by: Paolo

[PULL 01/27] pc-bios/optionrom: detect -fno-pie

2022-05-12 Thread Paolo Bonzini
Do not rely on the detection that was done in the configure script, since in the future we may want to cross-compile this file. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- configure | 1 - pc-bios/optionrom/Makefile | 3 ++- 2 files changed, 2 insertions(+),

[PULL 02/27] pc-bios/optionrom: compile with -Wno-array-bounds

2022-05-12 Thread Paolo Bonzini
Avoids the following bogus warning: pvh_main.c: In function ‘pvh_load_kernel’: pvh_main.c:101:42: warning: array subscript 0 is outside array bounds of ‘uint16_t[0]’ {aka ‘short unsigned int[]’} [-Warray-bounds] 101 | uint32_t ebda_paddr = ((uint32_t)*((uint16_t *)EBDA_BASE_ADDR)) << 4

[PULL 08/27] tests/qtest/libqos/pci: Introduce pio_limit

2022-05-12 Thread Paolo Bonzini
From: Eric Auger At the moment the IO space limit is hardcoded to QPCI_PIO_LIMIT = 0x1. When accesses are performed to a bar, the base address of this latter is compared against the limit to decide whether we perform an IO or a memory access. On ARM, we cannot keep this PIO limit as the arm-

[PULL 09/27] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable

2022-05-12 Thread Paolo Bonzini
From: Eric Auger ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger Acked-by: Thomas H

[PULL 03/27] target/i386: do not consult nonexistent host leaves

2022-05-12 Thread Paolo Bonzini
When cache_info_passthrough is requested, QEMU passes the host values of the cache information CPUID leaves down to the guest. However, it blindly assumes that the CPUID leaf exists on the host, and this cannot be guaranteed: for example, KVM has recently started to synthesize AMD leaves up to 0x8

[PULL 04/27] checkpatch: fix g_malloc check

2022-05-12 Thread Paolo Bonzini
Use the string equality operator "eq", and ensure that $1 is defined by using "(try|)" instead of "(try)?". The alternative "((?:try)?)" is longer and less readable. Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sc

[PULL 10/27] tests/qtest/libqos: Add generic pci host bridge in arm-virt machine

2022-05-12 Thread Paolo Bonzini
From: Eric Auger Up to now the virt-machine node contains a virtio-mmio node. However no driver produces any PCI interface node. Hence, PCI tests cannot be run with aarch64 binary. Add a GPEX driver node that produces a pci interface node. This latter then can be consumed by all the pci tests. O

[PULL 06/27] hw/xen/xen_pt: Confine igd-passthrough-isa-bridge to XEN

2022-05-12 Thread Paolo Bonzini
From: Bernhard Beschow igd-passthrough-isa-bridge is only requested in xen_pt but was implemented in pc_piix.c. This caused xen_pt to dependend on i386/pc which is hereby resolved. Signed-off-by: Bernhard Beschow Acked-by: Anthony PERARD Message-Id: <20220326165825.30794-2-shen...@gmail.com> S

[PULL 15/27] machine: move more memory validation to Machine object

2022-05-12 Thread Paolo Bonzini
This allows setting memory properties without going through vl.c, and have them validated just the same. Signed-off-by: Paolo Bonzini Message-Id: <20220414165300.555321-6-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 21 +++-- softmmu/vl.c | 17 +

[PULL 14/27] machine: make memory-backend a link property

2022-05-12 Thread Paolo Bonzini
Handle HostMemoryBackend creation and setting of ms->ram entirely in machine_run_board_init. Signed-off-by: Paolo Bonzini Message-Id: <20220414165300.555321-5-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 70 ++--- hw/core/nu

[PULL 07/27] hw/xen/xen_pt: Resolve igd_passthrough_isa_bridge_create() indirection

2022-05-12 Thread Paolo Bonzini
From: Bernhard Beschow Now that igd_passthrough_isa_bridge_create() is implemented within the xen context it may use Xen* data types directly and become xen_igd_passthrough_isa_bridge_create(). This resolves an indirection. Signed-off-by: Bernhard Beschow Acked-by: Anthony PERARD Message-Id: <

[PULL 12/27] machine: add boot compound property

2022-05-12 Thread Paolo Bonzini
Make -boot syntactic sugar for a compound property "-machine boot.{order,menu,...}". machine_boot_parse is replaced by the setter for the property. Signed-off-by: Paolo Bonzini Message-Id: <20220414165300.555321-3-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 100

[PULL 16/27] slirp: bump submodule past 4.7 release

2022-05-12 Thread Paolo Bonzini
Version 4.7 of slirp provides a new timer API that works better with CFI, together with several other improvements: * Allow disabling the internal DHCP server !22 * Support Unix sockets in hostfwd !103 * IPv6 DNS proxying support !110 * bootp: add support for UEFI HTTP boot !111 and bugfixes. Th

[PULL 11/27] machine: use QAPI struct for boot configuration

2022-05-12 Thread Paolo Bonzini
As part of converting -boot to a property with a QAPI type, define the struct and use it throughout QEMU to access boot configuration. machine_boot_parse takes care of doing the QemuOpts->QAPI conversion by hand, for now. Signed-off-by: Paolo Bonzini Message-Id: <20220414165300.555321-2-pbonz...@

[PULL 17/27] net: slirp: introduce a wrapper struct for QemuTimer

2022-05-12 Thread Paolo Bonzini
This struct will be extended in the next few patches to support the new slirp_handle_timer() call. For that we need to store an additional "int" for each SLIRP timer, in addition to the cb_opaque. Reviewed-by: Samuel Thibault Reviewed-by: Marc-André Lureau Signed-off-by: Paolo Bonzini --- net

[PULL 24/27] vhost-backend: do not depend on CONFIG_VHOST_VSOCK

2022-05-12 Thread Paolo Bonzini
The vsock callbacks .vhost_vsock_set_guest_cid and .vhost_vsock_set_running are the only ones to be conditional on #ifdef CONFIG_VHOST_VSOCK. This is different from any other device-dependent callbacks like .vhost_scsi_set_endpoint, and it also broke when CONFIG_VHOST_VSOCK was changed to a per-ta

[PULL 18/27] net: slirp: switch to slirp_new

2022-05-12 Thread Paolo Bonzini
Replace slirp_init with slirp_new, so that a more recent cfg.version can be specified. The function appeared in version 4.1.0. Signed-off-by: Paolo Bonzini --- meson.build | 2 +- net/slirp.c | 27 +-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/meso

[PULL 13/27] machine: add mem compound property

2022-05-12 Thread Paolo Bonzini
Make -m syntactic sugar for a compound property "-machine mem.{size,max-size,slots}". The new property does not have the magic conversion to megabytes of unsuffixed arguments, and also does not understand that "0" means the default size (you have to leave it out to get the default). This means th

[PULL 25/27] meson: link libpng independent of vnc

2022-05-12 Thread Paolo Bonzini
From: Kshitij Suri Currently png support is dependent on vnc for linking object file to libpng. This commit makes the parameter independent of vnc as it breaks system emulator with --disable-vnc unless --disable-png is added. Fixes: 9a0a119a38 ("Added parameter to take screenshot with screendump

[PULL 19/27] net: slirp: add support for CFI-friendly timer API

2022-05-12 Thread Paolo Bonzini
libslirp 4.7 introduces a CFI-friendly version of the .timer_new callback. The new callback replaces the function pointer with an enum; invoking the callback is done with a new function slirp_handle_timer. Support the new API so that CFI can be made compatible with using a system libslirp. Review

[PULL 22/27] coroutine-lock: introduce qemu_co_queue_enter_all

2022-05-12 Thread Paolo Bonzini
Because qemu_co_queue_restart_all does not release the lock, it should be used only in coroutine context. Introduce a new function that, like qemu_co_enter_next, does release the lock, and use it whenever qemu_co_queue_restart_all was used outside coroutine context. Signed-off-by: Paolo Bonzini

[PULL 20/27] net: slirp: allow CFI with libslirp >= 4.7

2022-05-12 Thread Paolo Bonzini
slirp 4.7 introduces a new CFI-friendly timer callback that does not pass function pointers within libslirp as callbacks for timers. Check the version number and, if it is new enough, allow using CFI even with a system libslirp. Reviewed-by: Samuel Thibault Reviewed-by: Marc-André Lureau Signed-

[PULL 26/27] vl: make machine type deprecation a warning

2022-05-12 Thread Paolo Bonzini
error_report should generally be followed by a failure; if we can proceed anyway, that is just a warning and should be communicated properly to the user with warn_report. Reviewed-by: Markus Armbruster Message-Id: <20220511175043.27327-1-pbonz...@redhat.com> Signed-off-by: Paolo Bonzini --- sof

[PULL 21/27] coroutine-lock: qemu_co_queue_next is a coroutine-only qemu_co_enter_next

2022-05-12 Thread Paolo Bonzini
qemu_co_queue_next is basically the same as qemu_co_enter_next but without a QemuLockable argument. That's perfectly fine, but only as long as the function is marked coroutine_fn. If used outside coroutine context, qemu_co_queue_wait will attempt to take the lock and that is just broken: if you a

[PULL 23/27] coroutine-lock: qemu_co_queue_restart_all is a coroutine-only qemu_co_enter_all

2022-05-12 Thread Paolo Bonzini
qemu_co_queue_restart_all is basically the same as qemu_co_enter_all but without a QemuLockable argument. That's perfectly fine, but only as long as the function is marked coroutine_fn. If used outside coroutine context, qemu_co_queue_wait will attempt to take the lock and that is just broken: if

Re: [PATCH v5 14/21] migration: Create the postcopy preempt channel asynchronously

2022-05-12 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > This patch allows the postcopy preempt channel to be created > asynchronously. The benefit is that when the connection is slow, we won't > take the BQL (and potentially block all things like QMP) for a long time > without releasing. > > A function postcopy_

[PULL 27/27] vmxcap: add tertiary execution controls

2022-05-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/kvm/vmxcap | 17 + 1 file changed, 17 insertions(+) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index f140040104..ce27f5e635 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -23,6 +23,7 @@ MSR_IA32_VMX_TRUE_PROCBASED_CT

[PATCH 3/6] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base

2022-05-12 Thread Eugenio Pérez
Fixes: 6d0b222666 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ") Acked-by: Jason Wang Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index a30510ed17..493269b0b5 10

Re: [PATCH v5 16/21] migration: Add helpers to detect TLS capability

2022-05-12 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add migrate_tls_enabled() to detect whether TLS is configured. > > Add migrate_channel_requires_tls() to detect whether the specific channel > requires TLS. > > No functional change intended. > > Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilber

Re: [RFC PATCH v2 3/7] target/ppc: Implemented pmxvi*ger* instructions

2022-05-12 Thread Lucas Mateus Martins Araujo e Castro
On 08/05/2022 00:48, Richard Henderson wrote: On 5/6/22 07:18, Lucas Mateus Castro(alqotel) wrote: +{ +    arg_MMIRR_XX3 m; +    m.xa = a->xa; +    m.xb = a->xb; +    m.xt = a->xt; +    m.pmsk = 0xFF; +    m.ymsk = 0xF; +    m.xmsk = 0xF; +    return do_ger_MMIRR_XX3(ctx, &m, helper);   } Is

Re: [RFC PATCH v4 09/36] KVM: Introduce kvm_arch_pre_create_vcpu()

2022-05-12 Thread Isaku Yamahata
On Thu, May 12, 2022 at 11:17:36AM +0800, Xiaoyao Li wrote: > Introduce kvm_arch_pre_create_vcpu(), to perform arch-dependent > work prior to create any vcpu. This is for i386 TDX because it needs > call TDX_INIT_VM before creating any vcpu. Because "11/36 i386/tdx: Initialize TDX before creatin

Re: [RFC PATCH v4 06/36] i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES

2022-05-12 Thread Isaku Yamahata
On Thu, May 12, 2022 at 11:17:33AM +0800, Xiaoyao Li wrote: > KVM provides TDX capabilities via sub command KVM_TDX_CAPABILITIES of > IOCTL(KVM_MEMORY_ENCRYPT_OP). Get the capabilities when initializing > TDX context. It will be used to validate user's setting later. > > Besides, introduce the i

[PATCH 4/6] vdpa: Fix index calculus at vhost_vdpa_svqs_start

2022-05-12 Thread Eugenio Pérez
With the introduction of MQ the index of the vq needs to be calculated with the device model vq_index. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c

Re: [PATCH v5 15/21] migration: Parameter x-postcopy-preempt-break-huge

2022-05-12 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Add a parameter that can conditionally disable the "break sending huge > page" behavior in postcopy preemption. By default it's enabled. > > It should only be used for debugging purposes, and we should never remove > the "x-" prefix. This is actually a 'pr

Re: [PATCH 2/9] vfio: Fix compilation errors caused by VFIO migration v1 deprecation

2022-05-12 Thread Alex Williamson
On Thu, 12 May 2022 18:43:13 +0300 Avihai Horon wrote: > VFIO migration protocol v1 was deprecated and as part of it some of the > uAPI definitions were renamed. This caused compilation errors. > Fix them. > > Signed-off-by: Avihai Horon > --- > hw/vfio/common.c| 6 +++--- > hw/vfio/migra

[PATCH 6/6] vhost: Fix element in vhost_svq_add failure

2022-05-12 Thread Eugenio Pérez
Coverity rightly reports that is not free in that case. Fixes: Coverity CID 1487559 Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/virtio/vhost-sh

Re: [RFC PATCH v4 24/36] i386/tdx: Add TDVF memory via KVM_TDX_INIT_MEM_REGION

2022-05-12 Thread Isaku Yamahata
On Thu, May 12, 2022 at 11:17:51AM +0800, Xiaoyao Li wrote: > From: Isaku Yamahata > > TDVF firmware (CODE and VARS) needs to be added/copied to TD's private > memory via KVM_TDX_INIT_MEM_REGION, as well as TD HOB and TEMP memory. > > Signed-off-by: Isaku Yamahata > Signed-off-by: Xiaoyao Li

Re: [PATCH qemu] spapr: Use address from elf parser for kernel address

2022-05-12 Thread Daniel Henrique Barboza
On 5/4/22 03:55, Alexey Kardashevskiy wrote: tl;dr: This allows Big Endian zImage booting via -kernel + x-vof=on. QEMU loads the kernel at 0x40 by default which works most of the time as Linux kernels are relocatable, 64bit and compiled with "-pie" (position independent code). This works

[PATCH 0/6] Shadow VirtQueue Fixes

2022-05-12 Thread Eugenio Pérez
Random fixes found while developing control virtqueue + multiqueue but the last one, found by coverity. The previous one is a patch created by Philippe Mathieu-Daudé , send as a RFC in another series but already acked. All but Philippe's ones are bugs non-triggable, since there is still no possibi

Re: [PATCH 0/9] vfio/migration: Implement VFIO migration protocol v2

2022-05-12 Thread Alex Williamson
On Thu, 12 May 2022 18:43:11 +0300 Avihai Horon wrote: > Hello, > > Following VFIO migration protocol v2 acceptance in kernel, this series > implements VFIO migration according to the new v2 protocol and replaces > the now deprecated v1 implementation. Let's not bottleneck others waiting on a l

Re: [RFC PATCH v4 10/36] i386/kvm: Move architectural CPUID leaf generation to separate helper

2022-05-12 Thread Isaku Yamahata
On Thu, May 12, 2022 at 11:17:37AM +0800, Xiaoyao Li wrote: > diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h > index b434feaa6b1d..5c7972f617e8 100644 > --- a/target/i386/kvm/kvm_i386.h > +++ b/target/i386/kvm/kvm_i386.h > @@ -24,6 +24,10 @@ > #define kvm_ioapic_in_kernel()

[PATCH 2/6] vhost: Fix device's used descriptor dequeue

2022-05-12 Thread Eugenio Pérez
Only the first one of them were properly enqueued back. Fixes: 100890f7ca ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-sha

[PATCH 1/6] vhost: Track descriptor chain in private at SVQ

2022-05-12 Thread Eugenio Pérez
The device could have access to modify them, and it definitely have access when we implement packed vq. Harden SVQ maintaining a private copy of the descriptor chain. Other fields like buffer addresses are already maintained sepparatedly. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-v

Re: [RFC PATCH v4 36/36] docs: Add TDX documentation

2022-05-12 Thread Isaku Yamahata
On Thu, May 12, 2022 at 11:18:03AM +0800, Xiaoyao Li wrote: > Add docs/system/i386/tdx.rst for TDX support, and add tdx in > confidential-guest-support.rst > > Signed-off-by: Xiaoyao Li > --- > docs/system/confidential-guest-support.rst | 1 + > docs/system/i386/tdx.rst | 1

<    1   2   3   >