Description of problem: The guest Linux cpuidle-haltpoll feature requires <hints-dedicated state='on'/>. Libvirt currently only allows hints-dedicated to be enabled when <cpu mode='host-passthrough'> is used. KVM_HINTS_REALTIME (formerly called KVM_HINTS_DEDICATED) is documented in Linux as follows: guest checks this feature bit to determine that vCPUs are never preempted for an unlimited time, allowing optimizations Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not. The original author of the libvirt code has confirmed that limiting hints-dedicate to host-passthrough is too restrictive: https://www.mail-archive.com/libvir-list@redhat.com/msg202968.html Paolo Bonzini noted that mwait behavior may be affected by hints-dedicated, but now I can't find the code that does this. How reproducible: 100% Steps to Reproduce: 1. Add <hint-dedicated state='on'/> to the domain XML without <cpu mode='host-passthrough'/> Actual results: Libvirt does not allow this. Expected results: Libvirt allows this.
Proposed patch: https://www.redhat.com/archives/libvir-list/2021-January/msg00756.html
merged upstream: https://gitlab.com/libvirt/libvirt/-/commit/c0ac0144a32b42230b06c32580d0f7cc0095cbe1
Verify this bug with libvirt-daemon-7.4.0-1.module+el8.5.0+11218+83343022.x86_64: 1. define a guest with host-model cpu mode & hint-dedicated=on # virsh dumpxml vm1 ... <features> <acpi/> <apic/> <pae/> <kvm> <hint-dedicated state='on'/> </kvm> </features> <cpu mode='host-model' check='partial'> <numa> <cell id='0' cpus='0-1' memory='524288' unit='KiB'/> <cell id='1' cpus='2-3' memory='524288' unit='KiB'/> </numa> </cpu> ... 2. start guest # virsh start vm1 Domain 'vm1' started 3. check qemu command line: # ps uax|grep qemu ... -cpu Skylake-Server-IBRS,...,kvm-hint-dedicated=on ...
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 (virt:av bug fix and enhancement update), 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-2021:4684