[PULL 16/46] hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names

2023-10-19 Thread Philippe Mathieu-Daudé
Host bridge device and PCI function #0 are inverted. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id: <20231012041237.22281-3-phi...@linaro.org> --- hw/pci-host/sh_pci.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/pci-host

[PULL 09/46] memory: follow Error API guidelines

2023-10-19 Thread Philippe Mathieu-Daudé
From: Marc-André Lureau Return true/false on success/failure. Signed-off-by: Marc-André Lureau Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231009075310.153617-1-marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h

[PULL 30/46] hw/audio/pcspk: Inline pcspk_init()

2023-10-19 Thread Philippe Mathieu-Daudé
pcspk_init() is a legacy init function, inline and remove it. Since the device is realized using &error_fatal, use the same error for setting the "pit" link. Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20231019073307.99608-1-phi...@linaro.org> --- include/h

[PULL 22/46] hw/intc/apic: Use ERRP_GUARD() in apic_common_realize()

2023-10-19 Thread Philippe Mathieu-Daudé
APICCommonClass::realize() is a DeviceRealize() handler which take an Error** parameter and can fail. Do not proceed further on failure. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Message-Id: <20231003082728.83496-2-phi...@linaro.org> --- hw/intc/apic_common.c | 4 1 file

[PULL 28/46] hw/intc/spapr_xive: Move sysbus_init_mmio() calls around

2023-10-19 Thread Philippe Mathieu-Daudé
In order to make the next commit trivial, move sysbus_init_mmio() calls just before the corresponding sysbus_mmio_map() calls. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: LIU Zhiwei Reviewed-by: Cédric Le Goater Message-Id: <20231

[PULL 10/46] hw/sd/sdhci: Block Size Register bits [14:12] is lost

2023-10-19 Thread Philippe Mathieu-Daudé
From: Lu Gao Block Size Register bits [14:12] is SDMA Buffer Boundary, it is missed in register write, but it is needed in SDMA transfer. e.g. it will be used in sdhci_sdma_transfer_multi_blocks to calculate boundary_ variables. Missing this field will cause wrong operation for different SDMA Bu

[PULL 03/46] MAINTAINERS: Add hw/input/lasips2.c to the HPPA machine section

2023-10-19 Thread Philippe Mathieu-Daudé
From: Thomas Huth hw/input/lasips2.c and the corresponding header include/hw/input/lasips2.h are only used by the HPPA machine, so add them to the corresponding section in the MAINTAINERS file. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Messag

[PULL 07/46] buildsys: Only display Objective-C information when Objective-C is used

2023-10-19 Thread Philippe Mathieu-Daudé
When configuring with '--disable-cocoa --disable-coreaudio' on Darwin, we get: meson.build:4081:58: ERROR: Tried to access compiler for language "objc", not specified for host machine. meson.build:4097:47: ERROR: Tried to access unknown option 'objc_args'. Instead of unconditionally display Ob

[PULL 05/46] MAINTAINERS: Add include/hw/openrisc/ to the OpenRISC section

2023-10-19 Thread Philippe Mathieu-Daudé
From: Thomas Huth hw/openrisc/ is already listed here, so we should mention the folder for the headers here, too. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231017154242.234133-1-th...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 +

[PULL 08/46] memory: drop needless argument

2023-10-19 Thread Philippe Mathieu-Daudé
From: Marc-André Lureau The argument is unused since commit bdc44640c ("cpu: Use QTAILQ for CPU list"). Signed-off-by: Marc-André Lureau Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231009075231.150568-1-marcandre.lur...@redhat.com> Signed-off-by: Philippe

[PULL 00/46] Misc HW/UI patches for 2023-10-19

2023-10-19 Thread Philippe Mathieu-Daudé
The following changes since commit 0d239e513e0117e66fa739fb71a43b9383a108ff: Merge tag 'pull-lu-20231018' of https://gitlab.com/rth7680/qemu into staging (2023-10-19 10:20:57 -0700) are available in the Git repository at: https://github.com/philmd/qemu.git tags/hw-misc-20231019

[PULL 02/46] MAINTAINERS: Split vt82c686 out of fuloong2e

2023-10-19 Thread Philippe Mathieu-Daudé
From: BALATON Zoltan The VIA south bridges are now mostly used by other machines not just fuloong2e so split off into a separate section and take maintainership. Signed-off-by: BALATON Zoltan Message-ID: <20231015141517.21931745...@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- MA

