<vpindex state='on'/>
<runtime state='on'/>
<synic state='on'/>
- <stimer state='on'/>
+ <stimer state='on'>
+ <direct state='on'/>
+ </stimer>
<reset state='on'/>
<vendor_id state='on' value='KVM Hv'/>
<frequencies state='on'/>
</tr>
<tr>
<td>stimer</td>
- <td>Enable SynIC timers</td>
- <td>on, off</td>
- <td><span class="since">1.3.3 (QEMU 2.6)</span></td>
+ <td>Enable SynIC timers, optionally with Direct Mode support</td>
+ <td>on, off; direct - on,off</td>
+ <td><span class="since">1.3.3 (QEMU 2.6), direct mode 5.7.0 (QEMU 4.1)</span></td>
</tr>
<tr>
<td>reset</td>
ctxt->node = node;
}
+ if (def->features[VIR_DOMAIN_HYPERV_STIMER] == VIR_TRISTATE_SWITCH_ON) {
+ int value;
+ if ((n = virXPathNodeSet("./features/hyperv/stimer/*", ctxt, &nodes)) < 0)
+ goto error;
+
+ for (i = 0; i < n; i++) {
+ if (STRNEQ((const char *)nodes[i]->name, "direct")) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported Hyper-V stimer feature: %s"),
+ nodes[i]->name);
+ goto error;
+ }
+
+ if (!(tmp = virXMLPropString(nodes[i], "state"))) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("missing 'state' attribute for "
+ "Hyper-V stimer '%s' feature"), "direct");
+ goto error;
+ }
+
+ if ((value = virTristateSwitchTypeFromString(tmp)) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("invalid value of state argument "
+ "for Hyper-V stimer '%s' feature"), "direct");
+ goto error;
+ }
+
+ VIR_FREE(tmp);
+ def->hyperv_stimer_direct = value;
+ }
+ VIR_FREE(nodes);
+ }
+
if (def->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON) {
int feature;
int value;
}
}
+ if (src->hyperv_features[VIR_DOMAIN_HYPERV_STIMER] == VIR_TRISTATE_SWITCH_ON) {
+ if (src->hyperv_stimer_direct != dst->hyperv_stimer_direct) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("State of HyperV stimer direct feature differs: "
+ "source: '%s', destination: '%s'"),
+ virTristateSwitchTypeToString(src->hyperv_stimer_direct),
+ virTristateSwitchTypeToString(dst->hyperv_stimer_direct));
+ return false;
+ }
+ }
+
/* kvm */
if (src->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON) {
for (i = 0; i < VIR_DOMAIN_KVM_LAST; i++) {
case VIR_DOMAIN_HYPERV_VPINDEX:
case VIR_DOMAIN_HYPERV_RUNTIME:
case VIR_DOMAIN_HYPERV_SYNIC:
- case VIR_DOMAIN_HYPERV_STIMER:
case VIR_DOMAIN_HYPERV_RESET:
case VIR_DOMAIN_HYPERV_FREQUENCIES:
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
def->hyperv_spinlocks);
break;
+ case VIR_DOMAIN_HYPERV_STIMER:
+ if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) {
+ virBufferAddLit(&childBuf, "/>\n");
+ break;
+ }
+ if (def->hyperv_stimer_direct == VIR_TRISTATE_SWITCH_ON) {
+ virBufferAddLit(&childBuf, ">\n");
+ virBufferAdjustIndent(&childBuf, 2);
+ virBufferAddLit(&childBuf, "<direct state='on'/>\n");
+ virBufferAdjustIndent(&childBuf, -2);
+ virBufferAddLit(&childBuf, "</stimer>\n");
+ } else {
+ virBufferAddLit(&childBuf, "/>\n");
+ }
+
+ break;
+
case VIR_DOMAIN_HYPERV_VENDOR_ID:
if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) {
virBufferAddLit(&childBuf, "/>\n");
0x40000004, 0x00000400, 0x0);
KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS,
0x40000004, 0x00004000, 0x0);
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER_DIRECT,
+ 0x40000003, 0x0, 0x00080000);
static virCPUx86Feature x86_kvm_features[] =
{
KVM_FEATURE(VIR_CPU_x86_HV_TLBFLUSH),
KVM_FEATURE(VIR_CPU_x86_HV_IPI),
KVM_FEATURE(VIR_CPU_x86_HV_EVMCS),
+ KVM_FEATURE(VIR_CPU_x86_HV_STIMER_DIRECT),
};
typedef struct _virCPUx86Model virCPUx86Model;