Re: [PATCH v1] Adding new machine Tiogapass in QEMU

2023-02-12 Thread Cédric Le Goater
Hello, On 2/10/23 13:26, Karthikeyan Pasupathi wrote: This patch support tiogapass in QEMU environment. Signed-off-by: Karthikeyan Pasupathi --- hw/arm/aspeed.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 27dda

Re: [PATCH v2 03/19] hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract parent

2023-02-12 Thread Philippe Mathieu-Daudé
On 13/2/23 08:08, Philippe Mathieu-Daudé wrote: Introduce PCI_MULTISERIAL ("pci-serial"), QOM abstract parent of "pci-serial-2x" and "pci-serial-4x". Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci-multi.c | 35 --- 1 file changed, 20 insertions(+

Re: [PATCH v2 6/9] hw/ppc: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Cédric Le Goater
On 2/13/23 08:04, Philippe Mathieu-Daudé wrote: DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Thanks, C. --- hw/ppc/spapr_vio.c | 4 ++-- 1 file changed, 2 in

[PATCH v2 15/19] hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the SCLP_EVENT() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/event-facility.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index faa51aa4c7..6891e3cd73 100644 -

[PATCH v2 06/19] hw/ide/qdev: Replace DO_UPCAST(IDEDevice) by IDE_DEVICE()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the IDE_DEVICE() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/qdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 6ae2627a56..1ead62fd18 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c

[PATCH v2 12/19] hw/pci/pci: Replace DO_UPCAST(PCIBus) by PCI_BUS()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the PCI_BUS() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2e785e3aef..ae5c33adb6 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -391

[PATCH v2 17/19] hw/usb/dev-hub: Use QOM USB_HUB() macro instead of casting

2023-02-12 Thread Philippe Mathieu-Daudé
Use the safer USB_HUB() QOM type-checking macro instead of casts. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/dev-hub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index a6b50dbc8d..4734700e3e 100644 --- a/hw/usb/dev-hub.c ++

[PATCH v2 16/19] hw/vfio/ccw: Replace DO_UPCAST(VFIOCCWDevice) by VFIO_CCW()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the VFIO_CCW() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/ccw.c | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 0354737666..a8aa5b48c4 100644 ---

[RFC PATCH v2 19/19] hw/usb: Inline usb_bus_from_device()

2023-02-12 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- RFC Other devices don't use such helper. Maybe it should be the other way around, introduce more bus_from_device() helpers? --- hw/usb/bus.c| 10 +- hw/usb/core.c | 6 +++--- hw/usb/dev-hub.c| 4 ++-- hw/usb/dev-serial.

[PATCH v2 13/19] hw/scsi/scsi-bus: Replace DO_UPCAST(SCSIBus) by SCSI_BUS()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the SCSI_BUS() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-bus.c | 12 ++-- include/hw/scsi/scsi.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 7b2a82

[PATCH v2 05/19] hw/char/serial-pci-multi: Replace DO_UPCAST() by PCI_MULTISERIAL()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the PCI_MULTISERIAL() QOM type-checking macro to avoid the few DO_UPCAST(PCIMultiSerialState) calls. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci-multi.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial

[PATCH v2 18/19] hw/usb: Replace DO_UPCAST(USBBus) by USB_BUS()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the USB_BUS() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index b2111bb1c7..f743a5e945 100644 --- a/include/hw/usb.h +++ b/incl

Re: [PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev()

2023-02-12 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > No need to pass 'dev' and 'dev->parent_bus' when we can > retrieve 'parent_bus' with qdev_get_parent_bus(). > > Signed-off-by: Philippe Mathieu-Daudé > --- > softmmu/qdev-monitor.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/so

[PATCH v2 11/19] hw/net/tulip: Finish QOM conversion

2023-02-12 Thread Philippe Mathieu-Daudé
Use the TULIP() and DEVICE() QOM type-checking macros. Remove uses of DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/net/tulip.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/net/tulip.c b/hw/net/tulip.c index 915e5fb595..990507859d 10064

[PATCH v2 04/19] hw/char/serial-pci-multi: Factor multi_serial_class_initfn() out

2023-02-12 Thread Philippe Mathieu-Daudé
Extract code common to multi_2x_serial_pci_class_initfn() and multi_4x_serial_pci_class_initfn() to multi_serial_class_initfn(). Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci-multi.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/cha

[PATCH v2 08/19] hw/net/eepro100: Introduce TYPE_EEPRO100 QOM abstract parent

2023-02-12 Thread Philippe Mathieu-Daudé
Have all the EEPRO100-based devices share a common (abstract) QOM parent. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/eepro100.c | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index dc07984

[PATCH v2 09/19] hw/net/eepro100: Replace DO_UPCAST(EEPRO100State) by EEPRO100()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the EEPRO100() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/net/eepro100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index dac42ba17b..915935a818 100644 --- a/hw/net/eepro100.c

[PATCH v2 14/19] hw/scsi/scsi-bus: Inline two uses of scsi_bus_from_device()

2023-02-12 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/ipl.c | 7 ++- hw/scsi/scsi-bus.c | 2 +- include/hw/scsi/scsi.h | 5 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 8612684d48..4f7f4e60d6 100644 --- a/hw/s390x/ipl.c +

[PATCH v2 10/19] hw/net/ne2000-pci: Replace DO_UPCAST(PCINE2000State) by PCI_NE2000()

2023-02-12 Thread Philippe Mathieu-Daudé
Define TYPE_PCI_NE2000 and the QOM PCI_NE2000() macro. Use PCI_NE2000() instead of DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/net/ne2000-pci.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/net/ne2000-pci.c b/hw/net/ne2000-pci.c index ed

[PATCH v2 07/19] hw/ide/qdev: Replace DO_UPCAST(IDEBus) by IDE_BUS()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the IDE_BUS() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/qdev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 1ead62fd18..a168643266 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/q

[PATCH v2 02/19] hw/char/serial-pci-multi: Batch register types using DEFINE_TYPES macro

2023-02-12 Thread Philippe Mathieu-Daudé
See rationale in commit 38b5d79b2e ("qom: add helper macro DEFINE_TYPES()"). Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci-multi.c | 52 +- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/hw/char/serial-pci-multi.c b/hw/char/seri

[PATCH v2 01/19] hw/char/serial-pci: Replace DO_UPCAST(PCISerialState) by PCI_SERIAL()

2023-02-12 Thread Philippe Mathieu-Daudé
Use the PCI_SERIAL() QOM type-checking macro to avoid DO_UPCAST(). Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index 801b769aba..9689645cac 100644 --- a/hw/ch

[PATCH v2 03/19] hw/char/serial-pci-multi: Introduce PCI_MULTISERIAL QOM abstract parent

2023-02-12 Thread Philippe Mathieu-Daudé
Introduce PCI_MULTISERIAL ("pci-serial"), QOM abstract parent of "pci-serial-2x" and "pci-serial-4x". Signed-off-by: Philippe Mathieu-Daudé --- hw/char/serial-pci-multi.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/hw/char/serial-pci-

[PATCH v2 00/19] hw: Use QOM macros and remove DO_UPCAST() uses

2023-02-12 Thread Philippe Mathieu-Daudé
v2: Rebased QOM housekeeping series which replace the DO_UPCAST() macro uses by equivalent QOM ones. Also: - Use DEVICE() macro - Define some TYPE_xxx - Define some type arrays using DEFINE_TYPES() macro - Introduce abstract QOM (QDev) parent when relevant. Based-on: <20230213070423.76428-1-phi..

[PATCH v2 3/9] hw/block: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/fdc.c | 2 +- hw/block/swim.c| 2 +- hw/ide/qdev.c | 6 +++--- hw/scsi/scsi-bus.c | 18 +- i

[PATCH v2 4/9] hw/net: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 3ae909041a..8

[PATCH v2 8/9] hw: Use qdev_get_parent_bus() in qdev_get_own_fw_dev_path_from_handler()

2023-02-12 Thread Philippe Mathieu-Daudé
No need to pass 'dev' and 'dev->parent_bus' when we can retrieve 'parent_bus' with qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-fw.c | 9 + include/hw/qdev-core.h | 2 +- softmmu/bootdevice.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-)

[PATCH v2 7/9] hw/usb: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/bus.c | 2 +- hw/usb/desc.c | 2 +- hw/usb/dev-smartcard-reader.c | 16 include/hw/usb.h

[PATCH v2 6/9] hw/ppc: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr_vio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 9d4fec2c04..

[PATCH v2 5/9] hw/pci: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-bridge/pci_expander_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci

[PATCH v2 9/9] qdev-monitor: Use qdev_get_parent_bus() in bus_print_dev()

2023-02-12 Thread Philippe Mathieu-Daudé
No need to pass 'dev' and 'dev->parent_bus' when we can retrieve 'parent_bus' with qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daudé --- softmmu/qdev-monitor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c ind

[PATCH v2 2/9] hw/audio: Replace dev->parent_bus by qdev_get_parent_bus(dev)

2023-02-12 Thread Philippe Mathieu-Daudé
DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Signed-off-by: Philippe Mathieu-Daudé --- hw/audio/intel-hda.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index

[PATCH v2 1/9] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus()

2023-02-12 Thread Philippe Mathieu-Daudé
The structure is accessed read-only by qdev_get_parent_bus(). Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev.c | 2 +- include/hw/qdev-core.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d759c4602c..43d863b0c5 100644

[PATCH v2 0/9] hw/qdev: Housekeeping around qdev_get_parent_bus()

2023-02-12 Thread Philippe Mathieu-Daudé
v2: Convert more qdev_get_parent_bus() DeviceState::parent_bus is an internal field and should be accessed by the qdev_get_parent_bus() helper. Replace most uses. Philippe Mathieu-Daudé (9): hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus() hw/audio: Replace dev->parent_bus by

Re: [PATCH v2 07/13] vdpa: add vdpa net migration state notifier

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might need

Re: [PATCH v2 09/13] vdpa net: block migration if the device has CVQ

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Devices with CVQ needs to migrate state beyond vq state. Leaving this to future series. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index bca13f97

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 99

Re: [PATCH] target/riscv: Smepmp: Skip applying default rules when address matches

2023-02-12 Thread LIU Zhiwei
On 2023/2/13 13:21, Himanshu Chauhan wrote: On 13/02/23 09:52, LIU Zhiwei wrote: On 2023/2/9 13:52, Himanshu Chauhan wrote: When MSECCFG.MML is set, after checking the address range in PMP if the asked permissions are not same as programmed in PMP, the default permissions are applied. This s

Re: [PATCH] target/riscv: Smepmp: Skip applying default rules when address matches

2023-02-12 Thread Himanshu Chauhan
On 13/02/23 09:52, LIU Zhiwei wrote: On 2023/2/9 13:52, Himanshu Chauhan wrote: When MSECCFG.MML is set, after checking the address range in PMP if the asked permissions are not same as programmed in PMP, the default permissions are applied. This should only be the case when there is no match

Re: [PATCH] target/riscv: Smepmp: Skip applying default rules when address matches

2023-02-12 Thread LIU Zhiwei
On 2023/2/9 13:52, Himanshu Chauhan wrote: When MSECCFG.MML is set, after checking the address range in PMP if the asked permissions are not same as programmed in PMP, the default permissions are applied. This should only be the case when there is no matching address is found. This patch skips

Re: [PULL 00/11] Net patches

2023-02-12 Thread Jason Wang
On Mon, Feb 6, 2023 at 4:23 PM Laurent Vivier wrote: > > On 2/5/23 13:36, Peter Maydell wrote: > > On Sat, 4 Feb 2023 at 20:09, Laurent Vivier wrote: > >> > >> On 2/4/23 15:57, Peter Maydell wrote: > >>> On Thu, 2 Feb 2023 at 06:21, Jason Wang wrote: > > The following changes since com

Re: [PATCH v1 RFC Zisslpcfi 2/9] target/riscv: zisslpcfi CSR, bit positions and other definitions

2023-02-12 Thread Deepak Gupta
On Sat, Feb 11, 2023 at 11:32:17AM +0800, weiwei wrote: On 2023/2/9 14:23, Deepak Gupta wrote: `zisslpcfi` extension adds two new CSRs. CSR_SSP and CSR_LPLR. - CSR_SSP: This CSR holds shadow stack pointer for current privilege mode CSR_SSP is accessible in all modes. Each mode must e

Re: [PATCH v1 RFC Zisslpcfi 1/9] target/riscv: adding zimops and zisslpcfi extension to RISCV cpu config

2023-02-12 Thread Deepak Gupta
On Sat, Feb 11, 2023 at 11:19:11AM +0800, weiwei wrote: On 2023/2/9 14:23, Deepak Gupta wrote: Introducing riscv `zisslpcfi` extension to riscv target. `zisslpcfi` extension provides hardware assistance to riscv hart to enable control flow integrity (CFI) for software. `zisslpcfi` extension ex

[PATCH v5 1/3] multifd: Create property multifd-sync-after-each-section

2023-02-12 Thread Juan Quintela
We used to synchronize all channels at the end of each RAM section sent. That is not needed, so preparing to only synchronize once every full round in latests patches. Notice that we initialize the property as true. We will change the default when we introduce the new mechanism. Signed-off-by:

[PATCH v5 0/3] Eliminate multifd flush

2023-02-12 Thread Juan Quintela
Hi In this v5: - Remove RAM Flags documentation (already on PULL request) - rebase on top of PULL request. Please review. Based-on: <20230213025150.71537-1-quint...@redhat.com> Migration 20230213 patches In this v4: - Rebased on top of migration-20230209 PULL request - Integrate two p

[PATCH v5 1/3] multifd: Create property multifd-sync-after-each-section

2023-02-12 Thread Juan Quintela
We used to synchronize all channels at the end of each RAM section sent. That is not needed, so preparing to only synchronize once every full round in latests patches. Notice that we initialize the property as true. We will change the default when we introduce the new mechanism. Signed-off-by:

[PATCH v5 0/3] Eliminate multifd flush

2023-02-12 Thread Juan Quintela
Hi In this v5: - Remove RAM Flags documentation (already on PULL request) - rebase on top of PULL request. Please review. Based-on: <20230213025150.71537-1-quint...@redhat.com> Migration 20230213 patches In this v4: - Rebased on top of migration-20230209 PULL request - Integrate two p

[PULL 11/22] migration: I messed state_pending_exact/estimate

2023-02-12 Thread Juan Quintela
I called the helper function from the wrong top level function. This code was introduced in: commit c8df4a7aeffcb46020f610526eea621fa5b0cd47 Author: Juan Quintela Date: Mon Oct 3 02:00:03 2022 +0200 migration: Split save_live_pending() into state_pending_* We split the function into

[PULL 07/22] migration: Make find_dirty_block() return a single parameter

2023-02-12 Thread Juan Quintela
We used to return two bools, just return a single int with the following meaning: old return / again / new return falsefalse PAGE_ALL_CLEAN falsetruePAGE_TRY_AGAIN true truePAGE_DIRTY_FOUND /* We don't care about again at all */ Signed-off-by: Juan Quintela ---

[PULL 06/22] migration: Simplify ram_find_and_save_block()

2023-02-12 Thread Juan Quintela
We will need later that find_dirty_block() return errors, so simplify the loop. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- migration/ram.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/migration/

[PULL 16/22] migration: Add a semaphore to count PONGs

2023-02-12 Thread Juan Quintela
From: Peter Xu This is mostly useless, but useful for us to know whether the main channel is correctly established without changing the migration protocol. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.h | 6 ++ migration/migratio

[PULL 19/22] migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()

2023-02-12 Thread Juan Quintela
From: Leonardo Bras Before assigning "p->quit = true" for every multifd channel, multifd_load_cleanup() will call multifd_recv_terminate_threads() which already does the same assignment, while protected by a mutex. So there is no point doing the same assignment again. Fixes: b5eea99ec2 ("migrat

[PULL 13/22] Update bench-code for addressing CI problem

2023-02-12 Thread Juan Quintela
From: ling xu Unit test code is in test-xbzrle.c, and benchmark code is in xbzrle-bench.c for performance benchmarking. we have modified xbzrle-bench.c to address CI problem. Signed-off-by: ling xu Co-authored-by: Zhou Zhao Co-authored-by: Jun Jin Reviewed-by: Juan Quintela Signed-off-by: Ju

[PULL 01/22] migration: Remove spurious files

2023-02-12 Thread Juan Quintela
I introduced spurious files on my tree during a rebase: commit ebfc57871506b3fe36cc41f69ee3ad31a34afd63 Author: Zhenzhong Duan Date: Mon Oct 17 15:53:51 2022 +0800 multifd: Fix flush of zero copy page send request Make IO channel flush call after the inflight request has been drained

[PULL 14/22] migration: Rework multi-channel checks on URI

2023-02-12 Thread Juan Quintela
From: Peter Xu The whole idea of multi-channel checks was not properly done, IMHO. Currently we check multi-channel in a lot of places, but actually that's not needed because we only need to check it right after we get the URI and that should be it. If the URI check succeeded, we should never n

[PULL 05/22] util/userfaultfd: Support /dev/userfaultfd

2023-02-12 Thread Juan Quintela
From: Peter Xu Teach QEMU to use /dev/userfaultfd when it existed and fallback to the system call if either it's not there or doesn't have enough permission. Firstly, as long as the app has permission to access /dev/userfaultfd, it always have the ability to trap kernel faults which QEMU mostly

[PULL 08/22] migration: Split ram_bytes_total_common() in two functions

2023-02-12 Thread Juan Quintela
It is just a big if in the middle of the function, and we need two functions anways. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Juan Quintela --- Reindent to make Phillipe happy (and CODING_STYLE) --- migration/ram.c | 25 ++--- 1 file changed, 14 insertions(+), 11

[PULL 12/22] AVX512 support for xbzrle_encode_buffer

2023-02-12 Thread Juan Quintela
From: ling xu This commit is the same with [PATCH v6 1/2], and provides avx512 support for xbzrle_encode_buffer function to accelerate xbzrle encoding speed. Runtime check of avx512 support and benchmark for this feature are added. Compared with C version of xbzrle_encode_buffer function, avx512

[PULL 09/22] migration: Calculate ram size once

2023-02-12 Thread Juan Quintela
We are recalculating ram size continously, when we know that it don't change during migration. Create a field in RAMState to track it. Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé --- migration/ram.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a

[PULL 18/22] migration/multifd: Change multifd_load_cleanup() signature and usage

2023-02-12 Thread Juan Quintela
From: Leonardo Bras Since it's introduction in commit f986c3d256 ("migration: Create multifd migration threads"), multifd_load_cleanup() never returned any value different than 0, neither set up any error on errp. Even though, on process_incoming_migration_bh() an if clause uses it's return valu

[PULL 20/22] migration/multifd: Join all multifd threads in order to avoid leaks

2023-02-12 Thread Juan Quintela
From: Leonardo Bras Current approach will only join threads that are still running. For the threads not joined, resources or private memory are always kept in the process space and never reclaimed before process end, and this risks serious memory leaks. This should usually not represent a big p

[PULL 15/22] migration: Cleanup postcopy_preempt_setup()

2023-02-12 Thread Juan Quintela
From: Peter Xu Since we just dropped the only case where postcopy_preempt_setup() can return an error, it doesn't need a retval anymore because it never fails. Move the preempt check to the caller, preparing it to be used elsewhere to do nothing but as simple as kicking the async connection. Sig

[PULL 00/22] Migration 20230213 patches

2023-02-12 Thread Juan Quintela
The following changes since commit 3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-02-09 15:29:14 +) are available in the Git repository at: https://gitlab.com/juan.quintela/qemu.git tags/migration-20230213-

[PULL 02/22] multifd: cleanup the function multifd_channel_connect

2023-02-12 Thread Juan Quintela
From: Li Zhang Cleanup multifd_channel_connect Signed-off-by: Li Zhang Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/multifd.c | 43 +-- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/migration/multifd.c b/migra

[PULL 21/22] migration/multifd: Move load_cleanup inside incoming_state_destroy

2023-02-12 Thread Juan Quintela
From: Leonardo Bras Currently running migration_incoming_state_destroy() without first running multifd_load_cleanup() will cause a yank error: qemu-system-x86_64: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed. (core dumped) The above error happens

[PULL 22/22] ram: Document migration ram flags

2023-02-12 Thread Juan Quintela
0x80 is RAM_SAVE_FLAG_HOOK, it is in qemu-file now. Bigger usable flag is 0x200, noticing that. We can reuse RAM_SAVe_FLAG_FULL. Reviewed-by: Eric Blake Signed-off-by: Juan Quintela --- migration/ram.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/migrati

[PULL 04/22] linux-headers: Update to v6.1

2023-02-12 Thread Juan Quintela
From: Peter Xu Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Acked-by: Cornelia Huck Signed-off-by: Juan Quintela --- include/standard-headers/drm/drm_fourcc.h | 34 - include/standard-headers/linux/ethtool.h | 63 +++- include/standard-headers/linux/fuse.h |

[PULL 17/22] migration: Postpone postcopy preempt channel to be after main

2023-02-12 Thread Juan Quintela
From: Peter Xu Postcopy with preempt-mode enabled needs two channels to communicate. The order of channel establishment is not guaranteed. It can happen that the dest QEMU got the preempt channel connection request before the main channel is established, then the migration may make no progress

[PULL 10/22] migration: Make ram_save_target_page() a pointer

2023-02-12 Thread Juan Quintela
We are going to create a new function for multifd latest in the series. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 6abfe075f

[PULL 03/22] multifd: Remove some redundant code

2023-02-12 Thread Juan Quintela
From: Li Zhang Clean up some unnecessary code Signed-off-by: Li Zhang Signed-off-by: Juan Quintela --- migration/multifd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index c8132ab7e8..7aa030fb19 100644 --- a/m

Re: [PULL 00/22] Migration 20230213 patches

2023-02-12 Thread Juan Quintela
Xxx Xx wrote: > From: Juan Quintela Nack Misses Fixes: label by leanardo Sorry. > The following changes since commit 3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c: > > Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into > staging (2023-02-09 15:29:14 +) > > are available

[PULL 18/22] migration/multifd: Change multifd_load_cleanup() signature and usage

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Since it's introduction in commit f986c3d256 ("migration: Create multifd migration threads"), multifd_load_cleanup() never returned any value different than 0, neither set up any error on errp. Even though, on process_incoming_migration_bh() an if clause uses it's return valu

[PULL 19/22] migration/multifd: Remove unnecessary assignment on multifd_load_cleanup()

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Before assigning "p->quit = true" for every multifd channel, multifd_load_cleanup() will call multifd_recv_terminate_threads() which already does the same assignment, while protected by a mutex. So there is no point doing the same assignment again. Signed-off-by: Leonardo Br

[PULL 06/22] migration: Simplify ram_find_and_save_block()

2023-02-12 Thread Xxx Xx
From: Juan Quintela We will need later that find_dirty_block() return errors, so simplify the loop. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- migration/ram.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) d

