Description of problem: with memfd as source in memorybacking, below error message will be prompted when using <hugepages/>. Property 'memory-backend-memfd.hugetlbsize' doesn't take value '0' Version-Release number of selected component (if applicable): qemu-kvm-3.1.0-20.module+el8+2904+e658c755.x86_64 libvirt-5.0.0-6.virtcov.el8.x86_64 How reproducible: always Steps to Reproduce: 1. Add Edit /etc/default/grub --- append intel_iommu=on default_hugepagesz=2M hugepagesz=2M hugepages=2000 to GRUB_CMDLINE_LINUX line. and check in the os with mount command - hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=1024M) 2. Edit the domain and add the xml- <memoryBacking> <hugepages/> <source type='memfd'/> </memoryBackingz> 3.# virsh start avocado-vt-vm1 error: Failed to start domain avocado-vt-vm1 error: internal error: process exited while connecting to monitor: profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-virbitmap.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-virauthconfig.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-virauth.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-viraudit.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-virarptable.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-virarch.gcda:Cannot open profiling:/builddir/build/BUILD/libvirt-5.0.0/src/util/.libs/libvirt_util_la-viralloc.gcda:Cannot open 2019-03-27T05:08:46.706005Z qemu-kvm: -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=0,size=1073741824,host-nodes=0,policy=preferred: Property 'memory-backend-memfd.hugetlbsize' doesn't take value '0' Expected results: NO error. Domain can start with default hugepagesz used. Additional info: Domain can start up with below xml - <memoryBacking> <hugepages> <page size='1048576' unit='KiB'/> </hugepages> <source type='memfd'/> </memoryBackingz>
Patches posted upstream: https://www.redhat.com/archives/libvir-list/2019-April/msg00072.html BTW: there's no need to play with kernel cmdline arguments to reproduce this. Simply have a hugetlbfs mount point without "-o pagesize" and then just use <hugepages/> in the domain XML (without any page size).
I've just pushed patches uptram: 6864d8f740 qemuBuildMemoryBackendProps: Get pagesize early 465df4771a virfile: Introduce and use virFileGetDefaultHugepage 59a22be864 qemuxml2xmltest: Add memfd tests a0d53fdab9 qemuxml2xmltest: Move virObjectUnref() call 7086c835b6 qemuxml2argvdata: Drop useless spaces at the beginning of lines v5.2.0-107-g6864d8f740
Verified with libvirt-daemon-5.3.0-1.module+el8.1.0+3225+a8268fde.x86_64 and qemu-kvm-3.1.0-20.module+el8+2888+cdc893a8.x86_64 Domain with xml - <memoryBacking> <hugepages/> <source type='memfd'/> </memoryBacking> <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>SandyBridge-IBRS</model> <vendor>Intel</vendor> <feature policy='require' name='vme'/> .... <numa> <cell id='0' cpus='0-1' memory='512000' unit='KiB'/> <cell id='1' cpus='2-3' memory='512000' unit='KiB'/> </numa> </cpu> #virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started qemu command - qemu 4792 1 17 02:55 ? 00:00:37 /usr/libexec/qemu-kvm -name guest=avocado-vt-vm1,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-avocado-vt-vm1/master-key.aes -machine pc-i440fx-rhel7.6.0,accel=kvm,usb=off,dump-guest-core=off -cpu SandyBridge-IBRS,vme=on,ds=off,acpi=off,ss=on,ht=off,tm=off,pbe=off,dtes64=off,monitor=off,ds_cpl=off,smx=off,est=off,tm2=off,xtpr=off,pdcm=off,pcid=on,arat=on,tsc-deadline=off,xsave=off,avx=off,hypervisor=on,xsaveopt=on,+kvm_pv_unhalt -bios /usr/share/seabios/bios.bin -m size=1024000k,slots=16,maxmem=2560000k -overcommit mem-lock=off -smp 4,sockets=4,cores=1,threads=1 -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,size=524288000 -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 -object memory-backend-memfd,id=ram-node1,hugetlb=yes,hugetlbsize=2097152,size=524288000 -numa node,nodeid=1,cpus=2-3,memdev=ram-node1 -uuid e45f2006-36e6-4fa3-9e06-4a8137f05b98 -display none -no-user-config -nodefaults -device sga -chardev socket,id=charmonitor,fd=30,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,clock=vm,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-shutdown -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=1 -boot menu=on,reboot-timeout=0,splash-time=3000,strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -device usb-ccid,id=ua-d80aba6e-b6d8-448b-ab6e-8c7b5c29f353,bus=usb.0,port=1 -drive file=/var/lib/libvirt/images/RHEL-8.1.0-20190521.3-x86_64.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none,aio=threads -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=on,serial=f65effa5-90a6-47f2-8487-a9f64c95d4f5,werror=stop,rerror=stop -netdev tap,fds=32:33:34:35:36,id=hostnet0,vhost=on,vhostfds=37:38:39:40:41 -device virtio-net-pci,tx=bh,ioeventfd=on,event_idx=off,csum=off,gso=off,host_tso4=off,host_tso6=off,host_ecn=off,host_ufo=off,mrg_rxbuf=off,guest_csum=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,guest_ufo=off,mq=on,vectors=12,netdev=hostnet0,id=net0,mac=52:54:00:c6:3b:95,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charchannel0 -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.linux-kvm.port.1 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device ib700,id=watchdog0 -watchdog-action none -device virtio-balloon-pci,id=ua-c80aba6e-b6d8-448b-ab6e-8c7b5c29f353,bus=pci.0,addr=0xc -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -device pvpanic,ioport=1285 -msg timestamp=on
Verified with libvirt-5.5.0-2.virtcov.el8.x86_64 and qemu-kvm-4.0.0-6.module+el8.1.0+3736+a2aefea3.x86_64 Domain with xml - <memoryBacking> <hugepages/> <source type='memfd'/> </memoryBacking> .... <cpu> <numa> <cell id='0' cpus='0-3' memory='1024000' unit='KiB'/> </numa> </cpu> #virsh start avocado-vt-vm-440 Domain avocado-vt-vm-440 started ]# ps -ef |grep qemu-kvm qemu 153605 1 8 00:20 ? 01:45:21 /usr/libexec/qemu-kvm -name guest=avocado-vt-vm-440,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-avocado-vt-vm-440/master-key.aes -machine pc-i440fx-rhel7.6.0,accel=kvm,usb=off,vmport=on,dump-guest-core=off,kernel_irqchip=split -cpu qemu64,kvm_pv_unhalt=on,pmu=off -bios /usr/share/seabios/bios.bin -m size=1024000k,slots=8,maxmem=104857600k -overcommit mem-lock=off -smp 4,sockets=4,cores=1,threads=1 -object memory-backend-memfd,id=ram-node0,hugetlb=yes,hugetlbsize=2097152,size=1048576000,host-nodes=5,policy=bind -numa node,nodeid=0,cpus=0-3,memdev=ram-node0 -uuid cdb08e71-79af-4e60-896f-690424400848
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:3723