[PATCH v9 0/5] add generic vDPA device support

2022-11-12 Thread Longpeng(Mike)
number of virtqueues [Stefan] Patch 6: - init s->num_queues [Stefano] - free s->dev.vqs [Stefano] Longpeng (Mike) (5): virtio: get class_id and pci device id by the virtio id vdpa: add vdpa-dev support vdpa: add vdpa-dev-pci support vdpa-dev: mark the device as unmigr

[PATCH v9 4/5] vdpa-dev: mark the device as unmigratable

2022-11-12 Thread Longpeng(Mike)
From: Longpeng The generic vDPA device doesn't support migration currently, so mark it as unmigratable temporarily. Reviewed-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vdpa-dev.c b

[PATCH v1 1/3] virtio-pci: submit msi route changes in batch

2023-02-28 Thread Longpeng(Mike)
From: Longpeng The kvm_irqchip_commit_routes() is a time-intensive operation, it needs scan and update all irqfds that are already assigned during each invocation, so more vectors means need more time to process them. For virtio-pci, we can just submit once when enabling vectors of a virtio-pci d

[PATCH v1 0/3] virtio-pci: optimize set_guest_notifier

2023-02-28 Thread Longpeng(Mike)
From: Longpeng This patchset optimizes the time-consuming operation in virtio_pci_set_guest_notifier, especially for the vhost-vdpa migration, the time spend on set_guest_notifier can reduce 87% in some cases. Longpeng (Mike) (3): virtio-pci: submit msi route changes in batch kvm-irqchip

[PATCH v1 2/3] kvm-irqchip: use KVMRouteChange API to update msi route

2023-02-28 Thread Longpeng(Mike)
From: Longpeng The KVMRouteChange API is added by commit 9568690868e ("kvm-irqchip: introduce new API to support route change"). We can also apply it on kvm_irqchip_update_msi_route(), there are no functional changes and we can optimize the virtio-pci core base on this change in the next patch.

[PATCH v1 3/3] virtio-pci: defer to commit kvm irq routing when enable msi/msix

2023-02-28 Thread Longpeng(Mike)
From: Longpeng All unmasked vectors will be setup in msix_set_vector_notifiers(), which is a time-consuming operation because each vector need to be submit to KVM once. It's even worse if the VM has several devices and each devices has dozens of vectors. We can defer and commit the vectors in ba

[PATCH] memory: avoid unnecessary iteration when updating ioeventfds

2023-02-28 Thread Longpeng(Mike)
From: Longpeng When updating ioeventfds, we need to iterate all address spaces and iterate all flat ranges of each address space. There is so much redundant process that a FlatView would be iterated for so many times during one commit (memory_region_transaction_commit). We can mark a FlatView as

[PATCH v11 2/5] vdpa: add vdpa-dev support

2022-12-15 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev, we can use the deivce directly: -M microvm -m 512m -smp 2 -kernel ... -initrd ... -device \ vhost-vdpa-device,vhostdev=/dev/vhost-vdpa-x Reviewed-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: Longpeng --- hw/virtio/Kconfig| 5 + h

[PATCH v11 0/5] add generic vDPA device support

2022-12-15 Thread Longpeng(Mike)
to make the code clearer [Stefan] - fix the misleading description of 'dc->desc' [Stefano] Patch 5: - check returned number of virtqueues [Stefan] Patch 6: - init s->num_queues [Stefano] - free s->dev.vqs [Stefano] Longpeng (Mike) (5): virtio: get class_id an

[PATCH v11 5/5] docs: Add generic vhost-vdpa device documentation

2022-12-15 Thread Longpeng(Mike)
From: Longpeng Signed-off-by: Longpeng --- .../devices/vhost-vdpa-generic-device.rst | 68 +++ 1 file changed, 68 insertions(+) create mode 100644 docs/system/devices/vhost-vdpa-generic-device.rst diff --git a/docs/system/devices/vhost-vdpa-generic-device.rst b/docs/syste

[PATCH v11 4/5] vdpa-dev: mark the device as unmigratable

2022-12-15 Thread Longpeng(Mike)
From: Longpeng The generic vDPA device doesn't support migration currently, so mark it as unmigratable temporarily. Reviewed-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vdpa-dev.c b

[PATCH v11 1/5] virtio: get class_id and pci device id by the virtio id

2022-12-15 Thread Longpeng(Mike)
From: Longpeng Add helpers to get the "Transitional PCI Device ID" and "class_id" of the device specified by the "Virtio Device ID". These helpers will be used to build the generic vDPA device later. Acked-by: Jason Wang Signed-off-by: Longpeng --- hw/virtio/virtio-pci.c | 88 +++

[PATCH v11 3/5] vdpa: add vdpa-dev-pci support