Re: [PATCH v4 1/4] migration/doc: Add contents

2023-10-19 Thread Fabiano Rosas
Juan Quintela writes: > Signed-off-by: Juan Quintela Reviewed-by: Fabiano Rosas

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Cédric Le Goater
On 10/19/23 22:49, Greg Kurz wrote: Hi Juan, On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: Current code does: - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance dependinfg on cpu number - for newer machines, it register vmstate_icp with "icp/server" name and

Re: [PATCH v4 3/4] migration/doc: How to migrate when hosts have different features

2023-10-19 Thread Fabiano Rosas
Juan Quintela writes: > Sometimes devices have different features depending of things outside > of qemu. For instance the kernel. Document how to handle that cases. > > Signed-off-by: Juan Quintela > Acked-by: Peter Xu > --- Reviewed-by: Fabiano Rosas

Re: [PATCH v4 5/5] migration: Change ram_save_queue_pages() retval to bool

2023-10-19 Thread Fabiano Rosas
Peter Xu writes: > After we have errp which contains the more detailed error message, make > ram_save_queue_pages() returns bool in its stack. > > Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas

Re: [PATCH v4 4/5] migration: Change ram_dirty_bitmap_reload() retval to bool

2023-10-19 Thread Fabiano Rosas
Peter Xu writes: > Now we have a Error** passed into the return path thread stack, which is > even clearer than an int retval. Change ram_dirty_bitmap_reload() and the > callers to use a bool instead to replace errnos. > > Suggested-by: Philippe Mathieu-Daudé > Signed-off-by: Peter Xu Reviewe

Re: [PATCH v4 1/5] migration: Refactor error handling in source return path

2023-10-19 Thread Fabiano Rosas
Peter Xu writes: > rp_state.error was a boolean used to show error happened in return path > thread. That's not only duplicating error reporting (migrate_set_error), > but also not good enough in that we only do error_report() and set it to > true, we never can keep a history of the exact error

Re: [PATCH] semihosting: fix memleak at semihosting_arg_fallback

2023-10-19 Thread Philippe Mathieu-Daudé
On 19/10/23 20:32, Matheus Tavares Bernardino wrote: We duplicate "cmd" as strtok may modify its argument, but we forgot to free it later. Furthermore, add_semihosting_arg doesn't take responsibility for this memory either (it strdup's the argument). Signed-off-by: Matheus Tavares Bernardino --

Re: [PATCH 10/13] migration: Improve example and documentation of vmstate_register()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Signed-off-by: Juan Quintela --- docs/devel/migration.rst | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index c3e1400c0c..a9fde75862 100644 --- a/docs/devel/migrati