[PULL 08/22] migration: Split ram_bytes_total_common() in two functions

2023-02-12 Thread Xxx Xx
From: Juan Quintela It is just a big if in the middle of the function, and we need two functions anways. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Juan Quintela --- Reindent to make Phillipe happy (and CODING_STYLE) --- migration/ram.c | 25 ++--- 1 file changed

[PULL 11/22] migration: I messed state_pending_exact/estimate

2023-02-12 Thread Xxx Xx
From: Juan Quintela I called the helper function from the wrong top level function. This code was introduced in: commit c8df4a7aeffcb46020f610526eea621fa5b0cd47 Author: Juan Quintela Date: Mon Oct 3 02:00:03 2022 +0200 migration: Split save_live_pending() into state_pending_* We sp

[PULL 10/22] migration: Make ram_save_target_page() a pointer

2023-02-12 Thread Xxx Xx
From: Juan Quintela We are going to create a new function for multifd latest in the series. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/migration/ram.c b/migration

[PULL 22/22] ram: Document migration ram flags

2023-02-12 Thread Xxx Xx
From: Juan Quintela 0x80 is RAM_SAVE_FLAG_HOOK, it is in qemu-file now. Bigger usable flag is 0x200, noticing that. We can reuse RAM_SAVe_FLAG_FULL. Reviewed-by: Eric Blake Signed-off-by: Juan Quintela --- migration/ram.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-)

