Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-05-06 Thread Maciej S. Szmigiero
On 29.04.2024 17:09, Peter Xu wrote: On Fri, Apr 26, 2024 at 07:34:09PM +0200, Maciej S. Szmigiero wrote: On 24.04.2024 00:35, Peter Xu wrote: On Wed, Apr 24, 2024 at 12:25:08AM +0200, Maciej S. Szmigiero wrote: On 24.04.2024 00:20, Peter Xu wrote: On Tue, Apr 23, 2024 at 06:15:35PM +0200

Re: [PATCH RFC 23/26] migration/multifd: Device state transfer support - send side

2024-05-06 Thread Maciej S. Szmigiero
On 29.04.2024 22:04, Peter Xu wrote: On Tue, Apr 16, 2024 at 04:43:02PM +0200, Maciej S. Szmigiero wrote: +bool multifd_queue_page(RAMBlock *block, ram_addr_t offset) +{ +g_autoptr(GMutexLocker) locker = NULL; + +/* + * Device state submissions for shared channels can come

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-26 Thread Maciej S. Szmigiero
On 24.04.2024 00:27, Peter Xu wrote: On Tue, Apr 23, 2024 at 06:14:18PM +0200, Maciej S. Szmigiero wrote: We don't lose any genericity since by default the transfer is done via mixed RAM / device state multifd channels from a shared pool. It's only when x-multifd-channels-device-state is set

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-26 Thread Maciej S. Szmigiero
On 24.04.2024 00:35, Peter Xu wrote: On Wed, Apr 24, 2024 at 12:25:08AM +0200, Maciej S. Szmigiero wrote: On 24.04.2024 00:20, Peter Xu wrote: On Tue, Apr 23, 2024 at 06:15:35PM +0200, Maciej S. Szmigiero wrote: On 19.04.2024 17:31, Peter Xu wrote: On Fri, Apr 19, 2024 at 11:07:21AM +0100

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-23 Thread Maciej S. Szmigiero
On 24.04.2024 00:20, Peter Xu wrote: On Tue, Apr 23, 2024 at 06:15:35PM +0200, Maciej S. Szmigiero wrote: On 19.04.2024 17:31, Peter Xu wrote: On Fri, Apr 19, 2024 at 11:07:21AM +0100, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 04:02:49PM -0400, Peter Xu wrote: On Thu, Apr 18, 2024

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-23 Thread Maciej S. Szmigiero
On 19.04.2024 17:31, Peter Xu wrote: On Fri, Apr 19, 2024 at 11:07:21AM +0100, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 04:02:49PM -0400, Peter Xu wrote: On Thu, Apr 18, 2024 at 08:14:15PM +0200, Maciej S. Szmigiero wrote: I think one of the reasons for these results is that mixed

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-23 Thread Maciej S. Szmigiero
On 18.04.2024 22:02, Peter Xu wrote: On Thu, Apr 18, 2024 at 08:14:15PM +0200, Maciej S. Szmigiero wrote: On 18.04.2024 12:39, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 11:50:12AM +0200, Maciej S. Szmigiero wrote: On 17.04.2024 18:35, Daniel P. Berrangé wrote: On Wed, Apr 17, 2024

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-18 Thread Maciej S. Szmigiero
On 18.04.2024 12:39, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 11:50:12AM +0200, Maciej S. Szmigiero wrote: On 17.04.2024 18:35, Daniel P. Berrangé wrote: On Wed, Apr 17, 2024 at 02:11:37PM +0200, Maciej S. Szmigiero wrote: On 17.04.2024 10:36, Daniel P. Berrangé wrote: On Tue, Apr

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-18 Thread Maciej S. Szmigiero
On 17.04.2024 18:35, Daniel P. Berrangé wrote: On Wed, Apr 17, 2024 at 02:11:37PM +0200, Maciej S. Szmigiero wrote: On 17.04.2024 10:36, Daniel P. Berrangé wrote: On Tue, Apr 16, 2024 at 04:42:39PM +0200, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" VFIO device stat

Re: [PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-17 Thread Maciej S. Szmigiero
On 17.04.2024 10:36, Daniel P. Berrangé wrote: On Tue, Apr 16, 2024 at 04:42:39PM +0200, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" VFIO device state transfer is currently done via the main migration channel. This means that transfers from multiple VFIO device

[PATCH RFC 18/26] migration: Add load_finish handler and associated functions

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" load_finish SaveVMHandler allows migration code to poll whether a device-specific asynchronous device state loading operation had finished. In order to avoid calling this handler needlessly the device is supposed to notify the migration code of its possible

[PATCH RFC 07/26] migration/postcopy: pass PostcopyPChannelConnectData when connecting sending preempt socket

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This will allow passing additional parameters there in the future. Signed-off-by: Maciej S. Szmigiero --- migration/postcopy-ram.c | 68 +++- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/migration/post

[PATCH RFC 24/26] migration/multifd: Add migration_has_device_state_support()

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Since device state transfer via multifd channels requires multifd channels with migration channel header and is currently not compatible with multifd compression add an appropriate query function so device can learn whether it can actually make use of it.

[PATCH RFC 15/26] migration/multifd: Zero p->flags before starting filling a packet

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This way there aren't stale flags there. p->flags can't contain SYNC to be sent at the next RAM packet since syncs are now handled separately in multifd_send_thread. Signed-off-by: Maciej S. Szmigiero --- migration/multifd.c | 2 +- 1 file changed

[PATCH RFC 26/26] vfio/migration: Multifd device state transfer support - send side

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Implement the multifd device state transfer via additional per-device thread spawned from save_live_complete_precopy_async handler. Switch between doing the data transfer in the new handler and doing it in the old save_state handler

[PATCH RFC 19/26] migration: Add x-multifd-channels-device-state parameter

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This parameter allows specifying how many multifd channels are dedicated to sending device state in parallel. It is ignored on the receive side. Signed-off-by: Maciej S. Szmigiero --- migration/migration-hmp-cmds.c | 7 + migration/options.c

[PATCH RFC 22/26] migration/multifd: Convert multifd_send_pages::next_channel to atomic

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This is necessary for multifd_send_pages() to be able to be called from multiple threads. Signed-off-by: Maciej S. Szmigiero --- migration/multifd.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/multifd.c b/migration

[PATCH RFC 23/26] migration/multifd: Device state transfer support - send side

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" A new function multifd_queue_device_state() is provided for device to queue its state for transmission via a multifd channel. Signed-off-by: Maciej S. Szmigiero --- include/migration/misc.h | 4 + migration/multifd-zlib.c | 2 +- migration/multifd-zs

[PATCH RFC 08/26] migration: Allow passing migration header in migration channel creation

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Signed-off-by: Avihai Horon [MSS: Rewrite using MFDSendChannelConnectData/PostcopyPChannelConnectData] Signed-off-by: Maciej S. Szmigiero --- migration/multifd.c | 14 -- migration/postcopy-ram.c | 14 -- 2 files changed, 24 insertions(+), 4

[PATCH RFC 20/26] migration: Add MULTIFD_DEVICE_STATE migration channel type

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Signed-off-by: Maciej S. Szmigiero --- migration/channel.h | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/channel.h b/migration/channel.h index 4232ee649939..b985c952550d 100644 --- a/migration/channel.h +++ b/migration/channel.h @@ -

[PATCH RFC 02/26] migration: Add migration channel header send/receive

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Add functions to send and receive migration channel header. Signed-off-by: Avihai Horon [MSS: Mark MigChannelHeader as packed, remove device id from it] Signed-off-by: Maciej S. Szmigiero --- migration/channel.c| 59 ++ migration

[PATCH RFC 21/26] migration/multifd: Device state transfer support - receive side

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add a basic support for receiving device state via multifd channels - both dedicated ones or shared with RAM transfer. To differentiate between a device state and a RAM packet the packet header is read first. Depending whether MULTIFD_FLAG_DEVICE_

[PATCH RFC 14/26] migration/ram: Add load start trace event

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" There's a RAM load complete trace event but there wasn't its start equivalent. Signed-off-by: Maciej S. Szmigiero --- migration/ram.c| 1 + migration/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/migration/ram.c b/migration/r

[PATCH RFC 00/26] Multifd  device state transfer support with VFIO consumer

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" VFIO device state transfer is currently done via the main migration channel. This means that transfers from multiple VFIO devices are done sequentially and via just a single common migration channel. Such way of transferring VFIO device state migration da

[PATCH RFC 12/26] migration: Enable x-channel-header pseudo-capability

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Now that migration channel header has been implemented, enable it. Signed-off-by: Avihai Horon Signed-off-by: Maciej S. Szmigiero --- migration/options.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/options.c b/migration/options.c index abb5b485badd

[PATCH RFC 09/26] migration: Add send/receive header for postcopy preempt channel

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Add send and receive migration channel header for postcopy preempt channel. Signed-off-by: Avihai Horon [MSS: Adapt to rewritten migration header passing commit] Signed-off-by: Maciej S. Szmigiero --- migration/channel.h | 1 + migration/migration.c| 5

[PATCH RFC 16/26] migration: Add save_live_complete_precopy_async{, wait} handlers

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" These SaveVMHandlers allow device to provide its own asynchronous transmission of the remaining data at the end of a precopy phase. The save_live_complete_precopy_async handler is supposed to start such transmission (for example, by launching appropria

[PATCH RFC 25/26] vfio/migration: Multifd device state transfer support - receive side

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" The multifd received data needs to be reassembled since device state packets sent via different multifd channels can arrive out-of-order. Therefore, each VFIO device state packet carries a header indicating its position in the stream. The last such VFIO de

[PATCH RFC 10/26] migration: Add send/receive header for multifd channel

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Add send and receive migration channel header for multifd channel. Signed-off-by: Avihai Horon [MSS: Adapt to rewritten migration header passing commit] Signed-off-by: Maciej S. Szmigiero --- migration/channel.h | 1 + migration/migration.c | 16

[PATCH RFC 11/26] migration/options: Mapped-ram is not channel header compatible

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Mapped-ram is only available for multifd migration without channel header - add an appropriate check to migration options. Signed-off-by: Maciej S. Szmigiero --- migration/options.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/migration/o

[PATCH RFC 17/26] migration: Add qemu_loadvm_load_state_buffer() and its handler

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" qemu_loadvm_load_state_buffer() and its load_state_buffer SaveVMHandler allow providing device state buffer to explicitly specified device via its idstr and instance id. Signed-off-by: Maciej S. Szmigiero --- include/migration/regis

[PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability

2024-04-16 Thread Maciej S. Szmigiero
. The following patches will add the actual functionality, after which it will be enabled.. Signed-off-by: Avihai Horon Signed-off-by: Maciej S. Szmigiero --- hw/core/machine.c | 1 + migration/migration.h | 3 +++ migration/options.c | 9 + migration/options.h | 1 + 4 files changed

[PATCH RFC 13/26] vfio/migration: Add save_{iterate, complete_precopy}_started trace events

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This way both the start and end points of migrating a particular VFIO device are known. Add also a vfio_save_iterate_empty_hit trace event so it is known when there's no more data to send for that device. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/m

[PATCH RFC 04/26] multifd: change multifd_new_send_channel_create() param type

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This function is called only with MultiFDSendParams type param so use this type explicitly instead of using an opaque pointer. Signed-off-by: Maciej S. Szmigiero --- migration/multifd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH RFC 06/26] multifd: pass MFDSendChannelConnectData when connecting sending socket

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This will allow passing additional parameters there in the future. Signed-off-by: Maciej S. Szmigiero --- migration/file.c| 5 ++- migration/multifd.c | 95 ++--- migration/multifd.h | 4 +- 3 files c

[PATCH RFC 03/26] migration: Add send/receive header for main channel

2024-04-16 Thread Maciej S. Szmigiero
From: Avihai Horon Add send and receive migration channel header for main channel. Signed-off-by: Avihai Horon [MSS: Rename main channel -> default channel where it matches the current term] Signed-off-by: Maciej S. Szmigiero --- migration/channel.c | 9 + migration/migration.c |

[PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_send_channel_create()

2024-04-16 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Makes managing the memory easier. Signed-off-by: Maciej S. Szmigiero --- migration/multifd.c | 2 +- migration/postcopy-ram.c | 2 +- migration/socket.c | 6 -- migration/socket.h | 3 ++- 4 files changed, 8 insertions(+), 5 deletion

[PULL 1/3] hv-balloon: avoid alloca() usage

2024-03-08 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" alloca() is frowned upon, replace it with g_malloc0() + g_autofree. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon.c | 10 -- 1 file changed, 4 insertions(+), 6

[PULL 3/3] vmbus: Print a warning when enabled without the recommended set of features

2024-03-08 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Some Windows versions crash at boot or fail to enable the VMBus device if they don't see the expected set of Hyper-V features (enlightenments). Since this provides poor user experience let's warn user if the VMBus device is enabled without the recom

[PULL 0/3] Hyper-V Dynamic Memory and VMBus misc small patches

2024-03-08 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" The following changes since commit 8f6330a807f2642dc2a3cdf33347aa28a4c00a87: Merge tag 'pull-maintainer-updates-060324-1' of https://gitlab.com/stsquad/qemu into staging (2024-03-06 16:56:20 +) are available in the Git repository at: https://

[PULL 2/3] hv-balloon: define dm_hot_add_with_region to avoid Coverity warning

2024-03-08 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Since the presence of a hot add memory region is optional in hot add request message it wasn't part of this message declaration (struct dm_hot_add). Instead, the code allocated such enlarged message by simply adding the necessary size for this extra field t

Re: [PATCH] vmbus: Print a warning when enabled without the recommended set of features

2024-02-29 Thread Maciej S. Szmigiero
On 25.01.2024 17:19, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Some Windows versions crash at boot or fail to enable the VMBus device if they don't see the expected set of Hyper-V features (enlightenments). Since this provides poor user experience let's warn user if

[PATCH] vmbus: Print a warning when enabled without the recommended set of features

2024-01-25 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Some Windows versions crash at boot or fail to enable the VMBus device if they don't see the expected set of Hyper-V features (enlightenments). Since this provides poor user experience let's warn user if the VMBus device is enabled without the recom

Re: [PATCH v1 0/2] memory-device: reintroduce memory region size check

2024-01-22 Thread Maciej S. Szmigiero
that check in the first place. Cc: "Maciej S. Szmigiero" Cc: Mario Casquero Cc: Igor Mammedov Cc: Xiao Guangrong David Hildenbrand (2): hv-balloon: use get_min_alignment() to express 32 GiB alignment memory-device: reintroduce memory region size check hw/hyperv/hv-ball

Re: [PATCH 2/5] vmbus: Switch bus reset to 3-phase-reset

2024-01-22 Thread Maciej S. Szmigiero
-off-by: Peter Maydell --- Acked-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH trivial 15/21] include/hw/hyperv/dynmem-proto.h: spelling fix: nunber

2023-11-14 Thread Maciej S. Szmigiero
On 14.11.2023 17:58, Michael Tokarev wrote: Fixes: 4f80cd2f033e "Add Hyper-V Dynamic Memory Protocol definitions" Cc: Maciej S. Szmigiero Signed-off-by: Michael Tokarev --- Acked-by: Maciej S. Szmigiero Thanks, Maciej

[PATCH] hv-balloon: define dm_hot_add_with_region to avoid Coverity warning

2023-11-13 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Since the presence of a hot add memory region is optional in hot add request message it wasn't part of this message declaration (struct dm_hot_add). Instead, the code allocated such enlarged message by simply adding the necessary size for this extra field t

Re: [PATCH] hv-balloon: avoid alloca() usage

2023-11-13 Thread Maciej S. Szmigiero
On 13.11.2023 09:59, David Hildenbrand wrote: On 09.11.23 17:02, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" alloca() is frowned upon, replace it with g_malloc0() + g_autofree. Reviewed-by: David Hildenbrand If this fixes a coverity issue of #number, we usuall

[PATCH] hv-balloon: avoid alloca() usage

2023-11-09 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" alloca() is frowned upon, replace it with g_malloc0() + g_autofree. Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/hyperv/hv-balloon.c b/hw/hyperv/hv-ballo

Re: [PULL 06/10] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support

2023-11-09 Thread Maciej S. Szmigiero
On 9.11.2023 15:51, Peter Maydell wrote: On Mon, 6 Nov 2023 at 14:23, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" One of advantages of using this protocol over ACPI-based PC DIMM hotplug is that it allows hot-adding memory in much smaller granularity because the ACPI

[PULL 10/10] MAINTAINERS: Add an entry for Hyper-V Dynamic Memory Protocol

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8e8a7d5be5de..d4a480ce5a62 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2656,6 +26

[PULL 04/10] Add Hyper-V Dynamic Memory Protocol definitions

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This commit adds Hyper-V Dynamic Memory Protocol definitions, taken from hv_balloon Linux kernel driver, adapted to the QEMU coding style and definitions. Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- include/hw/hyperv/dynmem-pro

[PULL 05/10] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) base

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This driver is like virtio-balloon on steroids: it allows both changing the guest memory allocation via ballooning and (in the next patch) inserting pieces of extra RAM into it on demand from a provided memory backend. The actual resizing is done via

[PULL 07/10] qapi: Add query-memory-devices support to hv-balloon

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the driver to report its provided memory state information. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Acked-by: Markus Armbruster Signed-off-by: Maciej S. Szmigiero --- hw/core/machine-hmp-cmds.c | 15 +++ hw

[PULL 00/10] Hyper-V Dynamic Memory Protocol driver (hv-balloon) pull req fixed

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Hi Stefan, Fixed the CI pipeline issues with yesterday's pull request, and: the following changes since commit d762bf97931b58839316b68a570eecc6143c9e3e: Merge tag 'pull-target-arm-20231102' of https://git.linaro.org/people/pmaydell/qemu-arm into stagin

[PULL 02/10] Revert "hw/virtio/virtio-pmem: Replace impossible check by assertion"

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This reverts commit 5960f254dbb46f0c7a9f5f44bf4d27c19c34cb97 since the previous commit made this situation possible again. Signed-off-by: Maciej S. Szmigiero --- hw/virtio/virtio-pmem.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PULL 06/10] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" One of advantages of using this protocol over ACPI-based PC DIMM hotplug is that it allows hot-adding memory in much smaller granularity because the ACPI DIMM slot limit does not apply. In order to enable this functionality a new memory backend needs to

[PULL 01/10] memory-device: Support empty memory devices

2023-11-06 Thread Maciej S. Szmigiero
From: David Hildenbrand Let's support empty memory devices -- memory devices that don't have a memory device region in the current configuration. hv-balloon with an optional memdev is the primary use case. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory

[PULL 08/10] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon-stub.c | 19 hw/hyperv/hv-balloon.c | 30 +- hw/hyperv/m

[PULL 09/10] hw/i386/pc: Support hv-balloon

2023-11-06 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add the necessary plumbing for the hv-balloon driver to the PC machine. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/i386/Kconfig | 1 + hw/i386/pc.c| 22 ++ 2 fil

[PULL 03/10] memory-device: Drop size alignment check

2023-11-06 Thread Maciej S. Szmigiero
From: David Hildenbrand There is no strong requirement that the size has to be multiples of the requested alignment, let's drop it. This is a preparation for hv-baloon. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-device.c | 6 -- 1 file changed

Re: [PULL 0/9] Hyper-V Dynamic Memory Protocol driver (hv-balloon)

2023-11-06 Thread Maciej S. Szmigiero
On 6.11.2023 02:33, Stefan Hajnoczi wrote: On Sun, 5 Nov 2023 at 19:49, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" The following changes since commit d762bf97931b58839316b68a570eecc6143c9e3e: Merge tag 'pull-target-arm-20231102' of https://git.linaro.org/peopl

[PULL 3/9] Add Hyper-V Dynamic Memory Protocol definitions

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This commit adds Hyper-V Dynamic Memory Protocol definitions, taken from hv_balloon Linux kernel driver, adapted to the QEMU coding style and definitions. Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- include/hw/hyperv/dynmem-pro

[PULL 8/9] hw/i386/pc: Support hv-balloon

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add the necessary plumbing for the hv-balloon driver to the PC machine. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/i386/Kconfig | 1 + hw/i386/pc.c| 22 ++ 2 fil

[PULL 9/9] MAINTAINERS: Add an entry for Hyper-V Dynamic Memory Protocol

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8e8a7d5be5de..d4a480ce5a62 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2656,6 +26

[PULL 6/9] qapi: Add query-memory-devices support to hv-balloon

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the driver to report its provided memory state information. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Acked-by: Markus Armbruster Signed-off-by: Maciej S. Szmigiero --- hw/core/machine-hmp-cmds.c | 15 +++ hw

[PULL 7/9] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon.c | 30 +++- monitor/monitor.c | 1 + qapi/machine.json

[PULL 1/9] memory-device: Support empty memory devices

2023-11-05 Thread Maciej S. Szmigiero
From: David Hildenbrand Let's support empty memory devices -- memory devices that don't have a memory device region in the current configuration. hv-balloon with an optional memdev is the primary use case. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory

[PULL 2/9] memory-device: Drop size alignment check

2023-11-05 Thread Maciej S. Szmigiero
From: David Hildenbrand There is no strong requirement that the size has to be multiples of the requested alignment, let's drop it. This is a preparation for hv-baloon. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-device.c | 6 -- 1 file changed

[PULL 5/9] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" One of advantages of using this protocol over ACPI-based PC DIMM hotplug is that it allows hot-adding memory in much smaller granularity because the ACPI DIMM slot limit does not apply. In order to enable this functionality a new memory backend needs to

[PULL 0/9] Hyper-V Dynamic Memory Protocol driver (hv-balloon)

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" The following changes since commit d762bf97931b58839316b68a570eecc6143c9e3e: Merge tag 'pull-target-arm-20231102' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2023-11-03 10:04:12 +0800) are available in the Git repository at

[PULL 4/9] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) base

2023-11-05 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This driver is like virtio-balloon on steroids: it allows both changing the guest memory allocation via ballooning and (in the next patch) inserting pieces of extra RAM into it on demand from a provided memory backend. The actual resizing is done via

Re: [PATCH v8 0/9] Hyper-V Dynamic Memory Protocol driver (hv-balloon )

2023-11-02 Thread Maciej S. Szmigiero
On 2.11.2023 14:50, David Hildenbrand wrote: On 23.10.23 19:24, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" This is a continuation of the v7 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1693240836.git.maciej.szmigi...@oracle.com/ I skimmed

Re: [PATCH] hyperv: add check for NULL for msg

2023-10-26 Thread Maciej S. Szmigiero
On 26.10.2023 11:31, Анастасия Любимова wrote: 28/09/23 19:18, Maciej S. Szmigiero пишет: On 28.09.2023 15:25, Anastasia Belova wrote: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center

Re: [PATCH v1] virtio-mem: fix division by zero in virtio_mem_activate_memslots_to_plug()

2023-10-23 Thread Maciej S. Szmigiero
9b1ee464 ("virtio-mem: Expose device memory dynamically via multiple memslots if enabled") Cc: Michael S. Tsirkin Cc: Maciej S. Szmigiero Signed-off-by: David Hildenbrand --- Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

[PATCH v8 5/9] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) hot-add support

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" One of advantages of using this protocol over ACPI-based PC DIMM hotplug is that it allows hot-adding memory in much smaller granularity because the ACPI DIMM slot limit does not apply. In order to enable this functionality a new memory backend needs to

[PATCH v8 6/9] qapi: Add query-memory-devices support to hv-balloon

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the driver to report its provided memory state information. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Acked-by: Markus Armbruster Signed-off-by: Maciej S. Szmigiero --- hw/core/machine-hmp-cmds.c | 15 +++ hw

[PATCH v8 9/9] MAINTAINERS: Add an entry for Hyper-V Dynamic Memory Protocol

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Signed-off-by: Maciej S. Szmigiero --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9bd4fe378d46..6cab87700f82 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2602,6 +2602,14 @@ F: hw/usb/canokey.c

[PATCH v8 3/9] Add Hyper-V Dynamic Memory Protocol definitions

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This commit adds Hyper-V Dynamic Memory Protocol definitions, taken from hv_balloon Linux kernel driver, adapted to the QEMU coding style and definitions. Acked-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- include/hw/hyperv/dynmem-pro

[PATCH v8 2/9] memory-device: Drop size alignment check

2023-10-23 Thread Maciej S. Szmigiero
From: David Hildenbrand There is no strong requirement that the size has to be multiples of the requested alignment, let's drop it. This is a preparation for hv-baloon. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-device.c | 6 -- 1 file changed

[PATCH v8 0/9] Hyper-V Dynamic Memory Protocol driver (hv-balloon ️)

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This is a continuation of the v7 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1693240836.git.maciej.szmigi...@oracle.com/ Changes from v7: * Rebase onto the current QEMU git master now that the David's memslots patch series

[PATCH v8 4/9] Add Hyper-V Dynamic Memory Protocol driver (hv-balloon) base

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This driver is like virtio-balloon on steroids: it allows both changing the guest memory allocation via ballooning and (in the next patch) inserting pieces of extra RAM into it on demand from a provided memory backend. The actual resizing is done via

[PATCH v8 8/9] hw/i386/pc: Support hv-balloon

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add the necessary plumbing for the hv-balloon driver to the PC machine. Co-developed-by: David Hildenbrand Reviewed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/i386/Kconfig | 1 + hw/i386/pc.c| 22 ++ 2 fil

[PATCH v8 1/9] memory-device: Support empty memory devices

2023-10-23 Thread Maciej S. Szmigiero
From: David Hildenbrand Let's support empty memory devices -- memory devices that don't have a memory device region in the current configuration. hv-balloon with an optional memdev is the primary use case. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory

[PATCH v8 7/9] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command

2023-10-23 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/hv-balloon.c | 30 +++- monitor/monitor.c | 1 + qapi/machine.json

Re: [PATCH v7 0/7] Hyper-V Dynamic Memory Protocol driver (hv-balloon )

2023-10-18 Thread Maciej S. Szmigiero
On 18.10.2023 10:00, David Hildenbrand wrote: On 28.08.23 18:48, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" This is a continuation of the v6 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1689786474.git.maciej.szmigi...@oracle.com/ Chang

Re: [PATCH v4 16/18] virtio-mem: Expose device memory dynamically via multiple memslots if enabled

2023-09-30 Thread Maciej S. Szmigiero
d Hildenbrand --- The changes seem reasonable, so: Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v4 15/18] virtio-mem: Update state to match bitmap as soon as it's been migrated

2023-09-30 Thread Maciej S. Szmigiero
ion_id) return -EBUSY; } } -return 0; + +post_load_bitmap: +/* Finally, update any other state to be consistent with the new bitmap. */ +return virtio_mem_post_load_bitmap(vmem); } typedef struct VirtIOMEMMigSanityChecks { Reviewed-by: Maciej S. Szm

Re: [PATCH v4 14/18] virtio-mem: Pass non-const VirtIOMEM via virtio_mem_range_cb

2023-09-28 Thread Maciej S. Szmigiero
ic int virtio_mem_prealloc_range_cb(VirtIOMEM *vmem, void *arg, uint64_t offset, uint64_t size) { void *area = memory_region_get_ram_ptr(>memdev->mr) + offset; Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Maciej S. Szmigiero
On 28.09.2023 18:56, Alex Bennée wrote: Anastasia Belova writes: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hyperv: process

Re: [PATCH] hyperv: add check for NULL for msg

2023-09-28 Thread Maciej S. Szmigiero
On 28.09.2023 15:25, Anastasia Belova wrote: cpu_physical_memory_map may return NULL in hyperv_hcall_post_message. Add check for NULL to avoid NULL-dereference. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 76036a5fc7 ("hyperv: process POST_MESSAGE hypercall")

Re: [PATCH v7 6/7] qapi: Add HV_BALLOON_STATUS_REPORT event and its QMP query command

2023-09-25 Thread Maciej S. Szmigiero
On 25.09.2023 13:49, Markus Armbruster wrote: "Maciej S. Szmigiero" writes: From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Signed-off-by: Maciej S. Szmigiero [...] static void hv_balloon_handle_unballoo

Re: [PATCH v3 14/16] virtio-mem: Expose device memory via multiple memslots if enabled

2023-09-17 Thread Maciej S. Szmigiero
memslot metadata is no longer an issue, we could simply stop optimizing for that. Migration source and destination can differ on the setting of "multiple-memslots". Signed-off-by: David Hildenbrand --- Reviewed-by: Maciej S. Szmigiero Hope this patch was well-tested, especially on corn

Re: [PATCH v3 12/16] memory-device, vhost: Support automatic decision on the number of memslots

2023-09-17 Thread Maciej S. Szmigiero
t to make it any worse.So let's keep it simple and simply reject plugging such vhost devices in such a configuration. Eventually, all vhost devices that want to be fully compatible with such memory devices should support a decent number of memslots (>= 509). Signed-off-by: David Hildenbrand --- Re

Re: [PATCH v3 09/16] memory-device, vhost: Support memory devices that dynamically consume memslots

2023-09-16 Thread Maciej S. Szmigiero
. Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 13/16] memory: Clarify mapping requirements for RamDiscardManager

2023-09-16 Thread Maciej S. Szmigiero
), remove the check in memory_region_get_ram_discard_manager() and clarify the doc. Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 11/16] vhost: Add vhost_get_max_memslots()

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: Let's add vhost_get_max_memslots(). Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 10/16] kvm: Add stub for kvm_get_max_memslots()

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We'll need the stub soon from memory device context. While at it, use "unsigned int" as return value and place the declaration next to kvm_get_free_memslots(). Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 08/16] memory-device: Track required and actually used memslots in DeviceMemoryState

2023-09-16 Thread Maciej S. Szmigiero
ce for our device memory and register a memory listener (add/remove) for that address space. Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

Re: [PATCH v3 07/16] stubs: Rename qmp_memory_device.c to memory_device.c

2023-09-16 Thread Maciej S. Szmigiero
On 8.09.2023 16:21, David Hildenbrand wrote: We want to place non-qmp stubs in there, so let's rename it. While at it, put it into the MAINTAINERS file under "Memory devices". Signed-off-by: David Hildenbrand Reviewed-by: Maciej S. Szmigiero Thanks, Maciej

  1   2   3   >