diff options
Diffstat (limited to 'hw/virtio')
-rw-r--r-- | hw/virtio/dataplane/hostmem.c | 2 | ||||
-rw-r--r-- | hw/virtio/vhost.c | 4 | ||||
-rw-r--r-- | hw/virtio/virtio-balloon.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/hw/virtio/dataplane/hostmem.c b/hw/virtio/dataplane/hostmem.c index 37292ff..7e46723 100644 --- a/hw/virtio/dataplane/hostmem.c +++ b/hw/virtio/dataplane/hostmem.c @@ -90,7 +90,7 @@ static void hostmem_append_new_region(HostMem *hostmem, hostmem->new_regions[num] = (HostMemRegion){ .host_addr = ram_ptr + section->offset_within_region, .guest_addr = section->offset_within_address_space, - .size = section->size, + .size = int128_get64(section->size), .readonly = section->readonly, }; hostmem->num_new_regions++; diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index fbabf99..baf84ea 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -81,7 +81,7 @@ static int vhost_sync_dirty_bitmap(struct vhost_dev *dev, return 0; } start_addr = section->offset_within_address_space; - end_addr = range_get_last(start_addr, section->size); + end_addr = range_get_last(start_addr, int128_get64(section->size)); start_addr = MAX(first, start_addr); end_addr = MIN(last, end_addr); @@ -379,7 +379,7 @@ static void vhost_set_memory(MemoryListener *listener, struct vhost_dev *dev = container_of(listener, struct vhost_dev, memory_listener); hwaddr start_addr = section->offset_within_address_space; - ram_addr_t size = section->size; + ram_addr_t size = int128_get64(section->size); bool log_dirty = memory_region_is_logging(section->mr); int s = offsetof(struct vhost_memory, regions) + (dev->mem->nregions + 1) * sizeof dev->mem->regions[0]; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index d669756..a27051c 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -197,7 +197,7 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq) /* FIXME: remove get_system_memory(), but how? */ section = memory_region_find(get_system_memory(), pa, 1); - if (!section.size || !memory_region_is_ram(section.mr)) + if (!int128_nz(section.size) || !memory_region_is_ram(section.mr)) continue; /* Using memory_region_get_ram_ptr is bending the rules a bit, but |