On 2015/2/2 7:29, Paolo Bonzini wrote: > > > On 17/12/2014 07:02, haifeng....@huawei.com wrote: >> From: linhaifeng <haifeng....@huawei.com> >> >> If we create VM with two or more numa nodes qemu will create two >> or more hugepage files but qemu only send one hugepage file fd >> to vhost-user when VM's memory size is 2G and with two numa nodes. >> >> Signed-off-by: linhaifeng <haifeng....@huawei.com> > > The bug is in vhost_dev_assign_memory. It doesn't check that the file > descriptor matches when merging regions. Michael, does the merging > trigger in practice? Can we just eliminate it? > > Paolo >
qemu-system-x86_64 -name vm1 -enable-kvm -smp 2 -m 2048 -object memory-backend-file,id=mem1,size=1024M,mem-path=/dev/hugepages,share=on -object memory-backend-file,id=mem2,size=1024M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem1 -numa node,memdev=mem2 -chardev socket,id=chr0,path=/var/run/vhost-user/tap10 -netdev type=vhost-user,id=net0,chardev=chr0,vhostforce -device virtio-net-pci,netdev=net0,mac=00:00:00:00:00:01,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off -drive file=/mnt/sdc/linhf/suse11_sp3_64_0 -vnc :0 hugepage file fd=8 addr=0x7f1ea7200000 size=1073741824 hugepage file fd=9 addr=0x7f1ee7200000 size=1073741824 qemu-system-x86_64: -netdev type=vhost-user,id=net0,chardev=chr0,vhostforce: chardev "chr0" went up WARNING: Image format was not specified for '/mnt/sdc/linhf/suse11_sp3_64_0' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. reg->userspace_addr=0x7f1ea72c0000 ram_addr=0xc0000 fd=8 reg->userspace_addr=0x7f1e9ee00000 ram_addr=0x80000000 fd=-1 reg->userspace_addr=0x7f1ea7200000 ram_addr=0x0 fd=8 It seems like the second region's address is invalid(not in the hugepage's area). so we lost this region.