2022-12-15 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev-pci, we can use the device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Reviewed-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: Longpeng --- hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev-pci.c | 102 +

[PATCH 0/2] Fix the init path of generic vhost-vdpa device

2022-12-24 Thread Longpeng(Mike)
f vdpa/net. Longpeng (Mike) (2): vdpa-dev: get iova range explicitly vdpa: harden the error path if get_iova_range failed hw/virtio/vdpa-dev.c | 9 + hw/virtio/vhost-vdpa.c | 7 +++ include/hw/virtio/vhost-vdpa.h | 2 ++ net/vhost-vdpa.c

[PATCH 2/2] vdpa: harden the error path if get_iova_range failed

2022-12-24 Thread Longpeng(Mike)
From: Longpeng We should stop if the GET_IOVA_RANGE ioctl failed. Signed-off-by: Longpeng --- net/vhost-vdpa.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index ffdc435d19..e65023d013 100644 --- a/net/vhost-vdpa.c +++ b/net/vho

[PATCH 1/2] vdpa-dev: get iova range explicitly

2022-12-24 Thread Longpeng(Mike)
From: Longpeng In commit a585fad26b ("vdpa: request iova_range only once") we remove GET_IOVA_RANGE form vhost_vdpa_init, the generic vdpa device will start without iova_range populated, so the device won't work. Let's call GET_IOVA_RANGE ioctl explicitly. Fixes: a585fad26b2e6ccc ("vdpa: request

[PATCH v3 1/3] vhost: simplify vhost_dev_enable_notifiers

2022-12-26 Thread Longpeng(Mike)
From: Longpeng Simplify the error path in vhost_dev_enable_notifiers by using vhost_dev_disable_notifiers directly. Signed-off-by: Longpeng --- hw/virtio/vhost.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c inde

[PATCH v3 0/3] two optimizations to speed up the start time

2022-12-26 Thread Longpeng(Mike)
From: Longpeng Changes v3->v2: - cleanup the code [Philippe] Changes v2->v1: Patch-1: - remove vq_init_count [Jason] Patch-2: - new added. [Jason] v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg922499.html Longpeng (Mike) (3): vhost: simplify vhost_dev_enable_not

[PATCH v3 2/3] vhost: configure all host notifiers in a single MR transaction

2022-12-26 Thread Longpeng(Mike)
From: Longpeng This allows the vhost device to batch the setup of all its host notifiers. This significantly reduces the device starting time, e.g. the time spend on enabling notifiers reduce from 376ms to 9.1ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_sim_blk, 64vq per devic

[PATCH v3 3/3] vdpa: commit all host notifier MRs in a single MR transaction

2022-12-26 Thread Longpeng(Mike)
From: Longpeng This allows the vhost-vdpa device to batch the setup of all its MRs of host notifiers. This significantly reduces the device starting time, e.g. the time spend on setup the host notifier MRs reduce from 423ms to 32ms for a VM with 64 vCPUs and 3 vhost-vDPA generic devices (vdpa_si

Re: [PATCH 09/13] ppc/xive2: Support "Pull Thread Context to Odd Thread Reporting Line"

2024-08-29 Thread Mike Kowal
On 8/29/2024 7:08 AM, Cédric Le Goater wrote: On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Adds support for single byte writes to offset 0xC38 of the TIMA address space.  When this offset is written to, the hardware disables the thread context and copies the current state informat

Re: [PATCH 10/13] pnv/xive: Add special handling for pool targets

2024-08-29 Thread Mike Kowal
On 8/29/2024 7:14 AM, Cédric Le Goater wrote: On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Hypervisor "pool" targets do not get their own interrupt line and instead must share an interrupt line with the hypervisor "physical" targets. This also means that the pool ring must use so

Re: [PATCH 11/13] pnv/xive: Update PIPR when updating CPPR

2024-08-29 Thread Mike Kowal
On 8/29/2024 7:29 AM, Cédric Le Goater wrote: On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Current code was updating the PIPR inside the xive_tctx_accept() function instead of the xive_tctx_set_cppr function, which is where the HW would have it updated. Did you confirm with th

Re: [PATCH 11/13] pnv/xive: Update PIPR when updating CPPR

2024-08-30 Thread Mike Kowal
On 8/30/2024 3:25 AM, Cédric Le Goater wrote: On 8/29/24 22:35, Mike Kowal wrote: On 8/29/2024 7:29 AM, Cédric Le Goater wrote: On 8/1/24 22:30, Michael Kowal wrote: From: Glenn Miles Current code was updating the PIPR inside the xive_tctx_accept() function instead of the

Re: [PATCH v2 09/14] ppc/xive2: Change context/ring specific functions to be generic

2024-09-12 Thread Mike Kowal
On 9/12/2024 1:27 AM, Cédric Le Goater wrote: On 9/9/24 23:10, Michael Kowal wrote: Some the functions that have been created are specific to a ring or context. Some of these same functions are being changed to operate on any ring/context. This  will simplify the next patch sets that are addi

Re: [PATCH v3 09/14] ppc/xive2: Change context/ring specific functions to be generic

2024-09-13 Thread Mike Kowal
On 9/13/2024 8:10 AM, Cédric Le Goater wrote: On 9/12/24 22:50, Michael Kowal wrote: Some the functions that have been created are specific to a ring or context. Some of these same functions are being changed to operate on any ring/context. This  will simplify the next patch sets that are add

[PATCH v3 04/10] vdpa-dev: implement the instance_init/class_init interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .instance_init and the .class_init interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev-pci.c | 22 +++- hw/virtio/vdpa-dev.c | 69 ++-- include/hw/virtio/vdpa-dev.h | 3 ++ 3 files changed, 91 insertions(+

[PATCH v3 07/10] vdpa-dev: implement the get_config/set_config interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .get_config and .set_config interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index 1713818bc3..f28d3ed5f9 100644 --- a/hw/vir

[PATCH v3 01/10] virtio: get class_id and pci device id by the virtio id

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Add helpers to get the "Transitional PCI Device ID" and "class_id" of the device specified by the "Virtio Device ID". These helpers will be used to build the generic vDPA device later. Signed-off-by: Longpeng --- hw/virtio/virtio-pci.c | 77 +

[PATCH v3 03/10] vdpa: add the infrastructure of vdpa-dev

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Add the infrastructure of vdpa-dev (the generic vDPA device), we can add a generic vDPA device as follow: -device vhost-vdpa-device-pci,vdpa-dev=/dev/vhost-vdpa-X Signed-off-by: Longpeng --- hw/virtio/Kconfig| 5 +++ hw/virtio/meson.build| 2 ++ hw/virtio

[PATCH v3 02/10] update linux headers

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Update linux headers to 5.xxx (kernel part is not merged yet) To support generic vdpa deivce, we need add the following ioctls: - VHOST_VDPA_GET_CONFIG_SIZE: get the configuration size. - VHOST_VDPA_GET_VQS_COUNT: get the count of supported virtqueues. Signed-off-by: Longpeng --

[PATCH v3 10/10] vdpa-dev: mark the device as unmigratable

2022-03-19 Thread Longpeng(Mike)
From: Longpeng The generic vDPA device doesn't support migration currently, so mark it as unmigratable temporarily. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index c6847df7aa..5224617574 1006

[PATCH v3 08/10] vdpa-dev: implement the get_features interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .get_features interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index f28d3ed5f9..9536982061 100644 --- a/hw/virtio/vdpa-dev.c +++ b/h

[PATCH v3 09/10] vdpa-dev: implement the set_status interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .set_status interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 100 ++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index 9536982061..c6847df7aa 100644

[PATCH v3 00/10] add generic vDPA device support

2022-03-19 Thread Longpeng(Mike)
de clearer [Stefan] - fix the misleading description of 'dc->desc' [Stefano] Patch 5: - check returned number of virtqueues [Stefan] Patch 6: - init s->num_queues [Stefano] - free s->dev.vqs [Stefano] Longpeng (Mike) (10): virtio: get class_id and pci d

[PATCH v3 05/10] vdpa-dev: implement the realize interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .realize interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev-pci.c | 18 - hw/virtio/vdpa-dev.c | 132 +++ include/hw/virtio/vdpa-dev.h | 10 +++ 3 files changed, 159 insertions(+), 1 deletion(-) diff --git

[PATCH v3 06/10] vdpa-dev: implement the unrealize interface

2022-03-19 Thread Longpeng(Mike)
From: Longpeng Implements the .unrealize interface. Signed-off-by: Longpeng --- hw/virtio/vdpa-dev.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c index 4defe6c33d..1713818bc3 100644 --- a/hw/virtio/vdpa-dev.c

[PATCH v6 5/5] vfio: defer to commit kvm irq routing when enable msi/msix

2022-03-25 Thread Longpeng(Mike)
s that already assigned and need to process in this round. The optimization can be applied to msi type too. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 130 +- hw/vfio/pci.h | 2 + 2 files changed, 99 insertions(+), 33 deletions(-) diff --git a/h

[PATCH v6 2/5] vfio: move re-enabling INTX out of the common helper

2022-03-25 Thread Longpeng(Mike)
Move re-enabling INTX out, and the callers should decide to re-enable it or not. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 1433989aeb..a1916e2e36 100644 --- a/hw/vfio

[PATCH v6 0/5] optimize the downtime for vfio migration

2022-03-25 Thread Longpeng(Mike)
nd grammatical errors [Alex, Philippe] - split fixups and cleanups into separate patches [Alex, Philippe] - introduce kvm_irqchip_add_deferred_msi_route to minimize code changes[Alex] - enable the optimization in msi setup path[Alex] Longpeng (Mike) (5): vfio: simplify the conditional s

[PATCH v6 1/5] vfio: simplify the conditional statements in vfio_msi_enable

2022-03-25 Thread Longpeng(Mike)
It's unnecessary to test against the specific return value of VFIO_DEVICE_SET_IRQS, since any positive return is an error indicating the number of vectors we should retry with. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v6 3/5] vfio: simplify the failure path in vfio_msi_enable

2022-03-25 Thread Longpeng(Mike)
Use vfio_msi_disable_common to simplify the error handling in vfio_msi_enable. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index a1916e2e36..6f49e71cd4 100644 --- a/hw/vfio

[PATCH v6 4/5] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration"

2022-03-25 Thread Longpeng(Mike)
ned-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 6f49e71cd4..6801391cf6 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -572,9 +572,6 @@ static void vfio_msix_vector_release

[PATCH v4 5/6] Revert "vfio: Avoid disabling and enabling vectors repeatedly in VFIO migration"

2021-10-13 Thread Longpeng(Mike)
ned-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index aeeb6cd..0bd832b 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -569,9 +569,6 @@ static void vfio_msix_vector_release(PCIDe

[PATCH v4 2/6] vfio: move re-enabling INTX out of the common helper

2021-10-13 Thread Longpeng(Mike)
Move re-enabling INTX out, and the callers should decide to re-enable it or not. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index c1fba40..a4985c0 100644 --- a/hw/vfio/pci.c

[PATCH v4 1/6] vfio: simplify the conditional statements in vfio_msi_enable

2021-10-13 Thread Longpeng(Mike)
It's unnecessary to test against the specific return value of VFIO_DEVICE_SET_IRQS, since any positive return is an error indicating the number of vectors we should retry with. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v4 4/6] kvm: irqchip: extract kvm_irqchip_add_deferred_msi_route

2021-10-13 Thread Longpeng(Mike)
Extract a common helper that add MSI route for specific vector but does not commit immediately. Signed-off-by: Longpeng(Mike) --- accel/kvm/kvm-all.c | 15 +-- include/sysemu/kvm.h | 6 ++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b

[PATCH v4 6/6] vfio: defer to commit kvm irq routing when enable msi/msix

2021-10-13 Thread Longpeng(Mike)
s that already assigned and need to process in this round. The optimization can be applied to msi type too. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 129 ++ hw/vfio/pci.h | 1 + 2 files changed, 105 insertions(+), 25 deletions(-) diff -

[PATCH v4 0/6] optimize the downtime for vfio migration

2021-10-13 Thread Longpeng(Mike)
ate patches [Alex, Philippe] - introduce kvm_irqchip_add_deferred_msi_route to minimize code changes[Alex] - enable the optimization in msi setup path[Alex] Longpeng (Mike) (6): vfio: simplify the conditional statements in vfio_msi_enable vfio: move re-enabling INTX out of the common h

[PATCH v4 3/6] vfio: simplify the failure path in vfio_msi_enable

2021-10-13 Thread Longpeng(Mike)
Use vfio_msi_disable_common to simplify the error handling in vfio_msi_enable. Signed-off-by: Longpeng(Mike) --- hw/vfio/pci.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index a4985c0..aeeb6cd 100644 --- a/hw/vfio/pci.c

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

2021-12-07 Thread Longpeng(Mike)
? Such as: * Lightweight Net: vhost-vdpa-net Storage: vhost-vdpa-blk * Heavy but more powerful Net: netdev + virtio-net + vhost-vdpa Storage: bdrv + virtio-blk + vhost-vdpa [1] https://www.mail-archive.com/qemu-devel@nongnu.org/msg797569.html Signed-off-by: Longpeng(Mike) --- hw/net/m

[PATCH 0/2] kvm/msi: do explicit commit when adding msi routes

2021-12-11 Thread Longpeng(Mike)
From: Longpeng This patchset moves the call to kvm_irqchip_commit_routes() out of kvm_irqchip_add_msi_route(). An optimization of vfio migration [1] depends on this changes. [1] https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg00968.html Longpeng (Mike) (2): kvm-irqchip: introduce

[PATCH 1/2] kvm-irqchip: introduce new API to support route change

2021-12-11 Thread Longpeng(Mike)
From: Longpeng As suggested by Paolo [1], add the new API to support route changes. We should invoke kvm_irqchip_begin_route_changes() before changing the routes, increase the KVMRouteChange.changes if the routes are changed, and commit the changes at last. [1] https://lists.gnu.org/archive/html

[PATCH 2/2] kvm/msi: do explicit commit when adding msi routes

2021-12-11 Thread Longpeng(Mike)
From: Longpeng We invoke commit operation for each addition to msi route table, this is not efficient if we are adding lots of routes in some cases (e.g. the resume phase of vfio migration [1]). This patch moves the call to kvm_irqchip_commit_routes() to the callers, so the callers can decide ho

[PATCH 1/1] qemu-img: do not erase destination file in qemu-img dd command

2023-09-30 Thread Mike Maslenkin
image are preserved. As another visible change of `qemu-img dd` behavior is that if destination image is less than source it can finish with error (similar to "dd" utility): qemu-img: error while writing to output image file: Input/output error Signed-off-by: Mike Maslenkin

[PATCH v2 1/1] qemu-img: do not erase destination file in qemu-img dd command

2023-09-30 Thread Mike Maslenkin
image are preserved. As another visible change of `qemu-img dd` behavior is that if destination image is less than source it can finish with error (similar to "dd" utility): qemu-img: error while writing to output image file: Input/output error Signed-off-by: Mike Maslenkin --- d

Re: [PATCH v2 1/1] qemu-img: do not erase destination file in qemu-img dd command

2023-10-01 Thread Mike Maslenkin
be improved to smth like if (strcmp(fmt, "raw") || !g_file_test(out.filename, G_FILE_TEST_EXISTS)) . And parameter "conv=notrunc" may be implemented additionally for this case. Three of above do not require "conv=" parameter from my point of view. I would be glad t

Re: [PATCH 03/21] parallels: invent parallels_opts_prealloc() helper to parse prealloc opts

2023-09-17 Thread Mike Maslenkin
quot;bytes" variable as int64_t and then shift it to the right? I see here it can not be negative, but it's a common to use signed values and not to add explicit check before shifting to right In this file I takes time to ensure that initial values are not negative. Regards, Mike. &

Re: [PATCH 18/21] parallels: naive implementation of parallels_co_pdiscard

2023-09-17 Thread Mike Maslenkin
aph-lock.h:85:26: note: expanded from macro 'GRAPH_RDLOCK_PTR' #define GRAPH_RDLOCK_PTR TSA_GUARDED_BY(graph_lock) ^ /Users/mg/sources/qemu/include/qemu/clang-tsa.h:48:31: note: expanded from macro 'TSA_GUARDED_BY' #define TSA_GUARDED_BY(x) TSA(guarded_b

Re: [PATCH 06/21] parallels: refactor path when we need to re-check image in parallels_open

2023-09-17 Thread Mike Maslenkin
ata_start; ^~ ../block/parallels.c:1139:18: note: remove the '||' if its condition is always false need_check = need_check || ^ ../block/parallels.c:1067:24: note: initialize the variable 'data_start' to silence this warning uint32_t data_start; ^ = 0 1 warning generated. Regards, Mike.

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-06 Thread Mike Maslenkin
ocMode prealloc_mode; > > -- > 2.34.1 > Is it intended behavior? Run: 1. ./qemu-img create -f parallels $TEST_IMG 1T 2. dd if=/dev/zero of=$TEST_IMG oseek=12 bs=1M count=128 conv=notrunc 3. ./qemu-img check $TEST_IMG No errors were found on the image. Image end offset: 150994944 Without this patch `qemu-img check` reports: ERROR space leaked at the end of the image 145752064 139 leaked clusters were found on the image. This means waste of disk space, but no harm to data. Image end offset: 5242880 Note: there is another issue caused by previous commits exists. g_free asserts from parallels_free_used_bitmap() because of s->used_bmap is NULL. To reproduce this crash at revision before or without patch 15/19, run commands: 1. ./qemu-img create -f parallels $TEST_IMG 1T 2. dd if=/dev/zero of=$TEST_IMG oseek=12 bs=1M count=128 conv=notrunc 3. ./qemu-img check -r leaks $TEST_IMG Regards, Mike.

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-07 Thread Mike Maslenkin
On Sat, Oct 7, 2023 at 1:18 PM Alexander Ivanov wrote: > > > > On 10/6/23 21:43, Mike Maslenkin wrote: > > On Mon, Oct 2, 2023 at 12:01 PM Alexander Ivanov > > wrote: > >> Since we have used bitmap, field data_end in BDRVParallelsState is > >> r

Re: [PATCH 15/19] parallels: Remove unnecessary data_end field

2023-10-07 Thread Mike Maslenkin
On Sat, Oct 7, 2023 at 5:30 PM Alexander Ivanov wrote: > > > > On 10/7/23 13:21, Mike Maslenkin wrote: > > On Sat, Oct 7, 2023 at 1:18 PM Alexander Ivanov > > wrote: > >> > >> On 10/6/23 21:43, Mike Maslenkin wrote: > >>> On Mon,

Re: [PATCH qemu v5] aspeed add montblanc bmc reference from fuji

2023-07-05 Thread Mike Choi
, but NOT the arrays of _fruid data array) Thanks, Mike From: Cédric Le Goater Date: Tuesday, July 4, 2023 at 7:07 AM To: Sittisak Sinprem , Bin Huang , Tao Ren , Mike Choi Cc: qemu-devel@nongnu.org , qemu-...@nongnu.org , peter.mayd...@linaro.org , and...@aj.id.au , Joel Stanley , qemu-sta

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-11 Thread Mike Christie
What was the issue you are seeing? Was it something like you get the UA. We retry then on one of the retries the sense is not setup correctly, so the scsi error handler runs? That fails and the device goes offline? If you turn on scsi debugging you would see: [ 335.445922] sd 0:0:0:0: [sda] ta

Re: [RFC PATCH 00/19] hugetlb support for KVM guest_mem

2023-06-16 Thread Mike Kravetz
ers. Your proposal here suggests modifying hugetlb so that it can be used in a new way (use case) by KVM's guest_mem. As such it really seems like something that should be done in a separate filesystem/driver/allocator. You will likely not get much support for modifying hugetlb. -- Mike Krav

[PATCH] udmabuf: revert 'Add support for mapping hugepages (v4)'

2023-06-08 Thread Mike Kravetz
te hugetlb pages. This will require different alignment and size requirements on the UDMABUF_CREATE API. [1] https://lore.kernel.org/linux-mm/20230512072036.1027784-1-junxiao.ch...@intel.com/ Fixes: 16c243e99d33 ("udmabuf: Add support for mapping hugepages (v4)") Cc: Signed-off-by: Mike K

Re: [PATCH v2 10/20] parallels: Add dirty bitmaps saving

2023-10-21 Thread Mike Maslenkin
On Thu, Oct 19, 2023 at 4:05 PM Alexander Ivanov wrote: > > Now dirty bitmaps can be loaded but there is no their saving. Add code for > dirty bitmap storage. > > Signed-off-by: Alexander Ivanov > --- > block/parallels-ext.c | 167 ++ > block/parallels.c

Re: [PATCH v2 01/20] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

2023-10-21 Thread Mike Maslenkin
oid parallels_free_used_bitmap(BlockDriverState > *bs) > { > BDRVParallelsState *s = bs->opaque; > s->used_bmap_size = 0; > +s->used_bmap = NULL; > g_free(s->used_bmap); > } Shouldn't it be added after g_free() call? Regards, Mike.

Re: [PATCH v2 09/20] parallels: Make mark_used() and mark_unused() global functions

2023-10-21 Thread Mike Maslenkin
int64_t *clusters); > > -- > 2.34.1 > > Just a note: parallels_mark_unused() could be initially declared as global just because after patch 3/20 there can be compilation warning: warning: unused function 'mark_unused' [-Wunused-function] :) I do not have strong opinion about how to avoid such compilation warning in the middle of the patch series. The simplest and straightforward way is to declare this function as static in patch 4. I do not have any other objections for the series except misplaced NULL assignment. Regards, Mike.

[PATCH v2 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-26 Thread Mike Christie
When trying to send IO to more than 2 virtqueues the single thread becomes a bottlneck. This patch adds a new setting, workers_per_virtqueue, which can be set to: false: Existing behavior where we get the single worker thread. true: Create a worker per IO virtqueue. Signed-off-by: Mike Christie --

[PATCH v2 0/2] vhost-scsi: Support worker ioctls

2023-11-26 Thread Mike Christie
The following patches allow users to configure the vhost worker threads for vhost-scsi. With vhost-net we get a worker thread per rx/tx virtqueue pair, but for vhost-scsi we get one worker for all workqueues. This becomes a bottlneck after 2 queues are used. In the upstream linux kernel commit: h

[PATCH v2 1/2] vhost: Add worker backend callouts

2023-11-26 Thread Mike Christie
This adds the vhost backend callouts for the worker ioctls added in the 6.4 linux kernel commit: c1ecd8e95007 ("vhost: allow userspace to create workers") Signed-off-by: Mike Christie --- hw/virtio/vhost-backend.c | 28 include/hw/virtio/vhost

Re: [PATCH v2 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-29 Thread Mike Christie
On 11/29/23 3:30 AM, Stefano Garzarella wrote: > On Sun, Nov 26, 2023 at 06:28:34PM -0600, Mike Christie wrote: >> This adds support for vhost-scsi to be able to create a worker thread >> per virtqueue. Right now for vhost-net we get a worker thread per >> tx/rx virtqueue pai

[PATCH v3 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-12-04 Thread Mike Christie
When trying to send IO to more than 2 virtqueues the single thread becomes a bottlneck. This patch adds a new setting, worker_per_virtqueue, which can be set to: false: Existing behavior where we get the single worker thread. true: Create a worker per IO virtqueue. Signed-off-by: Mike Christie Rev

[PATCH v3 1/2] vhost: Add worker backend callouts

2023-12-04 Thread Mike Christie
This adds the vhost backend callouts for the worker ioctls added in the 6.4 linux kernel commit: c1ecd8e95007 ("vhost: allow userspace to create workers") Signed-off-by: Mike Christie Reviewed-by: Stefano Garzarella Reviewed-by: Stefan Hajnoczi --- hw/virtio/vhost-backend.c

[PATCH v3 0/2] vhost-scsi: Support worker ioctls

2023-12-04 Thread Mike Christie
The following patches allow users to configure the vhost worker threads for vhost-scsi. With vhost-net we get a worker thread per rx/tx virtqueue pair, but for vhost-scsi we get one worker for all workqueues. This becomes a bottlneck after 2 queues are used. In the upstream linux kernel commit: h

[PATCH] tcg: drop unused tcg_temp_free define

2023-10-14 Thread Mike Frysinger
Use of the API was removed a while back, but the define wasn't. Signed-off-by: Mike Frysinger --- include/tcg/tcg-op.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 80cfcf8104b6..3ead59e4594d 100644 --- a/include/tcg/tcg-op.h

[PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-13 Thread Mike Christie
When trying to send IO to more than 2 virtqueues the single thread becomes a bottlneck. This patch adds a new setting, virtqueue_workers, which can be set to: 1: Existing behavior whre we get the single thread. -1: Create a worker per IO virtqueue. Signed-off-by: Mike Christie --- hw/scsi/vhost-s

[PATCH 0/2] vhost-scsi: Support worker ioctls

2023-11-13 Thread Mike Christie
The following patches allow users to configure the vhost worker threads for vhost-scsi. With vhost-net we get a worker thread per rx/tx virtqueue pair, but for vhost-scsi we get one worker for all workqueues. This becomes a bottlneck after 2 queues are used. In the upstream linux kernel commit: h

[PATCH 1/2] vhost: Add worker backend callouts

2023-11-13 Thread Mike Christie
This adds the vhost backend callouts for the worker ioctls added in the 6.4 linux kernel commit: c1ecd8e95007 ("vhost: allow userspace to create workers") Signed-off-by: Mike Christie --- hw/virtio/vhost-backend.c | 28 include/hw/virtio/vhost

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Mike Christie
On 11/15/23 5:43 AM, Stefano Garzarella wrote: > On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: >> This adds support for vhost-scsi to be able to create a worker thread >> per virtqueue. Right now for vhost-net we get a worker thread per >> tx/rx virtqueue pai

Re: [PATCH 2/2] vhost-scsi: Add support for a worker thread per virtqueue

2023-11-15 Thread Mike Christie
On 11/15/23 6:57 AM, Stefan Hajnoczi wrote: > On Wed, Nov 15, 2023 at 12:43:02PM +0100, Stefano Garzarella wrote: >> On Mon, Nov 13, 2023 at 06:36:44PM -0600, Mike Christie wrote: >>> This adds support for vhost-scsi to be able to create a worker thread >>> per virtque

Re: Lost partition tables on ide-hd + ahci drive

2023-08-26 Thread Mike Maslenkin
On Wed, Aug 23, 2023 at 12:17 PM Fiona Ebner wrote: > > Am 23.08.23 um 10:47 schrieb Fiona Ebner: > > Am 17.02.23 um 22:22 schrieb Mike Maslenkin: > >> I can not tell anything about dma-reentracy issues, but yes, i would > >> start to look at check_cmd() functio

[Qemu-devel] [RFC] target-i386: present virtual L3 cache info for vcpus

2016-08-28 Thread Longpeng (Mike)
g:268963.640129.8 The VM's topology is "1*socket 8*cores 2*threads". After present virtual L3 cache info for VM, the amounts of RES IPI in guest reduce 85%. Signed-off-by: Longpeng(Mike) --- target-i386/cpu.c | 34 +++--- 1 file changed, 27

Re: [Qemu-devel] [RFC] target-i386: present virtual L3 cache info for vcpus

2016-08-30 Thread Longpeng (Mike)
Hi Eduardo, On 2016/8/30 22:25, Eduardo Habkost wrote: > On Mon, Aug 29, 2016 at 09:17:02AM +0800, Longpeng (Mike) wrote: >> This patch presents virtual L3 cache info for virtual cpus. > > Just changing the L3 cache size in the CPUID code will make > guests see a different ca

Re: [Qemu-devel] [PATCH v2] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng (Mike)
Hi Michael, On 2016/9/1 21:27, Michael S. Tsirkin wrote: > On Thu, Sep 01, 2016 at 02:58:05PM +0800, l00371263 wrote: >> From: "Longpeng(Mike)" >> >> Some software algorithms are based on the hardware's cache info, for example, >> for x86 linux kerne

[Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng(Mike)
From: "Longpeng(Mike)" Some software algorithms are based on the hardware's cache info, for example, for x86 linux kernel, when cpu1 want to wakeup a task on cpu2, cpu1 will trigger a resched IPI and told cpu2 to do the wakeup if they don't share low level cache. Opposite

[Qemu-devel] [PATCH RESEND v3] target-i386: present virtual L3 cache info for vcpus

2016-09-01 Thread Longpeng(Mike)
socket. With L3 cache, the performance improves 7.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) --- Changes since v2: - add more useful commit mesage. - rename "compat-cache" to "l3-cache-shared". Changes since v1: - fix the compat problem: set compat_props on PC_C

Re: [Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-04 Thread Longpeng (Mike)
Hi Michael, On 2016/9/3 6:52, Michael S. Tsirkin wrote: > On Fri, Sep 02, 2016 at 10:22:55AM +0800, Longpeng(Mike) wrote: >> From: "Longpeng(Mike)" >> >> Some software algorithms are based on the hardware's cache info, for example, >> for x86 linux

[Qemu-devel] [PATCH v4 1/2] pc: Add 2.8 machine

2016-09-05 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) --- hw/i386/pc_piix.c| 17 ++--- hw/i386/pc_q35.c | 16 +--- include/hw/compat.h | 2 ++ include/hw/i386/pc.h | 3 +++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index

[Qemu-devel] [PATCH v4 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng(Mike)
et. With L3 cache, the performance improves 7.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PATCH v4 0/2] targte-i386: Add virtual L3 cache support

2016-09-05 Thread Longpeng(Mike)
ps on PC_COMPAT_2_7. - fix a "intentionally introducde bug": make intel's and amd's consistently. - fix the CPUID.(EAX=4, ECX=3):EAX[25:14]. - test the performance if vcpus running on sparate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). --- Longp

[Qemu-devel] [PATCH RESEND v4 1/2] pc: Add 2.8 machine

2016-09-05 Thread Longpeng(Mike)
Signed-off-by: Longpeng(Mike) --- hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 +++-- include/hw/compat.h | 2 ++ include/hw/i386/pc.h | 3 +++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index a07dc81

[Qemu-devel] [PATCH RESEND v4 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng(Mike)
et. With L3 cache, the performance improves 7.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PATCH RESEND v4 0/2] targte-i386: Add virtual L3 cache support

2016-09-05 Thread Longpeng(Mike)
ps on PC_COMPAT_2_7. - fix a "intentionally introducde bug": make intel's and amd's consistently. - fix the CPUID.(EAX=4, ECX=3):EAX[25:14]. - test the performance if vcpus running on sparate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). --- Longp

Re: [Qemu-devel] [PATCH v3] target-i386: present virtual L3 cache info for vcpus

2016-09-05 Thread Longpeng (Mike)
Hi Eduardo, On 2016/9/6 2:53, Eduardo Habkost wrote: > On Fri, Sep 02, 2016 at 10:22:55AM +0800, Longpeng(Mike) wrote: > [...] >> --- >> Changes since v2: >> - add more useful commit mesage. >> - rename "compat-cache" to "l3-cache-shared&quo

[Qemu-devel] [PATCH v5 1/2] pc: Add 2.8 machine

2016-09-06 Thread Longpeng(Mike)
This will used by the next patch. Signed-off-by: Longpeng(Mike) --- hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 +++-- include/hw/i386/pc.h | 3 +++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index

[Qemu-devel] [PATCH v5 2/2] target-i386: present virtual L3 cache info for vcpus

2016-09-06 Thread Longpeng(Mike)
et. With L3 cache, the performance improves 7.2%~33.1%(avg:15.7%). Signed-off-by: Longpeng(Mike) --- include/hw/i386/pc.h | 9 + target-i386/cpu.c| 49 - target-i386/cpu.h| 6 ++ 3 files changed, 59 insertions(+), 5 deletions(-) diff --

[Qemu-devel] [PATCH v5 0/2] targte-i386: Add virtual L3 cache support

2016-09-06 Thread Longpeng(Mike)
f vcpus running on sparate sockets: with L3 cache, the performance improves 7.2%~33.1%(avg: 15.7%). Longpeng(Mike) (2): pc: Add 2.8 machine target-i386: present virtual L3 cache info for vcpus hw/i386/pc_piix.c| 16 +--- hw/i386/pc_q35.c | 13 ++

<    2   3   4   5   6   7   8   9   10   11   >