diff options
author | Andrey Gruzdev | 2021-01-29 11:14:05 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert | 2021-02-08 12:19:51 +0100 |
commit | 278e2f551a095b234de74dca9c214d5502a1f72c (patch) | |
tree | 0759c7262dc70c647fcfb12fdc9905e81666b022 /include/exec | |
parent | migration: introduce UFFD-WP low-level interface helpers (diff) | |
download | qemu-278e2f551a095b234de74dca9c214d5502a1f72c.tar.gz qemu-278e2f551a095b234de74dca9c214d5502a1f72c.tar.xz qemu-278e2f551a095b234de74dca9c214d5502a1f72c.zip |
migration: support UFFD write fault processing in ram_save_iterate()
In this particular implementation the same single migration
thread is responsible for both normal linear dirty page
migration and procesing UFFD page fault events.
Processing write faults includes reading UFFD file descriptor,
finding respective RAM block and saving faulting page to
the migration stream. After page has been saved, write protection
can be removed. Since asynchronous version of qemu_put_buffer()
is expected to be used to save pages, we also have to flush
migraion stream prior to un-protecting saved memory range.
Write protection is being removed for any previously protected
memory chunk that has hit the migration stream. That's valid
for pages from linear page scan along with write fault pages.
Signed-off-by: Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210129101407.103458-4-andrey.gruzdev@virtuozzo.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
fixup pagefault.address cast for 32bit
Diffstat (limited to 'include/exec')
-rw-r--r-- | include/exec/memory.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 37096217e7..e58c09f130 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -150,6 +150,13 @@ typedef struct IOMMUTLBEvent { #define RAM_PMEM (1 << 5) +/* + * UFFDIO_WRITEPROTECT is used on this RAMBlock to + * support 'write-tracking' migration type. + * Implies ram_state->ram_wt_enabled. + */ +#define RAM_UF_WRITEPROTECT (1 << 6) + static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn, IOMMUNotifierFlag flags, hwaddr start, hwaddr end, |