Re: [PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Greg Kurz
Hi Juan, On Thu, 19 Oct 2023 21:08:25 +0200 Juan Quintela wrote: > Current code does: > - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance > dependinfg on cpu number > - for newer machines, it register vmstate_icp with "icp/server" name > and instance 0 > - now it unregiste

[PATCH V1 1/4] migration: mode parameter

2023-10-19 Thread Steve Sistare
Create a mode migration parameter that can be used to select alternate migration algorithms. The default mode is normal, representing the current migration algorithm, and does not need to be explicitly set. No functional change until a new mode is added, except that the mode is shown by the 'info

[PATCH V1 3/4] cpr: relax some blockers

2023-10-19 Thread Steve Sistare
Some devices block migration because they rely on local state that is not migrated to the target host, such as for local filesystems. These need not block cpr, which will restart qemu on the same host. Narrow the scope of these blockers so they only apply to normal mode. They will not block cpr mod

[PATCH V1 0/4] Live Update reboot mode

2023-10-19 Thread Steve Sistare
Add a mode migration parameter that can be used to select alternate migration algorithms. The default mode is normal, representing the current migration algorithm, and does not need to be explicitly set. Provide the cpr-reboot migration mode for live update, which saves state to a file. This all

[PATCH V1 2/4] migration: per-mode blockers

2023-10-19 Thread Steve Sistare
Extend the blocker interface so that a blocker can be registered for one or more migration modes. The existing interfaces register a blocker for all modes, and the new interfaces take a varargs list of modes. Internally, maintain a separate blocker list per mode. The same Error object may be add

[PATCH V1 4/4] cpr: reboot mode

2023-10-19 Thread Steve Sistare
Add the cpr-reboot migration mode. Usage: $ qemu-system-$arch -monitor stdio ... QEMU 8.1.50 monitor - type 'help' for more information (qemu) migrate_set_capability x-ignore-shared on (qemu) migrate_set_parameter mode cpr-reboot (qemu) migrate -d file:vm.state (qemu) info status VM status: pause

Re: [PATCH 13/13] migration: Use vmstate_register_any() for vmware_vga

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: I have no idea if we can have more than one vmware_vga device, so play it safe. Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vm

[PATCH 1/2] misc/pca9552: Fix inverted input status

2023-10-19 Thread Glenn Miles
The pca9552 INPUT0 and INPUT1 registers are supposed to hold the logical values of the LED pins. A logical 0 should be seen in the INPUT0/1 registers for a pin when its corresponding LSn bits are set to 0, which is also the state needed for turning on an LED in a typical usage scenario. Existing

[PATCH 2/2] misc/pca9552: Let external devices set pca9552 inputs

2023-10-19 Thread Glenn Miles
Allow external devices to drive pca9552 input pins by adding input GPIO's to the model. This allows a device to connect its output GPIO's to the pca9552 input GPIO's. In order for an external device to set the state of a pca9552 pin, the pin must first be configured for high impedance (LED is off

[PATCH 0/2] misc/pca9552: Changes to support powernv10

2023-10-19 Thread Glenn Miles
This is a series of patches targeted at getting the pca9552 model ready for use by the powernv10 machine. Glenn Miles (2): misc/pca9552: Fix inverted input status misc/pca9552: Let external devices set pca9552 inputs hw/misc/pca9552.c | 51 +- inc

Re: [PATCH 11/13] migration: Use vmstate_register_any() for audio

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We can have more than one audio card. void audio_init_audiodevs(void) { AudiodevListEntry *e; QSIMPLEQ_FOREACH(e, &audiodevs, next) { audio_init(e->dev, &error_fatal); } } Signed-off-by: Juan Quintela Reviewed-by: Stefan Berg

Re: [PATCH 12/13] migration: Use vmstate_register_any() for eeprom93xx

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We can have more than one eeprom93xx. For instance: e100_nic_realize() -> eeprom93xx_new() Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- hw/nvram/eeprom93xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nv

Re: [PATCH 05/13] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Each user network conection create a new slirp instance. We register more than one slirp instance for number 0. qemu-system-x86_64: -netdev user,id=hs1: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=slirp, instance_id=0x0 Broken pi

Re: [PATCH 06/13] migration: Use VMSTATE_INSTANCE_ID_ANY for s390 devices

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Just with make check I can see that we can have more than one of this devices, so use ANY. ok 5 /s390x/device/introspect/abstract-interfaces ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEM

Re: [PATCH v5 6/6] plugins: Remove an extra parameter

2023-10-19 Thread Alex Bennée
Akihiko Odaki writes: > copy_call() has an unused parameter so remove it. > > Signed-off-by: Akihiko Odaki Queued to plugins/next, thanks. > --- > accel/tcg/plugin-gen.c | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plug

Re: [PATCH 04/13] migration: Use vmstate_register_any() for ipmi-bt*

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: Otherwise device-introspection-test fails. $ ./tests/qtest/device-introspect-test ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0) Aborte

Re: [PATCH 03/13] migration: Use vmstate_register_any() for isa-ide

2023-10-19 Thread Stefan Berger

Re: [PATCH 02/13] migration: Use vmstate_register_any()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: This are the easiest cases, where we were already using VMSTATE_INSTANCE_ID_ANY. Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger --- backends/dbus-vmstate.c | 3 +-- backends/tpm/tpm_emulator.c | 3 +-- hw/i2c/core.c

Re: [PATCH 01/13] migration: Create vmstate_register_any()

2023-10-19 Thread Stefan Berger
On 10/19/23 15:08, Juan Quintela wrote: We have lots of cases where we are using an instance_id==0 when we should be using VMSTATE_INSTANCE_ID_ANY (-1). Basically everything that can have more than one needs to have a proper instance_id or -1 and the system will take one for it. vmstate_regis

Re: [PATCH 3/6] tests: Add migration dirty-limit capability test

