mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
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>
This commit is contained in:
parent
733d5ef527
commit
052e87b073
15 changed files with 85 additions and 52 deletions
|
@ -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++;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue