> > > With KVM enabled it bails out with: > > > qemu-system-x86_64: kvm_set_user_memory_region: > > > KVM_SET_USER_MEMORY_REGION failed, slot=1, start=0x100000000, > > > size=0x8ff40000000: Invalid argument > > > > > I have seen this in my system but not always. Maybe I should have dug > deeper as to why i do see this all the time.
Actually this would happen only wnen I was playing with memory larger than 8 TiB. So it makes sense. I ran my script again and I can repro it right away: 2022-02-15T07:25:34.051320Z qemu-system-x86_64: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=1, start=0x100000000, size=0x8ff40000000: Invalid argument kvm_set_phys_mem: error registering slot: Invalid argument The other thing I had to do was # echo 1 > /proc/sys/vm/overcommit_memory otherwise the firse mmap() in mmap_activate() fails.