mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
migration: Pre-fault memory before starting background snasphot
This commit solves the issue with userfault_fd WP feature that
background snapshot is based on. For any never poluated or discarded
memory page, the UFFDIO_WRITEPROTECT ioctl() would skip updating
PTE for that page, thereby loosing WP setting for it.
So we need to pre-fault pages for each RAM block to be protected
before making a userfault_fd wr-protect ioctl().
Fixes: 278e2f551a
(migration: support
UFFD write fault processing in ram_save_iterate())
Signed-off-by: Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
Reported-by: David Hildenbrand <david@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210401092226.102804-4-andrey.gruzdev@virtuozzo.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
dgilbert:
Bodged ifdef __linux__ on ram_write_tracking_prepare, should really
go in a stub
This commit is contained in:
parent
1a8e44a89f
commit
eeccb99c9d
3 changed files with 58 additions and 0 deletions
|
@ -3827,6 +3827,14 @@ static void *bg_migration_thread(void *opaque)
|
|||
|
||||
update_iteration_initial_status(s);
|
||||
|
||||
/*
|
||||
* Prepare for tracking memory writes with UFFD-WP - populate
|
||||
* RAM pages before protecting.
|
||||
*/
|
||||
#ifdef __linux__
|
||||
ram_write_tracking_prepare();
|
||||
#endif
|
||||
|
||||
qemu_savevm_state_header(s->to_dst_file);
|
||||
qemu_savevm_state_setup(s->to_dst_file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue