The log_dirty_bitmap function in dma.c would output the wrong number of dirty pages due to the char of the bitmap being sign-extended when implicitly being converted to unsigned int for __builtin_popcount. By adding an intermediate cast to uint8_t we avoid this incorrect behaviour.
The
log_dirty_bitmap
function indma.c
would output the wrong number of dirty pages due to thechar
of the bitmap being sign-extended when implicitly being converted tounsigned int
for__builtin_popcount
. By adding an intermediate cast touint8_t
we avoid this incorrect behaviour.See https://github.com/nutanix/libvfio-user/pull/746#discussion_r1297173318.