> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c > index 80e753a5ef..9abb8de9f9 100644 > --- a/hw/s390x/s390-virtio-ccw.c > +++ b/hw/s390x/s390-virtio-ccw.c > @@ -172,9 +172,10 @@ static void s390_memory_init(ram_addr_t mem_size) > name = g_strdup_printf("s390.ram"); > while (mem_size) { > MemoryRegion *ram = g_new(MemoryRegion, 1); > + unsigned long long size = mem_size; > > /* KVM does not allow memslots >= 8 TB */ > - chunk = MIN(mem_size, KVM_SLOT_MAX_BYTES); > + chunk = MIN(size, KVM_SLOT_MAX_BYTES);
directly cast inline? > memory_region_allocate_system_memory(ram, NULL, name, chunk); > memory_region_add_subregion(sysmem, offset, ram); > mem_size -= chunk; > -- Thanks, David / dhildenb