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

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 ---

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

[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

[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

[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

[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

[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:

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

[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

[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 +-

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, , next) { audio_init(e->dev, _fatal); } } Signed-off-by: Juan Quintela Reviewed-by: Stefan Berger ---

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

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

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

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

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)

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.

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

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

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

[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 ---

[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(+),

[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

[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' :

[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

[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

[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 +++

[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:

[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

[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

[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

[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

[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 ---

[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

[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, , next) { audio_init(e->dev, _fatal); } } Signed-off-by: Juan Quintela --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[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

[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

[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

[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 @@

[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.

[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

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

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 > >> >

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 > > >

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"

[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"

[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

[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 +++

[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 +++

[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

[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(_desc_cache); address_space_cache_destroy(_desc_cache); For some reason it's unable to

[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

[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

[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

[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().

[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

[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(),

[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:

[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

[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:

[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

[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>

[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,

[PATCH] semihosting: fix memleak at semihosting_arg_fallback

2023-10-19 Thread Matheus Tavares Bernardino
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 --- semihosting/config.c | 6 -- 1 file changed, 4

[PULL v2 48/78] hw/isa/piix3: Create IDE controller in host device

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow The IDE controller is an integral part of PIIX3 (function 1). So create it as part of the south bridge. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20231007123843.127151-12-shen...@gmail.com> Signed-off-by: Michael S. Tsirkin ---

[PULL v2 43/78] hw/i386/pc_piix: Remove redundant "piix3" variable

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow The variable is never used by its declared type. Eliminate it. Signed-off-by: Bernhard Beschow Message-Id: <20231007123843.127151-7-shen...@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_piix.c | 6 ++ 1 file changed, 2

[PULL v2 62/78] hw/isa/piix: Rename functions to be shared for PCI interrupt triggering

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow PIIX4 will get the same optimizations which are already implemented for PIIX3. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin Message-Id: <20231007123843.127151-26-shen...@gmail.com> Signed-off-by: Michael S. Tsirkin --- hw/isa/piix.c | 72

Re: [PATCH] ipmi-bt-test: force ipv4

2023-10-19 Thread Corey Minyard
On Wed, Oct 18, 2023 at 10:11:23PM +0300, Vladimir Sementsov-Ogievskiy wrote: > We open ipv4 listening socket. But "localhost" in qemu parameters may > load to Qemu trying to connect with ipv6 and fail with "Connection > refused". Force ipv4 by using ipv4 ip address. > > Signed-off-by: Vladimir

[PATCH 0/7] tcg: Expose tcg_gen_ext_{i32,i64,tl}

2023-10-19 Thread Richard Henderson
We have several copies of this function (or equivalent). Expose the one already present in tcg-op-ldst.c. Then, some target cleanups while searching for "ext8[us]". r~ Richard Henderson (7): tcg: Export tcg_gen_ext_{i32,i64,tl} target/arm: Use tcg_gen_ext_i64 target/i386: Use

[PATCH 6/7] target/tricore: Use tcg_gen_*extract_tl

2023-10-19 Thread Richard Henderson
The EXTR instructions can use the extract opcodes. Signed-off-by: Richard Henderson --- target/tricore/translate.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index dd812ec0f0..66553d1be0

[PULL v2 35/78] hw/i386/acpi-build: Remove build-time assertion on PIIX/ICH9 reset registers being identical

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow Commit 6103451aeb74 ("hw/i386: Build-time assertion on pc/q35 reset register being identical.") introduced a build-time check where the addresses of the reset registers are expected to be equal. Back then rev3 of the FADT was used which required the reset register to be

[PULL v2 14/78] tests: bios-tables-test: Add ACPI table binaries 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 5 and 6. Changes in the tables: FACP: +/* + * Intel ACPI Component Architecture + * AML/ASL+ Disassembler version 20200925 (64-bit version) + * Copyright (c) 2000 - 2020 Intel Corporation + * + *

Re: [PULL 12/54] target/riscv: deprecate the 'any' CPU type

2023-10-19 Thread Daniel Henrique Barboza
On 10/19/23 15:13, Richard Henderson wrote: On 10/11/23 21:10, Alistair Francis wrote: From: Daniel Henrique Barboza The 'any' CPU type was introduced in commit dc5bd18fa5725 ("RISC-V CPU Core Definition"), being around since the beginning. It's not an easy CPU to use: it's undocumented

[PULL v2 58/78] hw/isa/piix: Allow for optional PIT creation in PIIX3

2023-10-19 Thread Michael S. Tsirkin
From: Bernhard Beschow In the PC machine, the PIT is created in board code to allow it to be virtualized with various virtualization techniques. So explicitly disable its creation in the PC machine via a property which defaults to enabled. Once the PIIX implementations are consolidated this

[PATCH 4/7] target/m68k: Use tcg_gen_ext_i32

2023-10-19 Thread Richard Henderson
We still need to check OS_{BYTE,WORD,LONG}, because m68k includes floating point in OS_*. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c

[PULL v2 70/78] vhost-user-scsi: start vhost when guest kicks

2023-10-19 Thread Michael S. Tsirkin
From: Li Feng Let's keep the same behavior as vhost-user-blk. Some old guests kick virtqueue before setting VIRTIO_CONFIG_S_DRIVER_OK. Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz Message-Id: <20231009044735.941655-5-fen...@smartx.com> Reviewed-by: Michael S. Tsirkin Signed-off-by:

[PULL v2 00/78] virtio,pc,pci: features, cleanups

2023-10-19 Thread Michael S. Tsirkin
Changes from v1: dropped shadow vq patches The following changes since commit ec6f9f135d5e5596ab0258da2ddd048f1fd8c359: Merge tag 'migration-20231017-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-10-17 10:06:21 -0400) are available in the Git repository at:

<    1   2   3   4   5   6   7   >