[PULL 01/22] migration: Remove spurious files

2023-02-12 Thread Xxx Xx
From: Juan Quintela I introduced spurious files on my tree during a rebase: commit ebfc57871506b3fe36cc41f69ee3ad31a34afd63 Author: Zhenzhong Duan Date: Mon Oct 17 15:53:51 2022 +0800 multifd: Fix flush of zero copy page send request Make IO channel flush call after the inflight req

[PULL 20/22] migration/multifd: Join all multifd threads in order to avoid leaks

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Current approach will only join threads that are still running. For the threads not joined, resources or private memory are always kept in the process space and never reclaimed before process end, and this risks serious memory leaks. This should usually not represent a big p

[PULL 13/22] Update bench-code for addressing CI problem

2023-02-12 Thread Xxx Xx
From: ling xu Unit test code is in test-xbzrle.c, and benchmark code is in xbzrle-bench.c for performance benchmarking. we have modified xbzrle-bench.c to address CI problem. Signed-off-by: ling xu Co-authored-by: Zhou Zhao Co-authored-by: Jun Jin Reviewed-by: Juan Quintela Signed-off-by: Ju

[PULL 12/22] AVX512 support for xbzrle_encode_buffer

2023-02-12 Thread Xxx Xx
From: ling xu This commit is the same with [PATCH v6 1/2], and provides avx512 support for xbzrle_encode_buffer function to accelerate xbzrle encoding speed. Runtime check of avx512 support and benchmark for this feature are added. Compared with C version of xbzrle_encode_buffer function, avx512

