summaryrefslogtreecommitdiff
path: root/hw/misc/vfio.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-27 10:08:27 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-06-20 16:32:47 +0200
commit052e87b073cb70afcd767d32f45af2794a5a65de (patch)
treeef25073c63f9c7e2be0e2ddee46ce1524811becd /hw/misc/vfio.c
parent733d5ef52721a836b1d9b5cd0f15a41db88829d0 (diff)
downloadqemu-052e87b073cb70afcd767d32f45af2794a5a65de.tar.gz
memory: make section size a 128-bit integer
So far, the size of all regions passed to listeners could fit in 64 bits, because artificial regions (containers and aliases) are eliminated by the memory core, leaving only device regions which have reasonable sizes An IOMMU however cannot be eliminated by the memory core, and may have an artificial size, hence we may need 65 bits to represent its size. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/misc/vfio.c')
-rw-r--r--hw/misc/vfio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index 693a9ffdda..c89676b3ff 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -1953,7 +1953,7 @@ static void vfio_listener_region_add(MemoryListener *listener,
}
iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
- end = (section->offset_within_address_space + section->size) &
+ end = (section->offset_within_address_space + int128_get64(section->size)) &
TARGET_PAGE_MASK;
if (iova >= end) {
@@ -1997,7 +1997,7 @@ static void vfio_listener_region_del(MemoryListener *listener,
}
iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
- end = (section->offset_within_address_space + section->size) &
+ end = (section->offset_within_address_space + int128_get64(section->size)) &
TARGET_PAGE_MASK;
if (iova >= end) {