summary refs log tree commit diff stats
path: root/hw/core/machine.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2023-01-05 13:45:27 +0100
committerJuan Quintela <quintela@redhat.com>2023-02-06 19:22:56 +0100
commit59bcc049c17a50d8ac0353f164f597e7d904589d (patch)
treee22606a9fde283db4105f258baf7e610d415cc04 /hw/core/machine.c
parent7cc8e9e0fadc734065d4d5c9cb0bd8997e743146 (diff)
downloadfocaccia-qemu-59bcc049c17a50d8ac0353f164f597e7d904589d.tar.gz
focaccia-qemu-59bcc049c17a50d8ac0353f164f597e7d904589d.zip
migration/ram: Rely on used_length for uffd_change_protection()
ram_mig_ram_block_resized() will abort migration (including background
snapshots) when resizing a RAMBlock. ram_block_populate_read() will only
populate RAM up to used_length, so at least for anonymous memory
protecting everything between used_length and max_length won't
actually be protected and is just a NOP.

So let's only protect everything up to used_length.

Note: it still makes sense to register uffd-wp for max_length, such
that RAM_UF_WRITEPROTECT is independent of a changing used_length.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/core/machine.c')
0 files changed, 0 insertions, 0 deletions