[PATCH] tests/migration-test: Wait for cancellation sooner in multifd cancel

2024-09-20 Thread Juraj Marcin
, setting capabilities when the migration is still running leads to an error. By moving the wait before the setup, we ensure this does not happen. Cc: Peter Xu Signed-off-by: Juraj Marcin --- tests/qtest/migration-test.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff

Re: [PATCH v2 1/4] KVM: Dynamic sized kvm memslots array

2024-09-06 Thread Juraj Marcin
Hi Peter, On Thu, Sep 5, 2024 at 6:00 PM Peter Xu wrote: > > On Thu, Sep 05, 2024 at 05:32:46PM +0200, Juraj Marcin wrote: > > Hi Peter, > > Hi, Juraj, > > [...] > > > > unsigned int kvm_get_max_memslots(void) > > > { > > > KVMS

Re: [PATCH v2 1/4] KVM: Dynamic sized kvm memslots array

2024-09-05 Thread Juraj Marcin
ill initially allocate. > + */ > +if (s->nr_slots < KVM_MEMSLOTS_NR_ALLOC_DEFAULT) { > +ret = -EINVAL; > +fprintf(stderr, "KVM max supported number of slots (%d) too small\n", > +s->nr_slots); > +goto err; > +} > + > s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE); > if (s->nr_as <= 1) { > s->nr_as = 1; > diff --git a/accel/kvm/trace-events b/accel/kvm/trace-events > index 37626c1ac5..ad2ae6fca5 100644 > --- a/accel/kvm/trace-events > +++ b/accel/kvm/trace-events > @@ -36,3 +36,4 @@ kvm_io_window_exit(void) "" > kvm_run_exit_system_event(int cpu_index, uint32_t event_type) "cpu_index %d, > system_even_type %"PRIu32 > kvm_convert_memory(uint64_t start, uint64_t size, const char *msg) "start > 0x%" PRIx64 " size 0x%" PRIx64 " %s" > kvm_memory_fault(uint64_t start, uint64_t size, uint64_t flags) "start 0x%" > PRIx64 " size 0x%" PRIx64 " flags 0x%" PRIx64 > +kvm_slots_grow(unsigned int old, unsigned int new) "%u -> %u" > -- > 2.45.0 > -- Juraj Marcin

[PATCH v3 4/4] virtio-mem: Add support for suspend+wake-up with plugged memory

2024-09-04 Thread Juraj Marcin
feature is not exposed by QEMU. This patch adds the code to skip the reset on wake-up and exposes theVIRTIO_MEM_F_PERSISTENT_SUSPEND feature to the guest kernel driver when suspending is possible in QEMU (currently only x86). Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- hw

[PATCH v3 3/4] virtio-mem: Use new Resettable framework instead of LegacyReset

2024-09-04 Thread Juraj Marcin
to use the new Resettable framework and replaces qemu_[un]register_reset() calls with qemu_[un]register_resettable(). Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 38 +- include/hw/virtio/virtio-mem.h | 4

[PATCH v3 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()

2024-09-04 Thread Juraj Marcin
instead. Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand Reviewed-by: Peter Maydell --- hw/arm/aspeed.c| 4 ++-- hw/arm/mps2-tz.c | 4 ++-- hw/core/reset.c| 5 + hw/hppa/machine.c | 4 ++-- hw/i386/microvm.c | 4 ++-- hw/i386

[PATCH v3 2/4] reset: Add RESET_TYPE_WAKEUP

2024-09-04 Thread Juraj Marcin
Some devices need to distinguish cold start reset from waking up from a suspended state. This patch adds new value to the enum, and updates the i386 wakeup method to use this new reset type. Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- docs/devel/reset.rst| 11

[PATCH v3 0/4] virtio-mem: Implement support for suspend+wake-up with plugged memory

2024-09-04 Thread Juraj Marcin
VirtIOMEMClass type info Juraj Marcin (4): reset: Use ResetType for qemu_devices_reset() and MachineClass::reset() reset: Add RESET_TYPE_WAKEUP virtio-mem: Use new Resettable framework instead of LegacyReset virtio-mem: Add support for suspend+wake-up with plugged memory docs/devel/reset.rst

Re: [PATCH v2 2/4] reset: Add RESET_TYPE_WAKEUP

2024-08-28 Thread Juraj Marcin
Hi Peter, On Tue, Aug 20, 2024 at 1:56 PM Peter Maydell wrote: > > On Tue, 20 Aug 2024 at 12:40, David Hildenbrand wrote: > > > > On 14.08.24 14:32, Juraj Marcin wrote: > > > On Tue, Aug 13, 2024 at 6:37 PM Peter Maydell > > > wrote: > > >> &

Re: [PATCH v2 2/4] reset: Add RESET_TYPE_WAKEUP

2024-08-14 Thread Juraj Marcin
On Tue, Aug 13, 2024 at 6:37 PM Peter Maydell wrote: > > On Tue, 13 Aug 2024 at 16:39, Juraj Marcin wrote: > > > > Some devices need to distinguish cold start reset from waking up from a > > suspended state. This patch adds new value to the enum, and updates the >

[PATCH v2 3/4] virtio-mem: Use new Resettable framework instead of LegacyReset

2024-08-13 Thread Juraj Marcin
to use the new Resettable framework and replaces qemu_[un]register_reset() calls with qemu_[un]register_resettable(). Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 38 +- include/hw/virtio/virtio-mem.h | 4

[PATCH v2 2/4] reset: Add RESET_TYPE_WAKEUP

2024-08-13 Thread Juraj Marcin
Some devices need to distinguish cold start reset from waking up from a suspended state. This patch adds new value to the enum, and updates the i386 wakeup method to use this new reset type. Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- docs/devel/reset.rst| 8 hw

[PATCH v2 0/4] virtio-mem: Implement support for suspend+wake-up with plugged memory

2024-08-13 Thread Juraj Marcin
: - Removed unnecessary include directives changes - Updated RESET_TYPE_WAKEUP documentation - Removed unnecessary interface from VirtIOMEMClass type info Juraj Marcin (4): reset: Use ResetType for qemu_devices_reset() and MachineClass::reset() reset: Add RESET_TYPE_WAKEUP virtio-mem: Use new

[PATCH v2 4/4] virtio-mem: Add support for suspend+wake-up with plugged memory

2024-08-13 Thread Juraj Marcin
feature is not exposed by QEMU. This patch adds the code to skip the reset on wake-up and exposes theVIRTIO_MEM_F_PERSISTENT_SUSPEND feature to the guest kernel driver when suspending is possible in QEMU (currently only x86). Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand --- hw

[PATCH v2 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()

2024-08-13 Thread Juraj Marcin
instead. Signed-off-by: Juraj Marcin Reviewed-by: David Hildenbrand Reviewed-by: Peter Maydell --- hw/arm/aspeed.c| 4 ++-- hw/arm/mps2-tz.c | 4 ++-- hw/core/reset.c| 5 + hw/hppa/machine.c | 4 ++-- hw/i386/microvm.c | 4 ++-- hw/i386

Re: [PATCH 3/4] virtio-mem: Implement Resettable interface instead of using LegacyReset

2024-08-09 Thread Juraj Marcin
On Thu, Aug 8, 2024 at 5:47 PM Peter Maydell wrote: > > On Thu, 8 Aug 2024 at 13:37, David Hildenbrand wrote: > > > > On 08.08.24 14:25, Peter Maydell wrote: > > > On Tue, 6 Aug 2024 at 17:08, Juraj Marcin wrote: > > >> > > >> LegacyReset d

Re: [PATCH 2/4] reset: Add RESET_TYPE_WAKEUP

2024-08-08 Thread Juraj Marcin
On Thu, Aug 8, 2024 at 2:18 PM Peter Maydell wrote: > > On Tue, 6 Aug 2024 at 17:08, Juraj Marcin wrote: > > > > Some devices need to distinguish cold start reset from waking up from a > > suspended state. This patch adds new value to the enum, and updates the > >

Re: [PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass->reset()

2024-08-07 Thread Juraj Marcin
On Tue, Aug 6, 2024 at 6:40 PM David Hildenbrand wrote: > > On 06.08.24 18:07, Juraj Marcin wrote: > > Currently, both qemu_devices_reset() and MachineClass->reset() use > > ShutdownCause for the reason of the reset. However, the Resettable > > interface uses ResetState

[PATCH 3/4] virtio-mem: Implement Resettable interface instead of using LegacyReset

2024-08-06 Thread Juraj Marcin
list, implements the necessary methods and replaces qemu_[un]register_reset() calls with qemu_[un]register_resettable(). Signed-off-by: Juraj Marcin --- hw/virtio/virtio-mem.c | 39 ++ include/hw/virtio/virtio-mem.h | 4 2 files changed, 29 insertions

[PATCH 4/4] virtio-mem: Add support for suspend+wake-up with plugged memory

2024-08-06 Thread Juraj Marcin
feature is not exposed by QEMU. This patch adds the code to skip the reset on wake-up and exposes theVIRTIO_MEM_F_PERSISTENT_SUSPEND feature to the guest kernel driver when suspending is possible in QEMU (currently only x86). Signed-off-by: Juraj Marcin --- hw/virtio/virtio-mem.c | 10

[PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass->reset()

2024-08-06 Thread Juraj Marcin
ype instead. Signed-off-by: Juraj Marcin --- hw/arm/aspeed.c| 4 ++-- hw/arm/mps2-tz.c | 4 ++-- hw/core/reset.c| 7 ++- hw/hppa/machine.c | 4 ++-- hw/i386/microvm.c | 4 ++-- hw/i386/pc.c | 6 +++--- hw/ppc/pegasos

[PATCH 0/4] virtio-mem: Implement support for suspend+wake-up with plugged memory

2024-08-06 Thread Juraj Marcin
device can access the reset type in the hold phase. The last patch of the series implements the final support in the hold phase of the virtio-mem reset callback and exposes VIRTIO_MEM_F_PERSISTENT_SUSPEND to the kernel. [1]: https://lore.kernel.org/all/20240318120645.105664-1-da...@redhat.com/ Juraj

[PATCH 2/4] reset: Add RESET_TYPE_WAKEUP

2024-08-06 Thread Juraj Marcin
Some devices need to distinguish cold start reset from waking up from a suspended state. This patch adds new value to the enum, and updates the i386 wakeup method to use this new reset type. Signed-off-by: Juraj Marcin --- docs/devel/reset.rst| 7 +++ hw/i386/pc.c| 2