[PULL 15/22] migration: Cleanup postcopy_preempt_setup()

2023-02-12 Thread Xxx Xx
From: Peter Xu Since we just dropped the only case where postcopy_preempt_setup() can return an error, it doesn't need a retval anymore because it never fails. Move the preempt check to the caller, preparing it to be used elsewhere to do nothing but as simple as kicking the async connection. Sig

[PULL 16/22] migration: Add a semaphore to count PONGs

2023-02-12 Thread Xxx Xx
From: Peter Xu This is mostly useless, but useful for us to know whether the main channel is correctly established without changing the migration protocol. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.h | 6 ++ migration/migratio

[PULL 14/22] migration: Rework multi-channel checks on URI

2023-02-12 Thread Xxx Xx
From: Peter Xu The whole idea of multi-channel checks was not properly done, IMHO. Currently we check multi-channel in a lot of places, but actually that's not needed because we only need to check it right after we get the URI and that should be it. If the URI check succeeded, we should never n

[PULL 00/22] Migration 20230213 patches

2023-02-12 Thread Xxx Xx
From: Juan Quintela The following changes since commit 3b33ae48ec28e1e0d1bc28a85c7423724bcb1a2c: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-02-09 15:29:14 +) are available in the Git repository at: https://gitlab.com/juan.quintela/qemu.git ta

