• D
    cpu_physical_memory_sync_dirty_bitmap: Another alignment fix · aa777e29
    Dr. David Alan Gilbert 提交于
    This code has an optimised, word aligned version, and a boring
    unaligned version. My commit f70d3451 fixed one alignment issue, but
    there's another.
    
    The optimised version operates on 'longs' dealing with (typically) 64
    pages at a time, replacing the whole long by a 0 and counting the bits.
    If the Ramblock is less than 64bits in length that long can contain bits
    representing two different RAMBlocks, but the code will update the
    bmap belinging to the 1st RAMBlock only while having updated the total
    dirty page count for both.
    
    This probably didn't matter prior to 6b6712ef which split the dirty
    bitmap by RAMBlock, but now they're separate RAMBlocks we end up
    with a count that doesn't match the state in the bitmaps.
    
    Symptom:
      Migration showing a few dirty pages left to be sent constantly
      Seen on aarch64 and x86 with x86+ovmf
    Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
    Reported-by: NWei Huang <wei@redhat.com>
    Fixes: 6b6712efSigned-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    aa777e29
ram_addr.h 14.7 KB