Re: QEMU | Heap-overflow in virtio_net_queue_enable (#1309)

2022-11-09 Thread Xuan Zhuo
On Thu, 10 Nov 2022 13:18:54 +0800, Jason Wang wrote: > On Thu, Nov 10, 2022 at 1:12 PM Michael S. Tsirkin wrote: > > > > Xuan Zhuo pls take a look ASAP. > > > > On Thu, Nov 10, 2022 at 03:04:41AM +, Alexander Bulekov (@a1xndr) wrote: > > Alexander Bulekov created an issue: #1309 > > > > Hell

[PATCH] net: stream: add a new option to automatically reconnect

2022-11-09 Thread Laurent Vivier
In stream mode, if the server shuts down there is currently no way to reconnect the client to a new server without removing the NIC device and the netdev backend (or to reboot). This patch introduces a reconnect option that specifies a delay to try to reconnect with the same parameters. Add a new

[RFC] libvhost-user: Add report when allocation failures

2022-11-09 Thread jianchunfu
Add error report when malloc fails of virtqueue element. It's a little pointless to return NULL, wouldn't it be right to report error and exit when malloc fails since it is in a standalone project while not QEMU. Signed-off-by: jianchunfu --- subprojects/libvhost-user/libvhost-user.c | 4 1

[PATCH for-7.2 v2 2/6] hw/nvme: fix cancellation of format operations

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Cancelling a format operation neglects to set iocb->ret as well as clearing the iocb->aiocb after cancelling the underlying aiocb. Fix this. Fixes: 3bcf26d3d619 ("hw/nvme: reimplement format nvm to allow cancellation") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 3 +++

[PATCH for-7.2 v2 4/6] hw/nvme: fix cancellation handling in zone reset

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen If the zone reset operation is cancelled but the block unmap operation completes normally, the callback will continue resetting the next zone since it neglects to check iocb->ret which will have been set to -ECANCELED. Make sure that this is checked and bail out if an error is

[PATCH for-7.2 v2 1/6] hw/nvme: fix accidental reintroduction of redundant code

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Commit 44219b6029fc ("hw/nvme: 64-bit pi support") accidentially reintroduced code that was removed in commit a6de6ed5092c ("hw/nvme: move format parameter parsing"). It is beneign, but get rid of it anyway. Fixes: 44219b6029fc ("hw/nvme: 64-bit pi support") Signed-off-by: Kl

[PATCH for-7.2 v2 0/6] hw/nvme: misc fixes

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Dmitrys fix (nvme-next commit "hw/nvme: add missing return statement") for dsm prompted me to audit the flush, dsm and zone reset code. That resulted in the discovery of some bugs relating to correct cancellation. Klaus Jensen (6): hw/nvme: fix accidental reintroduction of r

[PATCH for-7.2 v2 5/6] hw/nvme: fix cancellation handling in dsm

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen When the DSM operation is cancelled asynchronously, we set iocb->ret to -ECANCELED. However, the callback function only checks the return value of the completed aio, which may have completed succesfully prior to the cancellation and thus the callback ends up continuing the dsm

[PATCH for-7.2 v2 3/6] hw/nvme: fix flush cancel

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Make sure that iocb->aiocb is NULL'ed when cancelling. Fixes: 38f4ac65ac88 ("hw/nvme: reimplement flush to allow cancellation") Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 819c020671

[PATCH for-7.2 v2 6/6] hw/nvme: fix numzrwa handling

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Number of ZRWA Resources should be initialized to Max Active Resources, and not the total number of zones. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 8 ++-- hw/nvme/ns.c | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw

Re: QEMU | Heap-overflow in virtio_net_queue_enable (#1309)

2022-11-09 Thread Xuan Zhuo
On Thu, 10 Nov 2022 00:11:00 -0500, "Michael S. Tsirkin" wrote: > Xuan Zhuo pls take a look ASAP. > > On Thu, Nov 10, 2022 at 03:04:41AM +, Alexander Bulekov (@a1xndr) wrote: > Alexander Bulekov created an issue: #1309 > > Hello, > > I bisected this to 7f863302 ("virtio-net: support queue_ena

[PATCH 09/10] util: Remove qemu_get_local_state_dir()

2022-11-09 Thread Akihiko Odaki
There are no users of the function anymore. Signed-off-by: Akihiko Odaki --- include/qemu/osdep.h | 8 util/oslib-posix.c | 6 -- util/oslib-win32.c | 10 -- 3 files changed, 24 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 86445aad25..f2

[PATCH 10/10] spice-app: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() provides QEMU-specific fallback of runtime directory. Signed-off-by: Akihiko Odaki --- ui/spice-app.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/spice-app.c b/ui/spice-app.c index 7e71e18da9..feb162baa7 100644 --- a/ui/spice-app.c +++ b/ui/s

[PATCH 07/10] virtiofsd: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to a lock file. Signed-off-by: Akihiko Odaki --- tools/virtiofsd/fuse_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 9368e292e4..b9eeed85e6

[PATCH 08/10] module: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the path to module upgrades. Signed-off-by: Akihiko Odaki --- util/module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 8ddb0e18f5..50f52b7232 100644 --- a/util/module.c +++ b/util/module.c

[PATCH 06/10] scsi: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default paths. Signed-off-by: Akihiko Odaki --- scsi/qemu-pr-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c index 196b78c00d..adb7baecaa 100644 --- a/scsi/qemu-pr-hel

[PATCH 04/10] contrib/rdmacm-mux: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default Unix socket path. Signed-off-by: Akihiko Odaki --- contrib/rdmacm-mux/main.c | 22 ++ contrib/rdmacm-mux/meson.build | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/contrib/rdmacm-mux/main.c

[PATCH 05/10] qga: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default state directory. Signed-off-by: Akihiko Odaki --- qga/main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qga/main.c b/qga/main.c index b3580508fa..dc875079f0 100644 --- a/qga/main.c +++ b/qga/main.c @@ -46,1

[PATCH 01/10] qga: Remove platform GUID definitions

2022-11-09 Thread Akihiko Odaki
GUID_DEVINTERFACE_DISK and GUID_DEVINTERFACE_STORAGEPORT are already defined by MinGW-w64. They are not only unnecessary, but can lead to duplicate definition errors at link time with some unknown condition. Signed-off-by: Akihiko Odaki --- qga/commands-win32.c | 7 --- 1 file changed, 7 del

Re: [PATCH v6 10/10] vdpa: Always start CVQ in SVQ mode

2022-11-09 Thread Jason Wang
在 2022/11/9 01:07, Eugenio Pérez 写道: Isolate control virtqueue in its own group, allowing to intercept control commands but letting dataplane run totally passthrough to the guest. I think we need to tweak the title to "vdpa: Always start CVQ in SVQ mode if possible". Since SVQ for CVQ can't

[PATCH 03/10] ivshmem-server: Use qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() is used to construct the default PID file path. Signed-off-by: Akihiko Odaki --- contrib/ivshmem-server/main.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index 224d

[PATCH 02/10] util: Introduce qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH 00/10] util: Introduce qemu_get_runtime_dir()

2022-11-09 Thread Akihiko Odaki
qemu_get_runtime_dir() returns a dynamically allocated directory path that is appropriate for storing runtime files. It corresponds to "run" directory in Unix. With a tree-wide search, it was found that there are several cases where such a functionality is implemented so let's have one as a common

[PATCH v2 1/2] hw/nvme: fix incorrect use of errp/local_err

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Make nvme_check_constraints() return a bool and fix an invalid error propagation where the actual error is thrown away in favor of an unused local Error value. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 48 +++- 1 file change

[PATCH v2 2/2] hw/nvme: cleanup error reporting in nvme_init_pci()

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Replace the local Error variable with errp and ERRP_GUARD() and change the return value to bool. Reviewed-by: Markus Armbruster Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/hw/nv

[PATCH v2 0/2] hw/nvme: errp fixes

2022-11-09 Thread Klaus Jensen
From: Klaus Jensen Fix a couple of invalid errp usages. Klaus Jensen (2): hw/nvme: fix incorrect use of errp/local_err hw/nvme: cleanup error reporting in nvme_init_pci() hw/nvme/ctrl.c | 71 +++--- 1 file changed, 33 insertions(+), 38 deletions(

Re: [PATCH v6 09/10] vdpa: Add listener_shadow_vq to vhost_vdpa

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > The memory listener that thells the device how to convert GPA to qemu's > va is registered against CVQ vhost_vdpa. This series try to map the > memory listener translations to ASID 0, while it maps the CVQ ones to > ASID 1. > > Let's tell the

Re: [PATCH v6 07/10] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > So the caller can choose which ASID is destined. > > No need to update the batch functions as they will always be called from > memory listener updates at the moment. Memory listener updates will > always update ASID 0, as it's the passthroug

Re: [PATCH] qga: Allow building of the guest agent without system emulators or tools

2022-11-09 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 9/11/22 18:37, Thomas Huth wrote: >> If configuring with "--disable-system --disable-user --enable-guest-agent" >> the linking currently fails with: >> >> qga/qemu-ga.p/commands.c.o: In function `qmp_command_info': >> build/../../home/thuth/devel/qemu/qga/comm

Re: [PATCH for-8.0 9/9] hw/intc: Convert TYPE_KVM_ARM_ITS to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_KVM_ARM_ITS device to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its_kvm.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for-8.0 8/9] hw/intc: Convert TYPE_ARM_GICV3_ITS to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_GICV3_ITS device to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for-8.0 7/9] hw/intc: Convert TYPE_ARM_GICV3_ITS_COMMON to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_GICV3_ITS_COMMON parent class to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its_common.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for-8.0 6/9] hw/intc: Convert TYPE_KVM_ARM_GICV3 to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_KVM_ARM_GICV3 device to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_kvm.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for-8.0 5/9] hw/intc: Convert TYPE_ARM_GICV3_COMMON to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_GICV3_COMMON parent class to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_common.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH for-8.0 4/9] hw/intc: Convert TYPE_ARM_GIC_KVM to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Now we have converted TYPE_ARM_GIC_COMMON, we can convert the TYPE_ARM_GIC_KVM subclass to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gic_kvm.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Richard

Re: [PATCH for-8.0 3/9] hw/intc: Convert TYPE_ARM_GIC_COMMON to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_GIC_COMMON device to 3-phase reset. This is a simple no-behaviour-change conversion. Signed-off-by: Peter Maydell --- hw/intc/arm_gic_common.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Richard Hend

Re: [PATCH for-8.0 2/9] hw/arm: Convert TYPE_ARM_SMMUV3 to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_SMMUV3 device to 3-phase reset. The legacy reset method doesn't do anything that's invalid in the hold phase, so the conversion only requires changing it to a hold phase method, and using the 3-phase versions of the "save the parent re

Re: [PATCH for-8.0 1/9] hw/arm: Convert TYPE_ARM_SMMU to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 03:14, Peter Maydell wrote: Convert the TYPE_ARM_SMMU device to 3-phase reset. The legacy method doesn't do anything that's invalid in the hold phase, so the conversion is simple and not a behaviour change. Note that we must convert this base class before we can convert the TYPE_ARM

Re: [PATCH v6 05/10] vdpa: move SVQ vring features check to net/

2022-11-09 Thread Jason Wang
在 2022/11/9 01:07, Eugenio Pérez 写道: The next patches will start control SVQ if possible. However, we don't know if that will be possible at qemu boot anymore. If I was not wrong, there's no device specific feature that is checked in the function. So it should be general enough to be used b

Re: [PATCH for-8.0 2/2] hw/input/ps2.c: Convert TYPE_PS2_{KBD, MOUSE}_DEVICE to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 04:00, Peter Maydell wrote: Convert the child classes TYPE_PS2_KBD_DEVICE and TYPE_PS2_MOUSE_DEVICE to the 3-phase reset system. This allows us to stop using the old device_class_set_parent_reset() function. We don't need to register an 'exit' phase function for the subclasses, beca

Re: [PATCH for-8.0 1/2] hw/input/ps2: Convert TYPE_PS2_DEVICE to 3-phase reset

2022-11-09 Thread Richard Henderson
On 11/10/22 04:00, Peter Maydell wrote: Convert the parent class TYPE_PS2_DEVICE to 3-phase reset. Note that we need an 'exit' phase function as well as the usual 'hold' phase function, because changing outbound IRQ line state is only permitted in 'exit'. (Strictly speaking it's not supposed to

Re: [PATCH v1 4/4] target/riscv: Add itrigger_enabled field to CPURISCVState

2022-11-09 Thread Richard Henderson
On 11/10/22 13:15, LIU Zhiwei wrote: +static int debug_post_load(void *opaque, int version_id) +{ +    RISCVCPU *cpu = opaque; +    CPURISCVState *env = &cpu->env; + +    if (icount_enabled()) { +    env->itrigger_enabled = riscv_itrigger_enabled(env); +    } + +    return 0; +} +   static co

Re: [PATCH v6 04/10] vdpa: add vhost_vdpa_net_valid_svq_features

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > It will be reused at vdpa device start so let's extract in its own function > > Signed-off-by: Eugenio Pérez > --- Acked-by: Jason Wang Thanks > net/vhost-vdpa.c | 26 +- > 1 file changed, 17 insertions(+), 9 del

Re: [PATCH v6 03/10] vhost: Allocate SVQ device file descriptors at device start

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > The next patches will start control SVQ if possible. However, we don't > know if that will be possible at qemu boot anymore. > > Delay device file descriptors until we know it at device start. > > Signed-off-by: Eugenio Pérez Acked-by: Jaso

Re: [PATCH v6 02/10] vhost: set SVQ device call handler at SVQ start

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > By the end of this series CVQ is shadowed as long as the features > support it. > > Since we don't know at the beginning of qemu running if this is > supported, move the event notifier handler setting to the start of the > SVQ, instead of the

Re: [PATCH v6 01/10] vdpa: Use v->shadow_vqs_enabled in vhost_vdpa_svqs_start & stop

2022-11-09 Thread Jason Wang
On Wed, Nov 9, 2022 at 1:08 AM Eugenio Pérez wrote: > > This function used to trust in v->shadow_vqs != NULL to know if it must > start svq or not. > > This is not going to be valid anymore, as qemu is going to allocate svq > unconditionally (but it will only start them conditionally). It might b

Re: QEMU | Heap-overflow in virtio_net_queue_enable (#1309)

2022-11-09 Thread Jason Wang
On Thu, Nov 10, 2022 at 1:12 PM Michael S. Tsirkin wrote: > > Xuan Zhuo pls take a look ASAP. > > On Thu, Nov 10, 2022 at 03:04:41AM +, Alexander Bulekov (@a1xndr) wrote: > Alexander Bulekov created an issue: #1309 > > Hello, > > I bisected this to 7f863302 ("virtio-net: support queue_enable")

Re: QEMU | Heap-overflow in virtio_net_queue_enable (#1309)

2022-11-09 Thread Michael S. Tsirkin
Xuan Zhuo pls take a look ASAP. On Thu, Nov 10, 2022 at 03:04:41AM +, Alexander Bulekov (@a1xndr) wrote: Alexander Bulekov created an issue: #1309 Hello, I bisected this to 7f863302 ("virtio-net: support queue_enable"). CC: @mstredhat @jasowang (could not find Kangjie Xu or Xuan Zhuo gitlab

Re: [PATCH] Use a more portable way to enable target specific functions

2022-11-09 Thread Richard Henderson
On 11/10/22 09:03, Tom Stellard wrote: This adds function attributes for avx2, sse2, etc. specialized functions. These attributes are supported by both clang and gcc and are necessary in order to build the code with clang. The existing gcc specific pragmas were left in place due to a comment in

Re: [PATCH v2] qom.json: default the prealloc-threads to smp-cpus

2022-11-09 Thread Zhenyu Zhang
Many thanks for your patient review, I learned a lot. I will send v3 to correct it. On Wed, Nov 9, 2022 at 5:52 PM Markus Armbruster wrote: > > The subject is misleading, I'm afraid. It suggests you're changing the > default. You don't, you just fix its documentation. > > Zhenyu Zhang writes:

Re: [PULL v4 44/83] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors

2022-11-09 Thread Ani Sinha
On Wed, Nov 9, 2022 at 11:09 PM Laurent Vivier wrote: > > This one breaks something for me: > > [3/65] Compiling C object > libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o > FAILED: libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o > clang -m64 -mcx16 -Ilibhw-display-virtio-vga-gl.a

Re: [PATCH v11 0/5] RISC-V Smstateen support

2022-11-09 Thread Alistair Francis
On Sun, Oct 16, 2022 at 10:48 PM Mayuresh Chitale wrote: > > This series adds support for the Smstateen specification which provides a > mechanism to plug the potential covert channels which are opened by extensions > that add to processor state that may not get context-switched. Currently > acce

Re: [PATCH v1 4/4] target/riscv: Add itrigger_enabled field to CPURISCVState

2022-11-09 Thread LIU Zhiwei
On 2022/11/10 6:55, Alistair Francis wrote: On Thu, Oct 13, 2022 at 4:51 PM LIU Zhiwei wrote: Avoid calling riscv_itrigger_enabled() when calculate the tbflags. As the itrigger enable status can only be changed when write tdata1, migration load or itrigger fire, update env->itrigger_enabled a

Re: [PATCH] virtio: remove the excess virtio features check

2022-11-09 Thread Xuan Zhuo
On Wed, 9 Nov 2022 09:46:18 -0500, "Michael S. Tsirkin" wrote: > On Wed, Nov 09, 2022 at 07:10:21PM +0800, Xuan Zhuo wrote: > > In virtio_queue_enable(), we checked virtio feature VIRTIO_F_VERSION_1. > > > > This check is not necessary, and conflict with SeaBIOS. The problem > > appeared in SeaBIO

Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations

2022-11-09 Thread Alberto Faria
On Wed, Nov 9, 2022 at 12:24 PM Emanuele Giuseppe Esposito wrote: > CCing also Alberto and Paolo > > So basically I think what we need is something that scans the whole > block layer code and puts the right coroutine_fn annotations (or > assertions, if you want) in the right places. > > The rule s

Re: [PATCH] hw/misc/pfsoc: add fabric clocks to ioscb

2022-11-09 Thread Conor Dooley
On Thu, Nov 10, 2022 at 12:18:44AM +0100, Philippe Mathieu-Daudé wrote: > On 9/11/22 20:08, Conor Dooley wrote: > > From: Conor Dooley > > > > On PolarFire SoC, some peripherals (eg the PCI root port) are clocked by > > "Clock Conditioning Circuitry" in the FPGA. The specific clock depends > > on

Re: [PATCH] avocado: use sha1 for fc31 imgs to avoid first time re-download

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 16:39, Daniel Henrique Barboza wrote: On 10/27/22 06:01, Daniel P. Berrangé wrote: On Thu, Oct 27, 2022 at 09:46:29AM +0200, Thomas Huth wrote: On 24/10/2022 11.02, Daniel P. Berrangé wrote: On Sat, Oct 22, 2022 at 02:03:50PM -0300, Daniel Henrique Barboza wrote: 'make check-avocado

Re: [PATCH v11 4/5] target/riscv: smstateen check for fcsr

2022-11-09 Thread Alistair Francis
On Sun, Oct 16, 2022 at 11:09 PM Mayuresh Chitale wrote: > > If smstateen is implemented and sstateen0.fcsr is clear then the floating > point > operations must return illegal instruction exception or virtual instruction > trap, if relevant. > > Signed-off-by: Mayuresh Chitale > Reviewed-by: Wei

Re: [PATCH] hw/misc/pfsoc: add fabric clocks to ioscb

2022-11-09 Thread Philippe Mathieu-Daudé
Hi Conor, On 9/11/22 20:08, Conor Dooley wrote: From: Conor Dooley On PolarFire SoC, some peripherals (eg the PCI root port) are clocked by "Clock Conditioning Circuitry" in the FPGA. The specific clock depends on the FPGA bitstream & can be locked to one particular {D,P}LL - in the Icicle Kit

Re: [PATCH v11 3/5] target/riscv: generate virtual instruction exception

2022-11-09 Thread Alistair Francis
On Sun, Oct 16, 2022 at 10:58 PM Mayuresh Chitale wrote: > > This patch adds a mechanism to generate a virtual instruction > instruction exception instead of an illegal instruction exception > during instruction decode when virt is enabled. > > Signed-off-by: Mayuresh Chitale Reviewed-by: Alista

Re: [PATCH v11 1/5] target/riscv: Add smstateen support

2022-11-09 Thread Alistair Francis
On Sun, Oct 16, 2022 at 10:51 PM Mayuresh Chitale wrote: > > Smstateen extension specifies a mechanism to close > the potential covert channels that could cause security issues. > > This patch adds the CSRs defined in the specification and > the corresponding predicates and read/write functions. >

Re: [PATCH] display: include dependencies explicitly

2022-11-09 Thread Laurent Vivier
On 11/9/22 23:21, Michael S. Tsirkin wrote: acpi-vga-stub.c pulls in vga_int.h However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used. Signed-off-by: Michael S. Tsirkin

Re: [PATCH v1 4/4] target/riscv: Add itrigger_enabled field to CPURISCVState

2022-11-09 Thread Alistair Francis
On Thu, Oct 13, 2022 at 4:51 PM LIU Zhiwei wrote: > > Avoid calling riscv_itrigger_enabled() when calculate the tbflags. > As the itrigger enable status can only be changed when write > tdata1, migration load or itrigger fire, update env->itrigger_enabled > at these places. > > Signed-off-by: LIU

Re: [PATCH v1 3/4] target/riscv: Enable native debug itrigger

2022-11-09 Thread Alistair Francis
On Thu, Oct 13, 2022 at 4:38 PM LIU Zhiwei wrote: > > When QEMU is not in icount mode, execute instruction one by one. The > tdata1 can be read directly. > > When QEMU is in icount mode, use a timer to simulate the itrigger. The > tdata1 may be not right because of lazy update of count in tdata1.

[PATCH] Use a more portable way to enable target specific functions

2022-11-09 Thread Tom Stellard
This adds function attributes for avx2, sse2, etc. specialized functions. These attributes are supported by both clang and gcc and are necessary in order to build the code with clang. The existing gcc specific pragmas were left in place due to a comment in utils/bufferiszero.c which mentions the

Re: [PATCH v1 2/4] target/riscv: Add itrigger support when icount is enabled

2022-11-09 Thread Alistair Francis
On Thu, Oct 13, 2022 at 4:43 PM LIU Zhiwei wrote: > > The max count in itrigger can be 0x3FFF, which will cause a no trivial > translation and execution overload. > > When icount is enabled, QEMU provides API that can fetch guest > instruction number. Thus, we can set an timer for itrigger with >

Re: [PATCH for-8.0 7/9] hw/intc: Convert TYPE_ARM_GICV3_ITS_COMMON to 3-phase reset

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 17:14, Peter Maydell wrote: Convert the TYPE_ARM_GICV3_ITS_COMMON parent class to 3-phase reset. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_its_common.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH for-8.0 3/9] hw/intc: Convert TYPE_ARM_GIC_COMMON to 3-phase reset

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 17:14, Peter Maydell wrote: Convert the TYPE_ARM_GIC_COMMON device to 3-phase reset. This is a simple no-behaviour-change conversion. Signed-off-by: Peter Maydell --- hw/intc/arm_gic_common.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mat

Re: [PATCH for-8.0 1/9] hw/arm: Convert TYPE_ARM_SMMU to 3-phase reset

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 17:14, Peter Maydell wrote: Convert the TYPE_ARM_SMMU device to 3-phase reset. The legacy method doesn't do anything that's invalid in the hold phase, so the conversion is simple and not a behaviour change. Note that we must convert this base class before we can convert the TYPE_ARM_

Re: [PATCH for-8.0 1/2] hw/input/ps2: Convert TYPE_PS2_DEVICE to 3-phase reset

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 18:00, Peter Maydell wrote: Convert the parent class TYPE_PS2_DEVICE to 3-phase reset. Note that we need an 'exit' phase function as well as the usual 'hold' phase function, because changing outbound IRQ line state is only permitted in 'exit'. (Strictly speaking it's not supposed to

Re: [PATCH v1 1/4] target/riscv: Add itrigger support when icount is not enabled

2022-11-09 Thread Alistair Francis
On Mon, Nov 7, 2022 at 12:01 PM LIU Zhiwei wrote: > > > On 2022/11/7 9:37, Alistair Francis wrote: > > On Thu, Oct 13, 2022 at 4:32 PM LIU Zhiwei > > wrote: > >> When icount is not enabled, there is no API in QEMU that can get the > >> guest instruction number. > >> > >> Translate the guest code

Re: [PATCH-for-7.2] hw/display: Declare build_vga_aml() out of "vga_int.h"

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 23:23, Philippe Mathieu-Daudé wrote: Commit cfead31326 declared build_vga_aml() in "vga_int.h". This header happens to include various other things, such (indirectly) pixman headers. The freshly introduced acpi-vga.c includes "vga_int.h" to get build_vga_aml() declaration, but ends in

Re: [PATCH] display: include dependencies explicitly

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 23:21, Michael S. Tsirkin wrote: acpi-vga-stub.c pulls in vga_int.h However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used. Reported-by: Miroslav Rezanina Re

[PATCH-for-7.2] hw/display: Declare build_vga_aml() out of "vga_int.h"

2022-11-09 Thread Philippe Mathieu-Daudé
Commit cfead31326 declared build_vga_aml() in "vga_int.h". This header happens to include various other things, such (indirectly) pixman headers. The freshly introduced acpi-vga.c includes "vga_int.h" to get build_vga_aml() declaration, but ends including the 'various other things' triggering this

[PATCH] display: include dependencies explicitly

2022-11-09 Thread Michael S. Tsirkin
acpi-vga-stub.c pulls in vga_int.h However that currently pulls in ui/console.h which breaks e.g. on systems without pixman. It's better to remove ui/console.h from vga_int.h and directly include it where it's used. Signed-off-by: Michael S. Tsirkin --- hw/display/vga_int.h| 1 - include

Re: [PATCH 03/13] block: Revert .bdrv_drained_begin/end to non-coroutine_fn

2022-11-09 Thread Stefan Hajnoczi
On Tue, Nov 08, 2022 at 01:37:28PM +0100, Kevin Wolf wrote: > Polling during bdrv_drained_end() can be problematic (and in the future, > we may get cases for bdrv_drained_begin() where polling is forbidden, > and we don't care about already in-flight requests, but just want to > prevent new request

Re: [PATCH] qga: Allow building of the guest agent without system emulators or tools

2022-11-09 Thread Philippe Mathieu-Daudé
On 9/11/22 18:37, Thomas Huth wrote: If configuring with "--disable-system --disable-user --enable-guest-agent" the linking currently fails with: qga/qemu-ga.p/commands.c.o: In function `qmp_command_info': build/../../home/thuth/devel/qemu/qga/commands.c:70: undefined reference to `qmp_command_

Re: [PATCH 01/13] qed: Don't yield in bdrv_qed_co_drain_begin()

2022-11-09 Thread Stefan Hajnoczi
On Tue, Nov 08, 2022 at 01:37:26PM +0100, Kevin Wolf wrote: > @@ -310,9 +309,20 @@ static void coroutine_fn qed_need_check_timer_entry(void > *opaque) > (void) ret; > } > > +static void coroutine_fn qed_need_check_timer_entry(void *opaque) > +{ > +BDRVQEDState *s = opaque; > + > +q

Re: [PULL v4 44/83] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors

2022-11-09 Thread Michael S. Tsirkin
On Wed, Nov 09, 2022 at 06:39:27PM +0100, Laurent Vivier wrote: > This one breaks something for me: > > [3/65] Compiling C object > libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o > FAILED: libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o > clang -m64 -mcx16 -Ilibhw-display-virtio-

[PATCH] hw/misc/pfsoc: add fabric clocks to ioscb

2022-11-09 Thread Conor Dooley
From: Conor Dooley On PolarFire SoC, some peripherals (eg the PCI root port) are clocked by "Clock Conditioning Circuitry" in the FPGA. The specific clock depends on the FPGA bitstream & can be locked to one particular {D,P}LL - in the Icicle Kit Reference Design v2022.09 or later this is/will be

Re: [PULL for-7.2 0/2] tcg patch queue

2022-11-09 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

QEMU Rust Crates + Plugins in Rust

2022-11-09 Thread Rowan Hart
Hi all, this is my first post to the mailing list! I've spent the last couple weeks building QEMU Rust crates to enable a couple goals: - Install QEMU binaries using cargo, the Rust package manager - Use git-latest QEMU binaries in Rust projects as a dependency - Write QEMU TCG plugins entirely in

Re: Weird qtest FileNotFoundError errors

2022-11-09 Thread Patrick Venture
On Wed, Nov 9, 2022 at 11:20 AM Patrick Venture wrote: > Hi all, > > I've been trying to debug qtest problems recently. I have seen the assert > socket failures a bunch now and am digging into why. I've also seen this a > lot and I'm curious if anyone has any ideas: > > ./configure --target-lis

Weird qtest FileNotFoundError errors

2022-11-09 Thread Patrick Venture
Hi all, I've been trying to debug qtest problems recently. I have seen the assert socket failures a bunch now and am digging into why. I've also seen this a lot and I'm curious if anyone has any ideas: ./configure --target-list=aarch64-softmmu,aarch64-linux-user make -i check-report-qtest-aarch

Re: [PATCH 11/13] block: Remove ignore_bds_parents parameter from drain functions

2022-11-09 Thread Vladimir Sementsov-Ogievskiy
On 11/8/22 15:37, Kevin Wolf wrote: ignore_bds_parents is now ignored, so we can just remove it.> Signed-off-by: Kevin Wolf Not obvious to me that they are ignored, some logic is still here. Maybe it's all do nothing finally. Still I believe that we should get rid of ignore_bds_parents anyway

Re: [PATCH 10/13] block: Call drain callbacks only once

2022-11-09 Thread Vladimir Sementsov-Ogievskiy
On 11/8/22 15:37, Kevin Wolf wrote: One thing that gets in the way is the 'ignore_bds_parents' parameter in bdrv_do_drained_begin_quiesce() and bdrv_do_drained_end(): If it is true for the first drain, bs->quiesce_counter will be non-zero, but the parent callbacks still haven't been called, so a

Re: [PATCH 10/13] block: Call drain callbacks only once

2022-11-09 Thread Vladimir Sementsov-Ogievskiy
On 11/8/22 15:37, Kevin Wolf wrote: We only need to call both the BlockDriver's callback and the parent callbacks when going from undrained to drained or vice versa. A second drain section doesn't make a difference for the driver or the parent, they weren't supposed to send new requests before an

Re: [PATCH v3 2/4] python/qmp: increase read buffer size

2022-11-09 Thread John Snow
On Wed, Nov 9, 2022, 6:00 AM Daniel P. Berrangé wrote: > On Wed, Nov 09, 2022 at 09:39:14AM +, Daniel P. Berrangé wrote: > > On Tue, Nov 08, 2022 at 03:38:21PM -0500, John Snow wrote: > > > On Thu, Nov 3, 2022 at 6:29 AM Maksim Davydov > > > wrote: > > > > > > > > After modification of "quer

Re: [PATCH] qga: Allow building of the guest agent without system emulators or tools

2022-11-09 Thread Konstantin Kostiuk
Reviewed-by: Konstantin Kostiuk On Wed, Nov 9, 2022 at 7:37 PM Thomas Huth wrote: > If configuring with "--disable-system --disable-user --enable-guest-agent" > the linking currently fails with: > > qga/qemu-ga.p/commands.c.o: In function `qmp_command_info': > build/../../home/thuth/devel/qemu/

Re: [PULL v4 44/83] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors

2022-11-09 Thread Laurent Vivier
This one breaks something for me: [3/65] Compiling C object libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o FAILED: libhw-display-virtio-vga-gl.a.p/hw_display_acpi-vga.c.o clang -m64 -mcx16 -Ilibhw-display-virtio-vga-gl.a.p -I. -I../../../Projects/qemu-upstream -Iqapi -Itrace -Iui -Iui/

[PATCH] qga: Allow building of the guest agent without system emulators or tools

2022-11-09 Thread Thomas Huth
If configuring with "--disable-system --disable-user --enable-guest-agent" the linking currently fails with: qga/qemu-ga.p/commands.c.o: In function `qmp_command_info': build/../../home/thuth/devel/qemu/qga/commands.c:70: undefined reference to `qmp_command_name' build/../../home/thuth/devel/qemu

Re: Questions about QEMU exception

2022-11-09 Thread Li, Kevin
Hi Peter, We first install via homebrew and then extract the executables (qemu-img and qemu-system-xxx) out. We recently did this, so it should be the latest version of qemu via homebrew, and our package is for MacOS, which needs sign and notarize. If we extract in this way, and use it on other

Re: [PATCH 09/13] block: Remove subtree drains

2022-11-09 Thread Vladimir Sementsov-Ogievskiy
On 11/8/22 15:37, Kevin Wolf wrote: Subtree drains are not used any more. Remove them. After this, BdrvChildClass.attach/detach() don't poll any more. Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

[ANNOUNCE] QEMU 7.2.0-rc0 is now available

2022-11-09 Thread Michael Roth
Hello, On behalf of the QEMU Team, I'd like to announce the availability of the first release candidate for the QEMU 7.2 release. This release is meant for testing purposes and should not be used in a production environment. http://download.qemu-project.org/qemu-7.2.0-rc0.tar.xz http://downlo

[PATCH for-8.0 0/2] hw/input/ps2: Convert to 3-phase reset

2022-11-09 Thread Peter Maydell
This patchset converts the ps2 keyboard and mouse devices to 3-phase reset. The rationale here is that it would be nice to get rid of the device_class_set_parent_reset() function, which is used by legacy-reset subclasses which want to chain to their parent's reset function. There aren't very many o

[PATCH for-8.0 1/2] hw/input/ps2: Convert TYPE_PS2_DEVICE to 3-phase reset

2022-11-09 Thread Peter Maydell
Convert the parent class TYPE_PS2_DEVICE to 3-phase reset. Note that we need an 'exit' phase function as well as the usual 'hold' phase function, because changing outbound IRQ line state is only permitted in 'exit'. (Strictly speaking it's not supposed to be done in a legacy reset handler either,

[PATCH for-8.0 2/2] hw/input/ps2.c: Convert TYPE_PS2_{KBD, MOUSE}_DEVICE to 3-phase reset

2022-11-09 Thread Peter Maydell
Convert the child classes TYPE_PS2_KBD_DEVICE and TYPE_PS2_MOUSE_DEVICE to the 3-phase reset system. This allows us to stop using the old device_class_set_parent_reset() function. We don't need to register an 'exit' phase function for the subclasses, because they have no work to do in that phase.

Re: [PATCH v1 1/1] migration: Fix yank on postcopy multifd crashing guest after migration

2022-11-09 Thread Leonardo Bras Soares Passos
On Wed, Nov 9, 2022 at 10:31 AM Dr. David Alan Gilbert wrote: > > * Leonardo Bras (leob...@redhat.com) wrote: > > When multifd and postcopy-ram capabilities are enabled, if a > > migrate-start-postcopy is attempted, the migration will finish sending the > > memory pages and then crash with the fol

[PATCH for-7.2 4/5] iotests/151: Test that active mirror progresses

2022-11-09 Thread Hanna Reitz
Before this series, a mirror job in write-blocking mode would pause issuing background requests while active requests are in flight. Thus, if the source is constantly in use by active requests, no actual progress can be made. This series should have fixed that, making the mirror job issue backgro

[PATCH for-7.2 5/5] iotests/151: Test active requests on mirror start

2022-11-09 Thread Hanna Reitz
Have write requests happen to the source node right when we start a mirror job. The mirror filter node may encounter MirrorBDSOpaque.job being NULL, but this should not cause a segfault. Signed-off-by: Hanna Reitz --- tests/qemu-iotests/151 | 53 +++--- tests

  1   2   >