[PULL 05/22] util/userfaultfd: Support /dev/userfaultfd

2023-02-12 Thread Xxx Xx
From: Peter Xu Teach QEMU to use /dev/userfaultfd when it existed and fallback to the system call if either it's not there or doesn't have enough permission. Firstly, as long as the app has permission to access /dev/userfaultfd, it always have the ability to trap kernel faults which QEMU mostly

[PULL 07/22] migration: Make find_dirty_block() return a single parameter

2023-02-12 Thread Xxx Xx
From: Juan Quintela We used to return two bools, just return a single int with the following meaning: old return / again / new return falsefalse PAGE_ALL_CLEAN falsetruePAGE_TRY_AGAIN true truePAGE_DIRTY_FOUND /* We don't care about again at all */ Signed-off-

[PULL 09/22] migration: Calculate ram size once

2023-02-12 Thread Xxx Xx
From: Juan Quintela We are recalculating ram size continously, when we know that it don't change during migration. Create a field in RAMState to track it. Signed-off-by: Juan Quintela Reviewed-by: Philippe Mathieu-Daudé --- migration/ram.c | 7 +-- 1 file changed, 5 insertions(+), 2 dele

[PULL 21/22] migration/multifd: Move load_cleanup inside incoming_state_destroy

2023-02-12 Thread Xxx Xx
From: Leonardo Bras Currently running migration_incoming_state_destroy() without first running multifd_load_cleanup() will cause a yank error: qemu-system-x86_64: ../util/yank.c:107: yank_unregister_instance: Assertion `QLIST_EMPTY(&entry->yankfns)' failed. (core dumped) The above error happens

[PULL 02/22] multifd: cleanup the function multifd_channel_connect

2023-02-12 Thread Xxx Xx
From: Li Zhang Cleanup multifd_channel_connect Signed-off-by: Li Zhang Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/multifd.c | 43 +-- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/migration/multifd.c b/migra

[PULL 04/22] linux-headers: Update to v6.1

2023-02-12 Thread Xxx Xx
From: Peter Xu Signed-off-by: Peter Xu Reviewed-by: Juan Quintela Acked-by: Cornelia Huck Signed-off-by: Juan Quintela --- include/standard-headers/drm/drm_fourcc.h | 34 - include/standard-headers/linux/ethtool.h | 63 +++- include/standard-headers/linux/fuse.h |

[PULL 03/22] multifd: Remove some redundant code

2023-02-12 Thread Xxx Xx
From: Li Zhang Clean up some unnecessary code Signed-off-by: Li Zhang Signed-off-by: Juan Quintela --- migration/multifd.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index c8132ab7e8..7aa030fb19 100644 --- a/m

[PULL 17/22] migration: Postpone postcopy preempt channel to be after main

2023-02-12 Thread Xxx Xx
From: Peter Xu Postcopy with preempt-mode enabled needs two channels to communicate. The order of channel establishment is not guaranteed. It can happen that the dest QEMU got the preempt channel connection request before the main channel is established, then the migration may make no progress

Re: [PATCH v6 0/4] memory: prevent dma-reentracy issues

2023-02-12 Thread Alexander Bulekov
ping On 230204 2307, Alexander Bulekov wrote: > These patches aim to solve two types of DMA-reentrancy issues: > > 1.) mmio -> dma -> mmio case > To solve this, we track whether the device is engaged in io by > checking/setting a reentrancy-guard within APIs used for MMIO access. > > 2.) bh

Re: [PATCH 00/10] Retire Fork-Based Fuzzing

2023-02-12 Thread Alexander Bulekov
ping On 230204 2329, Alexander Bulekov wrote: > Hello, > This series removes fork-based fuzzing. > How does fork-based fuzzing work? > * A single parent process initializes QEMU > * We identify the devices we wish to fuzz (fuzzer-dependent) > * Use QTest to PCI enumerate the devices > * After

[PATCH v1 4/6] kvm: Add helper kvm_dirty_ring_init()

2023-02-12 Thread Gavin Shan
Due to multiple capabilities associated with the dirty ring for different architectures: KVM_CAP_DIRTY_{LOG_RING, LOG_RING_ACQ_REL} for x86 and arm64 separately. There will be more to be done in order to support the dirty ring for arm64. Lets add helper kvm_dirty_ring_init() to enable the dirty ri

[PATCH v1 2/6] migration: Add last stage indicator to global dirty log synchronization

2023-02-12 Thread Gavin Shan
The global dirty log synchronization is used when KVM and dirty ring are enabled. There is a particularity for ARM64 where the backup bitmap is used to track dirty pages in non-running-vcpu situations. It means the dirty ring works with the combination of ring buffer and backup bitmap. The dirty bi

[PATCH v1 5/6] hw/arm/virt: Enable backup bitmap for dirty ring

2023-02-12 Thread Gavin Shan
When KVM device "kvm-arm-gicv3" or "arm-its-kvm" is used, we have to enable the backup bitmap for the dirty ring. Otherwise, the migration will fail because those two devices are using the backup bitmap to track dirty guest memory, corresponding to various hardware tables. Signed-off-by: Gavin Sha

[PATCH v1 3/6] kvm: Synchronize the backup bitmap in the last stage

2023-02-12 Thread Gavin Shan
In the last stage of live migration or memory slot removal, the backup bitmap needs to be synchronized when it has been enabled. Signed-off-by: Gavin Shan --- accel/kvm/kvm-all.c | 11 +++ include/sysemu/kvm_int.h | 1 + 2 files changed, 12 insertions(+) diff --git a/accel/kvm/kvm

  1   2   >