[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/30] migration/ram: Rely on used_length for uffd_change_protecti
From: |
Juan Quintela |
Subject: |
[PULL 10/30] migration/ram: Rely on used_length for uffd_change_protection() |
Date: |
Tue, 7 Feb 2023 01:56:30 +0100 |
From: David Hildenbrand <david@redhat.com>
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>
---
migration/ram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/ram.c b/migration/ram.c
index efaae07dd8..a6956c9e7d 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1901,7 +1901,7 @@ int ram_write_tracking_start(void)
/* Apply UFFD write protection to the block memory range */
if (uffd_change_protection(rs->uffdio_fd, block->host,
- block->max_length, true, false)) {
+ block->used_length, true, false)) {
goto fail;
}
--
2.39.1
- [PULL 03/30] migration: Split save_live_pending() into state_pending_*, (continued)
- [PULL 03/30] migration: Split save_live_pending() into state_pending_*, Juan Quintela, 2023/02/06
- [PULL 02/30] migration: No save_live_pending() method uses the QEMUFile parameter, Juan Quintela, 2023/02/06
- [PULL 05/30] migration: simplify migration_iteration_run(), Juan Quintela, 2023/02/06
- [PULL 04/30] migration: Remove unused threshold_size parameter, Juan Quintela, 2023/02/06
- [PULL 06/30] util/userfaultfd: Add uffd_open(), Juan Quintela, 2023/02/06
- [PULL 07/30] migration/ram: Fix populate_read_range(), Juan Quintela, 2023/02/06
- [PULL 08/30] migration/ram: Fix error handling in ram_write_tracking_start(), Juan Quintela, 2023/02/06
- [PULL 09/30] migration/ram: Don't explicitly unprotect when unregistering uffd-wp, Juan Quintela, 2023/02/06
- [PULL 10/30] migration/ram: Rely on used_length for uffd_change_protection(),
Juan Quintela <=
- [PULL 11/30] migration/ram: Optimize ram_write_tracking_start() for RamDiscardManager, Juan Quintela, 2023/02/06
- [PULL 13/30] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup(), Juan Quintela, 2023/02/06
- [PULL 12/30] migration/savevm: Move more savevm handling into vmstate_save(), Juan Quintela, 2023/02/06
- [PULL 14/30] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Juan Quintela, 2023/02/06
- [PULL 16/30] migration/ram: Factor out check for advised postcopy, Juan Quintela, 2023/02/06
- [PULL 15/30] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST(), Juan Quintela, 2023/02/06
- [PULL 17/30] virtio-mem: Fail if a memory backend with "prealloc=on" is specified, Juan Quintela, 2023/02/06
- [PULL 18/30] virtio-mem: Migrate immutable properties early, Juan Quintela, 2023/02/06
- [PULL 19/30] virtio-mem: Proper support for preallocation with migration, Juan Quintela, 2023/02/06
- [PULL 20/30] migration: Show downtime during postcopy phase, Juan Quintela, 2023/02/06