* Paolo Bonzini (pbonz...@redhat.com) wrote: > On 03/01/2018 19:33, Dr. David Alan Gilbert (git) wrote: > > 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. > > The patch is obviously correct, but would it make sense also to align > the RAMBlocks' initial ram_addr_t to a multiple of BITS_PER_LONG << > TARGET_PAGE_BITS?
Yes, I can do that as a separate patch. The alignment starts getting a little silly - say 4k target page, 64 bits long so aligning a 4k RAMBlock to 256kb boundary - but I think it's OK. Dave P.S. I'd be careful of saying 'obviously correct' given how many small fixes this function has had recently! > Thanks, > > Paolo -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK