Bug 1794868

Summary: Missing Hyper-V enlightenments
Product: Red Hat Enterprise Linux 8 Reporter: Dominik Holler <dholler>
Component: libvirtAssignee: Jiri Denemark <jdenemar>
Status: CLOSED ERRATA QA Contact: jiyan <jiyan>
Severity: high Docs Contact:
Priority: high    
Version: 8.2CC: dyuan, jdenemar, jsuchane, lhuang, lmen, m, mzhan, rbalakri, srosenbe, stowellt, xuzhang
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-4.5.0-39.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:33:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1782882    
Attachments:
Description Flags
terminal log of reproducer on RHEL 8.2 none

Description Dominik Holler 2020-01-24 22:46:25 UTC
Created attachment 1655158 [details]
terminal log of reproducer on RHEL 8.2

Description of problem:
The support of
 - hyperv 'runtime' feature
 - hyperv 'synic' feature
 - hyperv 'stimer' feature
 - hyperv 'frequencies' feature

seems to be removed since CentOS 8.1.0.

A Windows VM which was working on CentOS 8.0 has to be modified to run on CentOS 8.1


Version-Release number of selected component (if applicable):


How reproducible:
Reproduces on RHEL 8.2.0

Steps to Reproduce:
1. Create a Windows xml domain definition like described in https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_virtualization/index#enabling-hyper-v-enlightenments_optimizing-windows-virtual-machines-on-rhel-8
2. virsh create win.xml or virsh start win if already defined on CentOS 8.0
3.

Actual results:
[root@wintest ~]# virsh create win.xml 
error: Failed to create domain from win.xml
error: unsupported configuration: host doesn't support hyperv 'runtime' feature

[root@wintest ~]# vi win.xml
[root@wintest ~]# virsh create win.xml 
error: Failed to create domain from win.xml
error: unsupported configuration: host doesn't support hyperv 'synic' feature

[root@wintest ~]# vi win.xml
[root@wintest ~]# virsh create win.xml 
error: Failed to create domain from win.xml
error: unsupported configuration: host doesn't support hyperv 'stimer' feature

[root@wintest ~]# vi win.xml
[root@wintest ~]# virsh create win.xml 
error: Failed to create domain from win.xml
error: unsupported configuration: host doesn't support hyperv 'frequencies' feature



Expected results:
VM boots like in CentOS 8.0 and documented.

Additional info:

Comment 1 Jiri Denemark 2020-01-30 17:38:01 UTC
Oh yeah, we backported (from upstream libvirt 5.5.0) support for MSR features
to libvirt-4.5.0-29.el8 (i.e., for RHEL-8.1.0), which also included patches to
check CPU features with QEMU by name rather than by their CPUID bits.
Unfortunately, this broke support for hyperv and kvm specific features and
several commits fixing them were pushed later to 5.6.0. However, these
additional patches were not backported to RHEL (they are only included in
RHEL-AV). So once qemu-kvm backported their part of the support (specifically
the unavailable-features QOM property) to qemu-kvm-2.12.0-86, libvirt started
to be broken in the same way it was broken with QEMU 4.1.0 upstream.

The following patches are candidates for backporting to RHEL-8:

    0ccdd476bb qemu: Fix hyperv features with QEMU 4.1
    d99e8f01c7 qemu: Prefer dashes for hyperv features
    1ddf014fef cpu: Drop KVM_ from hyperv feature macros
    9e6172937f cpu: Drop unused KVM features
    4c62ed6068 qemu: Fix KVM features with QEMU 4.1

Comment 4 Mark Zealey 2020-02-10 17:53:57 UTC
This is really annoying, I hope we can get a fixed package soon.

The only workaround that I can find is to downgrade to 8.0 version of libvirt. If using centos this can be done like:

dnf install $(rpm -qa |grep libvirt| sed 's/-35.*/-24.3.module_el8.0.0+189+f9babebb.x86_64.rpm/' | sed s',^,http://mirror.centos.org/centos/8.0.1905/AppStream/x86_64/os/Packages/,')

Comment 5 jiyan 2020-02-17 08:27:50 UTC
Reproduce this issue with libvirt-4.5.0-38.module+el8.2.0+5435+dd02dc4c.x86_64.

Version:
qemu-kvm-2.12.0-98.module+el8.2.0+5698+10a84757.x86_64
kernel-4.18.0-178.el8.x86_64
libvirt-4.5.0-38.module+el8.2.0+5435+dd02dc4c.x86_64

Steps:
1. Prepare a shutdown VM
# virsh domstate test82 
shut off

2. Start VM with runtime hyperv feature
[root@dell-per730-36 ~]# virsh dumpxml test82 |grep "<hyperv" -A2
    <hyperv>
      <runtime state='on'/>
    </hyperv>

# virsh start test82 
error: Failed to start domain test82
error: unsupported configuration: host doesn't support hyperv 'runtime' feature

3. Start VM with synic hyperv feature
# virsh dumpxml test82 |grep "<hyperv" -A2
    <hyperv>
      <synic state='on'/>
    </hyperv>

# virsh start test82 
error: Failed to start domain test82
error: unsupported configuration: host doesn't support hyperv 'synic' feature

4. Start VM with stimer hyperv feature
# virsh dumpxml test82 |grep "<hyperv" -A2
    <hyperv>
      <stimer state='on'/>
    </hyperv>

# virsh start test82 
error: Failed to start domain test82
error: unsupported configuration: host doesn't support hyperv 'stimer' feature

5. Start VM with frequencies hyperv feature
# virsh dumpxml test82 |grep "<hyperv" -A2
    <hyperv>
      <frequencies state='on'/>
    </hyperv>

# virsh start test82 
error: Failed to start domain test82
error: unsupported configuration: host doesn't support hyperv 'frequencies' feature

Verified this issue with libvirt-4.5.0-39.module+el8.2.0+5690+f1eb5920.x86_64.
1. Update libvirt and restart libvirtd
# yum update libvirt* -y

# systemctl restart libvirtd

# rpm -qa libvirt
libvirt-4.5.0-39.module+el8.2.0+5690+f1eb5920.x86_64

2. Start a VM with runtime/synic/stimer/frequencies hyperv features
# virsh domstate test82 
shut off

# virsh dumpxml test82 |grep "<hyperv" -A5
    <hyperv>
      <runtime state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
      <frequencies state='on'/>
    </hyperv>

# virsh start test82 
Domain test82 started

# ps -ef |grep test82
...
-cpu Haswell-noTSX-IBRS,vme=on,ss=on,vmx=on,f16c=on,rdrand=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaveopt=on,pdpe1gb=on,abm=on,ibpb=on,skip-l1dfl-vmentry=on,** hv-runtime,hv-synic,hv-stimer,hv-frequencies **

3. Change the "state" parameter of these hyperv features
# virsh dumpxml test82 |grep "<hyperv" -A5
    <hyperv>
      <runtime state='off'/>
      <synic state='off'/>
      <stimer state='off'/>
      <frequencies state='off'/>
    </hyperv>

# virsh destroy test82 ;virsh start test82
Domain test82 destroyed

Domain test82 started

# ps -ef |grep test
...
-cpu Haswell-noTSX-IBRS,vme=on,ss=on,vmx=on,f16c=on,rdrand=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,md-clear=on,stibp=on,arch-capabilities=on,ssbd=on,xsaveopt=on,pdpe1gb=on,abm=on,ibpb=on,skip-l1dfl-vmentry=on -m 1024  [No hy-* here now.]

All the test result are as expected, move this bug to be verified.

Comment 7 errata-xmlrpc 2020-04-28 15:33:39 UTC
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/RHEA-2020:1587