2023-10-19 Thread Fabiano Rosas
Hyman Huang writes: > Add migration dirty-limit capability test if kernel support > dirty ring. > > Migration dirty-limit capability introduce dirty limit > capability, two parameters: x-vcpu-dirty-limit-period and > vcpu-dirty-limit are introduced to implement the live > migration with dirty lim

Re: [PATCH 6/6] docs/migration: Add the dirty limit section

2023-10-19 Thread Fabiano Rosas
Hyman Huang writes: > The dirty limit feature has been introduced since the 8.1 > QEMU release but has not reflected in the document, add a > section for that. > > Signed-off-by: Hyman Huang > --- > docs/devel/migration.rst | 71 > 1 file changed, 71 ins

Re: [PATCH 2/6] system/dirtylimit: Drop the reduplicative check

2023-10-19 Thread Fabiano Rosas
Hyman Huang writes: > Checking if dirty limit is in service is done by the > dirtylimit_query_all function, drop the reduplicative > check in the qmp_query_vcpu_dirty_limit function. > > Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas

Re: [PATCH 1/6] system/dirtylimit: Fix a race situation

2023-10-19 Thread Fabiano Rosas
Hyman Huang writes: > Fix a race situation for global variable dirtylimit_state. > > Also, replace usleep by g_usleep to increase platform > accessibility to the sleep function. > > Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas

Re: [PULL 06/25] s390x/cpu topology: resetting the Topology-Change-Report

2023-10-19 Thread Thomas Huth
On 19/10/2023 19.55, Nina Schoetterl-Glausch wrote: On Thu, 2023-10-19 at 09:35 -0700, Stefan Hajnoczi wrote: On Wed, 18 Oct 2023 at 06:09, Thomas Huth wrote: From: Pierre Morel During a subsystem reset the Topology-Change-Report is cleared by the machine. Let's ask KVM to clear the Modifie

[PATCH v14 03/14] migration: convert migration 'uri' into 'MigrateAddress'

2023-10-19 Thread Fabiano Rosas
From: Het Gala This patch parses 'migrate' and 'migrate-incoming' QAPI's 'uri' string containing migration connection related information and stores them inside well defined 'MigrateAddress' struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Signed-off-by: Fabiano Rosas --- mig

[PATCH v14 08/14] migration: Convert the file backend the new QAPI syntax

2023-10-19 Thread Fabiano Rosas
Convert the file: URI to accept a FileMigrationArgs to be compatible with the new migration QAPI. Signed-off-by: Fabiano Rosas --- migration/file.c | 22 +++--- migration/file.h | 9 ++--- migration/migration.c | 10 -- 3 files changed, 17 insertions(+), 24

[PATCH v14 12/14] migration: Implement MigrateChannelList to qmp migration flow.

2023-10-19 Thread Fabiano Rosas
From: Het Gala Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retn

[PATCH v14 10/14] fixup! migration: New migrate and migrate-incoming argument 'channels'

2023-10-19 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- qapi/migration.json | 8 1 file changed, 8 insertions(+) diff --git a/qapi/migration.json b/qapi/migration.json index 85ad5f2601..f51e6663bb 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1666,6 +1666,14 @@ #

[PATCH v14 11/14] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax

2023-10-19 Thread Fabiano Rosas
From: Het Gala migration_channels_and_uri_compatible() check for transport mechanism suitable for multifd migration gets executed when the caller calls old uri syntax. It needs it to be run when using the modern MigrateChannel QAPI syntax too. After URI -> 'MigrateChannel' : migration_channels_a

[PATCH v14 07/14] migration: convert exec backend to accept MigrateAddress.

2023-10-19 Thread Fabiano Rosas
From: Het Gala Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-b

[PATCH v14 01/14] migration: New QAPI type 'MigrateAddress'

2023-10-19 Thread Fabiano Rosas
From: Het Gala This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of type string. The current implementation follows double encoding scheme for fetching migration parameters like 'uri'

[PATCH v14 14/14] migration: modify test_multifd_tcp_none() to use new QAPI syntax.

2023-10-19 Thread Fabiano Rosas
From: Het Gala modify multifd tcp common test to incorporate the new QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qte

[PATCH v14 04/14] fixup! migration: convert migration 'uri' into 'MigrateAddress'

