Description of problem: CNV runs libvirt with limited permissions. As a consequence libvirt does not have access to files like `/dev/cpu/0/msr` to determine the TSC frequency. A correct fallback was implemented in https://gitlab.com/libvirt/libvirt/-/issues/188 which we will need in CNV 4.9 to allow migrations with the inftsc cpu flag. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: CNV can't detect the TSC frequency correctly. Expected results: CNV can detect the TSC frequency correctly. Additional info: We need a backport of https://gitlab.com/libvirt/libvirt/-/issues/188.
Michal it would be great if we could get a backport.
The commit from upstream issue #188 is: commit 5df2c49263338da7221f24b3ad67ffd21d88047c Author: Daniel P. Berrangé <berrange> Date: Wed Aug 4 18:05:59 2021 +0100 util: directly query KVM for TSC scaling support We currently query the host MSRs to determine if TSC scaling is supported. This works OK when running privileged and can open the /dev/cpu/0/msr. When unprivileged we fallback to querying MSRs from /dev/kvm. This is incorrect because /dev/kvm only reports accurate info for MSRs that are valid to use from inside a guest. The TSC scaling support MSR is not, thus we always end up reporting lack of TSC scaling when unprivileged. The solution to this is easy, because KVM can directly report whether TSC scaling is available, which matches what QEMU will do at startup. Closes: https://gitlab.com/libvirt/libvirt/-/issues/188 Reported-by: Roman Mohr <rmohr> Reviewed-by: Michal Privoznik <mprivozn> Signed-off-by: Daniel P. Berrangé <berrange> v7.6.0-53-g5df2c49263
Preverify this bug with rebuild libvirt with patch: https://mailman-int.corp.redhat.com/archives/rhvirt-patches/2021-August/msg00103.html
Verify this bug with libvirt-daemon-7.6.0-3.module+el8.5.0+12510+80564ecf.x86_64 with the same steps in bug 1996130 comment 4.
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