Comment 7 for bug 1493049

Revision history for this message
Pavel Boldin (pboldin) wrote :

@serge-hallyn,

This patch is exactly what fixes the problem for me (was able to do around 150 successful migrations with it).

However, this should be rewritten to only contain exactly calls to tlb_flush when in TCG mode so there is no extra code and no unrelated changes.

The reason patches are different is quite reworked migration and dirtying mechanisms in new QEMU.

In exactly, new QEMU KVM has no `log_global_start' handler and the regions are to be marked as DIRTY_MEMORY_MIGRATE by the `log_start' handlers which are called only starting with the referenced patch in upstream. This call is done deeply in memory_region_transaction_commit -> address_space_update_topology -> *_pass.

Regarding the DIRTY_MEMORY_CODE, in the 2.0.0 it is used only inside the TCG-related code. Every time a TranslationBlock code is generated for a given VM code the pages of VM code are removed from TLB cache and marked as 'clean'. So, on next write to the VM code pages the TLB will be missed and the TranslationBlock will be updated accordingly.