2023-10-19 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- migration/file.c | 2 +- migration/file.h | 1 + migration/migration.c | 6 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/migration/file.c b/migration/file.c index cf5b1bf365..ec069ef329 100644 --- a/migration/file.c +++ b/migratio

[PATCH v14 06/14] migration: convert rdma backend to accept MigrateAddress

2023-10-19 Thread Fabiano Rosas
From: Het Gala RDMA based transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for RDMA connection into well defined InetSocketAddress struct. Suggested-by: Ara

[PATCH v14 02/14] fixup! migration: New QAPI type 'MigrateAddress'

2023-10-19 Thread Fabiano Rosas
Signed-off-by: Fabiano Rosas --- qapi/migration.json | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index c352c7ac52..602cb706e3 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1519,10 +1519,25 @@

Re: [PATCH v13 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-10-19 Thread Fabiano Rosas
Het Gala writes: > On 18/10/23 7:58 pm, Fabiano Rosas wrote: >> Het Gala writes: >> >>> Fabiano, would your below commits impact this patchset 'make check' >>> tests ? Because you have added tests for file based migration, which is >>> still not included in this patchset. >> AFAICS, the tests sh

[PATCH v14 05/14] migration: convert socket backend to accept MigrateAddress

2023-10-19 Thread Fabiano Rosas
From: Het Gala Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for socket connection into well defined SocketAddress struct. Suggested-by: Aravind R

[PATCH v14 13/14] migration: Implement MigrateChannelList to hmp migration flow.

2023-10-19 Thread Fabiano Rosas
From: Het Gala Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for hmp migration. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Signed-off-by: Fabiano Rosas --- migration/migration-hmp-cmds.c | 27 +

[PATCH v14 09/14] migration: New migrate and migrate-incoming argument 'channels'

2023-10-19 Thread Fabiano Rosas
From: Het Gala MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateC

[PATCH v14 00/14] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration

2023-10-19 Thread Fabiano Rosas
Hi, I had to make this a new version because the file: tests are already merged and Het's patches break them unless we also convert the file transport to the new API. I did the conversion and added separate patches as fixups so we can review my additions separately. Het's series untouched aside

[PATCH 12/13] migration: Use vmstate_register_any() for eeprom93xx

2023-10-19 Thread Juan Quintela
We can have more than one eeprom93xx. For instance: e100_nic_realize() -> eeprom93xx_new() Signed-off-by: Juan Quintela --- hw/nvram/eeprom93xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c index 1081e2cc0d..57d63638d7 100644

[PATCH 13/13] migration: Use vmstate_register_any() for vmware_vga

2023-10-19 Thread Juan Quintela
I have no idea if we can have more than one vmware_vga device, so play it safe. Signed-off-by: Juan Quintela --- hw/display/vmware_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 09591fbd39..7490d43881 100644 --- a

[PATCH 05/13] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp

2023-10-19 Thread Juan Quintela
Each user network conection create a new slirp instance. We register more than one slirp instance for number 0. qemu-system-x86_64: -netdev user,id=hs1: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=slirp, instance_id=0x0 Broken pipe ../../../../../mnt/code/qemu/full/tests/q

[PATCH 02/13] migration: Use vmstate_register_any()

2023-10-19 Thread Juan Quintela
This are the easiest cases, where we were already using VMSTATE_INSTANCE_ID_ANY. Signed-off-by: Juan Quintela --- backends/dbus-vmstate.c | 3 +-- backends/tpm/tpm_emulator.c | 3 +-- hw/i2c/core.c | 2 +- hw/input/adb.c | 2 +- hw/input/ads7846.c | 2 +-

[PATCH 11/13] migration: Use vmstate_register_any() for audio

2023-10-19 Thread Juan Quintela
We can have more than one audio card. void audio_init_audiodevs(void) { AudiodevListEntry *e; QSIMPLEQ_FOREACH(e, &audiodevs, next) { audio_init(e->dev, &error_fatal); } } Signed-off-by: Juan Quintela --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 06/13] migration: Use VMSTATE_INSTANCE_ID_ANY for s390 devices

