Bug 1738244

Summary: Machine type pc-q35-3.1 doesn't seem to support <HyperV><synic state='on'/></hyperv>
Product: Red Hat Enterprise Linux 7 Reporter: Brian-W <m40636067>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jinzhao, juzhang, knoel, virt-maint, vkuznets
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-08 12:10:27 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:

Description Brian-W 2019-08-06 15:19:53 UTC
Description of problem:
Cannot set "<HyperV><synic state='on'/></hyperv>" in virt VM XML when using machine-type "pc-q35-3.1". It's possible using machine-type "pc-i440fx-2.8"

Version-Release number of selected component (if applicable):
QEMU 3.1.0
Kernel Kernel 4.19 
 
Actual results:
When starting VM I get the error 

"
error: internal error: process exited while connecting to monitor: Hyper-V SynIC (requested by 'hv-synic' cpu flag) requires Hyper-V VP_INDEX ('hv-vpindex')
2019-08-06T13:29:14.114943Z qemu-system-x86_64: kvm_init_vcpu failed: Function not implemented
"

I'm experience the "classic" problem with high host CPU usage with Win10 >= 1803 (mine 1809) and wanted to set "<HyperV><synic state='on'/></hyperv>" to see if that solve the problem.
If this by design I apologies for inconvenience. I did search for solutions and tried to find specifications on supported features for the machine-type but came up short.

Comment 2 Brian-W 2019-08-06 16:11:54 UTC
Hmm....doesn't seem to be related to the Q35 machine type afterall.

Comment 3 Brian-W 2019-08-06 16:29:16 UTC
(In reply to Brian-W from comment #2)
Cannot set SynIC on pc-i440fx-3.1
But I can set it on pc-i440fx-3.0!
Bug or by design. If by design, how do I get something similar to SynIC on machine types > pc-i440fx-3.0?

Comment 6 Vitaly Kuznetsov 2019-08-08 12:10:27 UTC
This is expected: hv-synic enlightenment requires 'hv-vpindex' and QEMU starting with 3.1 version
enforces that.

In case you're trying to overcome 'high host CPU load' issue when running Windows guests you'll
need to enable at least the following:

  <features>
   ...
    <hyperv>
      <relaxed state='on'/>
      <vpindex state='on'/>
      <synic state='on'/>
      <stimer state='on'/>
    </hyperv>
   ....
  </features>

  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>

Comment 7 Brian-W 2019-08-08 15:22:36 UTC
Can you elaborate on "..'hv-vpindex' and QEMU starting with 3.1 version enforces that."
Does it mean that "hv-vpindex" or "hv-synic" or something else (?) has to be supported on the hardware (CPU and/or chipset) and that it apparently isn't on my server since I get the error?
Strange because it works on machine type "pc-i440fx-3.0" and older on the same hardware?

I'm aware of the XML settings above, that's the whole point. I cannot use "<synic state='on'/>" with machine type newer than "pc-i440fx-3.0".

But "pc-i440fx-3.0" works fine with "<synic state='on'/>" even on QEMU 3.1.0.

Comment 8 Vitaly Kuznetsov 2019-08-08 15:43:12 UTC
These are all software features, no hardware support required.

Before QEMU-3.1 it was possible to enable 'synic' without enabling 'vpindex' but this configuration
can't be used by guests so QEMU started enforcing the dependency not allowing to run guests with
'synic' but without 'vpindex'. Newer QEMU versions support old machine types (e.g. pc-i440fx-3.0)
unchanged so it is still possible to run them with 'synic' but without 'vpindex'. Possible but still
pointless as guests won't be able to use the feature.

To mitigate the 'high CPU load' problem enabling 'synic' is not enough. You also need 'stimer' and
'hypervclock' clocksource.

Comment 9 Brian-W 2019-08-08 16:17:20 UTC
OMG...I thought and assumed I already tried the XML settings you listed, but I see now there is a difference, I just looked at the "synic" and "stimer".
It work perfectly now. Sorry for the noise.
Thank you very much for your effort.