OSDN Git Service

vfio: convert to 128 bit arithmetic calculations when adding mem regions
authorBandan Das <bsd@redhat.com>
Thu, 24 Mar 2016 00:37:25 +0000 (20:37 -0400)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 28 Mar 2016 19:27:49 +0000 (13:27 -0600)
commit55efcc537d330f1659d3fa171a66eebc9327e91b
tree840c60f0b1c31235584f3fe827ebe9987f96df8d
parentb68a80139e37e806f004237e55311ebc42151434
vfio: convert to 128 bit arithmetic calculations when adding mem regions

vfio_listener_region_add for a iommu mr results in
an overflow assert since iommu memory region is initialized
with UINT64_MAX. Convert calculations to 128 bit arithmetic
for iommu memory regions and let int128_get64 assert for non iommu
regions if there's an overflow.

Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
[missed (end - 1) on 2nd trace call, move llsize closer to use]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/common.c