2023-10-19 Thread Juan Quintela
Just with make check I can see that we can have more than one of this devices, so use ANY. ok 5 /s390x/device/introspect/abstract-interfaces ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (exp

[PATCH 03/13] migration: Use vmstate_register_any() for isa-ide

2023-10-19 Thread Juan Quintela
Otherwise qom-test fails. ok 4 /i386/qom/x-remote qemu-system-i386: savevm_state_handler_insert: Detected duplicate SaveStateEntry: id=isa-ide, instance_id=0x0 Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered ex

[PATCH 07/13] RFC migration: icp/server is a mess

2023-10-19 Thread Juan Quintela
Current code does: - register pre_2_10_vmstate_dummy_icp with "icp/server" and instance dependinfg on cpu number - for newer machines, it register vmstate_icp with "icp/server" name and instance 0 - now it unregisters "icp/server" for the 1st instance. This is wrong at many levels: - we should

[PATCH 10/13] migration: Improve example and documentation of vmstate_register()

2023-10-19 Thread Juan Quintela
Signed-off-by: Juan Quintela --- docs/devel/migration.rst | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index c3e1400c0c..a9fde75862 100644 --- a/docs/devel/migration.rst +++ b/docs/devel/migration.rst @@ -165,

[PATCH 08/13] migration: vmstate_register() check that instance_id is valid

2023-10-19 Thread Juan Quintela
Signed-off-by: Juan Quintela --- include/migration/vmstate.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 9ca7e9cc48..d1282a78ef 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -28,6 +28,7 @

Re: [PATCH v2 07/19] target/i386: introduce flags writeback mechanism

2023-10-19 Thread Paolo Bonzini
Il gio 19 ott 2023, 19:44 Richard Henderson ha scritto: > On 10/19/23 03:46, Paolo Bonzini wrote: > > +/* > > + * Write back flags after last memory access. Some newer ALU > instructions, as > > + * well as SSE instructions, write flags in the gen_* function, but > that can > > +

[PATCH 09/13] migration: Check in savevm_state_handler_insert for dups

2023-10-19 Thread Juan Quintela
From: Peter Xu Before finally register one SaveStateEntry, we detect for duplicated entries. This could be helpful to notify us asap instead of get silent migration failures which could be hard to diagnose. For example, this patch will generate a message like this (if without previous fixes on

[PATCH 01/13] migration: Create vmstate_register_any()

2023-10-19 Thread Juan Quintela
We have lots of cases where we are using an instance_id==0 when we should be using VMSTATE_INSTANCE_ID_ANY (-1). Basically everything that can have more than one needs to have a proper instance_id or -1 and the system will take one for it. vmstate_register_any(): We register with -1. Signed-off-

[PATCH 00/13] migration: Check for duplicates on vmstate_register()

2023-10-19 Thread Juan Quintela
Hi This series are based in a patch from Peter than check if a we try to register the same device with the same instance_id more than once. It was not merged when he sent it because it broke "make check". So I fixed all devices to be able to merge it. - I create vmstate_register_any(), its the

[PATCH 04/13] migration: Use vmstate_register_any() for ipmi-bt*

2023-10-19 Thread Juan Quintela
Otherwise device-introspection-test fails. $ ./tests/qtest/device-introspect-test ... Broken pipe ../../../../../mnt/code/qemu/full/tests/qtest/libqtest.c:195: kill_qemu() tried to terminate QEMU process but encountered exit status 1 (expected 0) Aborted (core dumped) Signed-off-by: Juan Quintel

Re: [RFC PATCH v2 1/6] migration/multifd: Remove channels_ready semaphore

2023-10-19 Thread Peter Xu
On Thu, Oct 19, 2023 at 08:41:26PM +0200, Juan Quintela wrote: > We can changing pending_job to a bool if you preffer. I think that we > have nailed all the off_by_one errors by now (famous last words). Would it work to make pending_job a bool, even with SYNC? It seems to me multifd_send_sync_ma

Re: [RFC PATCH v2 1/6] migration/multifd: Remove channels_ready semaphore

2023-10-19 Thread Peter Xu
On Thu, Oct 19, 2023 at 08:28:05PM +0200, Juan Quintela wrote: > Peter Xu wrote: > > On Thu, Oct 19, 2023 at 05:00:02PM +0200, Juan Quintela wrote: > >> Peter Xu wrote: > >> > Fabiano, > >> > > >> > Sorry to look at this series late; I messed up my inbox after I reworked > >> > my > >> > arrange

Re: [PULL 08/83] vdpa: Restore hash calculation state

2023-10-19 Thread Stefan Hajnoczi
On Thu, 19 Oct 2023 at 11:34, Michael S. Tsirkin wrote: > > On Thu, Oct 19, 2023 at 09:32:28AM -0700, Stefan Hajnoczi wrote: > > On Wed, 18 Oct 2023 at 08:56, Michael S. Tsirkin wrote: > > > > > > From: Hawkins Jiawei > > > > > > This patch introduces vhost_vdpa_net_load_rss() to restore > > > t

Re: [RFC PATCH v2 1/6] migration/multifd: Remove channels_ready semaphore

2023-10-19 Thread Juan Quintela
Fabiano Rosas wrote: > Juan Quintela writes: > >> Fabiano Rosas wrote: >>> Juan Quintela writes: >>> >> >> This is a common pattern for concurrency. To not have your mutex locked >> too long, you put a variable (that can only be tested/changed with the >> lock) to explain that the "channel" is

[PULL v2 26/78] vhost-user: factor out "vhost_user_write_sync"

2023-10-19 Thread Michael S. Tsirkin
From: Laszlo Ersek The tails of the "vhost_user_set_vring_addr" and "vhost_user_set_u64" functions are now byte-for-byte identical. Factor the common tail out to a new function called "vhost_user_write_sync". This is purely refactoring -- no observable change. Cc: "Michael S. Tsirkin" (support

[PULL v2 19/78] tests: bios-tables-test: Add test for smbios type4 thread count

2023-10-19 Thread Michael S. Tsirkin
From: Zhao Liu This tests the commit 7298fd7de5551 ("hw/smbios: Fix thread count in type4"). In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of threads in the socket is not more than 255, then smbios type4 table encodes threads per socket into the thread count field. So for t

[PULL v2 22/78] tests: bios-tables-test: Add test for smbios type4 thread count2

2023-10-19 Thread Michael S. Tsirkin
From: Zhao Liu This tests the commit 7298fd7de5551 ("hw/smbios: Fix thread count in type4"). In smbios_build_type_4_table() (hw/smbios/smbios.c), if the number of threads in the socket is more than 255, then smbios type4 table encodes threads per socket into the thread count2 field. So for the

[PATCH 3/7] target/i386: Use tcg_gen_ext_tl

2023-10-19 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 28 +++- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 0c81e066de..d420ed8f0a 100644 --- a/target/i386/tcg/translate.c +++ b/

[PATCH 7/7] target/xtensa: Use tcg_gen_sextract_i32

2023-10-19 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 54bee7ddba..de89940599 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c

[PULL v2 45/78] hw/i386/pc_q35: Wire ICH9 LPC function's interrupts before its realize()

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow When the board assigns the ISA IRQs after the device's realize(), internal devices such as the RTC can't be wired in ich9_lpc_realize() since the qemu_irqs are still NULL. Fix that by assigning the ISA interrupts before realize(). This change is necessary for PIIX consolid

[PULL v2 31/78] memory: initialize 'fv' in MemoryRegionCache to make Coverity happy

2023-10-19 Thread Michael S. Tsirkin
From: Ilya Maximets Coverity scan reports multiple false-positive "defects" for the following series of actions in virtio.c: MemoryRegionCache indirect_desc_cache; address_space_cache_init_empty(&indirect_desc_cache); address_space_cache_destroy(&indirect_desc_cache); For some reason it's

[PATCH 1/7] tcg: Export tcg_gen_ext_{i32,i64,tl}

2023-10-19 Thread Richard Henderson
The two concrete type functions already existed, merely needing a bit of hardening to invalid inputs. Signed-off-by: Richard Henderson --- include/tcg/tcg-op-common.h | 2 ++ include/tcg/tcg-op.h| 2 ++ tcg/tcg-op-ldst.c | 14 ++ 3 files changed, 14 insertions(+),

[PULL v2 27/78] vhost-user: flatten "enforce_reply" into "vhost_user_write_sync"

2023-10-19 Thread Michael S. Tsirkin
From: Laszlo Ersek At this point, only "vhost_user_write_sync" calls "enforce_reply"; embed the latter into the former. This is purely refactoring -- no observable change. Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez

Re: [PULL 08/83] vdpa: Restore hash calculation state

2023-10-19 Thread Michael S. Tsirkin
On Thu, Oct 19, 2023 at 09:32:28AM -0700, Stefan Hajnoczi wrote: > On Wed, 18 Oct 2023 at 08:56, Michael S. Tsirkin wrote: > > > > From: Hawkins Jiawei > > > > This patch introduces vhost_vdpa_net_load_rss() to restore > > the hash calculation state at device's startup. > > > > Note that vhost_vd

[PULL v2 51/78] hw/isa/piix3: Drop the "3" from PIIX base class name

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow TYPE_PIIX3_PCI_DEVICE was the former base class of the Xen and non-Xen variants of the PIIX3 ISA device models. It will become the base class for the PIIX3 and PIIX4 device models, so drop the "3" from the type names. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S

[PULL v2 72/78] hw/i386/cxl: ensure maxram is greater than ram size for calculating cxl range

2023-10-19 Thread Michael S. Tsirkin
From: Ani Sinha pc_get_device_memory_range() finds the device memory size by calculating the difference between maxram and ram sizes. This calculation makes sense only when maxram is greater than the ram size. Make sure we check for that before calling pc_get_device_memory_range(). Signed-off-by

[PULL v2 65/78] hw/isa/piix: Implement multi-process QEMU support also for PIIX4

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow So far multi-process QEMU was only implemented for PIIX3. Move the support into the base class to achieve feature parity between both device models. Signed-off-by: Bernhard Beschow Message-Id: <20231007123843.127151-29-shen...@gmail.com> Reviewed-by: Michael S. Tsirkin S

[PULL v2 40/78] hw/i386/pc_piix: Assign PIIX3's ISA interrupts before its realize()

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow Unlike its PIIX4 counterpart, TYPE_PIIX3_DEVICE doesn't instantiate a PIC itself. Instead, it relies on the board to do so. This means that the board needs to wire the ISA IRQs to the PIIX3 device model. As long as the board assigns the ISA IRQs after PIIX3's realize(), int

[PULL v2 42/78] hw/i386/pc_piix: Wire PIIX3's ISA interrupts by new "isa-irqs" property

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow Avoid assigning the private member of struct PIIX3State from outside which goes against best QOM practices. Instead, implement best QOM practice by adding an "isa-irqs" array property to TYPE_PIIX3_DEVICE and assign it in board code, i.e. from outside. Signed-off-by: Bernh

[PATCH 2/7] target/arm: Use tcg_gen_ext_i64

2023-10-19 Thread Richard Henderson
The ext_and_shift_reg helper does this plus a shift. The non-zero check for shift count is duplicate to the one done within tcg_gen_shli_i64. Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 37 ++ 1 file changed, 2 insertions(+), 35 deletions

[PULL v2 12/78] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 core count test

2023-10-19 Thread Michael S. Tsirkin
From: Zhao Liu Following the guidelines in tests/qtest/bios-tables-test.c, this is step 1 - 3. List the ACPI tables that will be added to test the type 4 core count field. Signed-off-by: Zhao Liu Message-Id: <20230928125943.1816922-6-zhao1@linux.intel.com> Reviewed-by: Michael S. Tsirkin

[PULL v2 69/78] vhost-user-scsi: support reconnect to backend

2023-10-19 Thread Michael S. Tsirkin
From: Li Feng If the backend crashes and restarts, the device is broken. This patch adds reconnect for vhost-user-scsi. This patch also improves the error messages, and reports some silent errors. Tested with spdk backend. Signed-off-by: Li Feng Message-Id: <20231009044735.941655-4-fen...@sma

[PULL v2 24/78] vhost-user: strip superfluous whitespace

2023-10-19 Thread Michael S. Tsirkin
From: Laszlo Ersek Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek Reviewed-by: Stefano Garzarella Reviewed-by: Philippe Mathieu-Daudé Tested-by: Albert Estev

[PULL v2 63/78] hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in PIIX4

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow Speeds up PIIX4 which resolves an old TODO. Also makes PIIX4 compatible with Xen which relies on pci_bus_fire_intx_routing_notifier() to be fired. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20231007123843.127151-27-shen...@gmail.com> Sig

[PULL v2 06/78] vhost: Expose vhost_svq_available_slots()

2023-10-19 Thread Michael S. Tsirkin
From: Hawkins Jiawei Next patches in this series will delay the polling and checking of buffers until either the SVQ is full or control commands shadow buffers are full, no longer perform an immediate poll and check of the device's used buffers for each CVQ state load command. To achieve this, t

<    1   2   3   4   5   6   7   >