[libvirt] [PATCH v2 0/8] Add support for Direct Mode for Hyper-V Synthetic timers

Changes since v1: - Rebase - Add Ján's R-b tags. - Hardcode 'direct' as the only stimer feature to avoid over-engineering [Ján Tomko] - Split 'conf' patch into three [Ján Tomko] - Minor fixes [Ján Tomko] QEMU-4.1 will bring us Direct Mode for Hyper-V Synthetic timers support, we need to support it in libvirt too. As this is not a new enlightenment but rather an enhancement of an existing one ('stimer'), support it in <stimer state='on'> <direct state='on'/> </stimer> form. Backwards compatibility is (hopefully) preserved. Vitaly Kuznetsov (8): docs: formatdomain: add stimer flag to the example xml docs: formatdomain: fix 'SynIC' spelling docs: formatdomain: move 'msrs' out of Hyper-V Enlightenments cpu_x86: add Edx to KVM_FEATURE_DEF() conf: change the way how Hyper-V features are printed out conf: add support for Direct Mode for Hyper-V Synthetic timers qemu: add support for Direct Mode for Hyper-V Synthetic timers news: mention Direct Mode for Hyper-V Synthetic timers support docs/formatdomain.html.in | 13 +++-- docs/news.xml | 9 ++++ docs/schemas/domaincommon.rng | 16 +++++- src/conf/domain_conf.c | 77 ++++++++++++++++++++++++++--- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 35 +++++++------ src/cpu/cpu_x86_data.h | 2 + src/qemu/qemu_command.c | 12 +++-- src/qemu/qemu_process.c | 20 +++++++- tests/qemuxml2argvdata/hyperv.args | 4 +- tests/qemuxml2argvdata/hyperv.xml | 4 +- tests/qemuxml2xmloutdata/hyperv.xml | 4 +- 12 files changed, 158 insertions(+), 39 deletions(-) -- 2.20.1

The example XML we have contains all other Hyper-V Enlightenments but 'stimer' is missing. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> --- docs/formatdomain.html.in | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1938bd875c..0894d9cbfb 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2033,6 +2033,7 @@ <vpindex state='on'/> <runtime state='on'/> <synic state='on'/> + <stimer state='on'/> <reset state='on'/> <vendor_id state='on' value='KVM Hv'/> <frequencies state='on'/> -- 2.20.1

SynIC stands for 'Synthetic Interrupt Controller', it is not a NIC. Fix the spelling in accordance with Hypervisor Top Level Functional Specification. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> --- docs/formatdomain.html.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0894d9cbfb..44b1ae7597 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2142,13 +2142,13 @@ </tr> <tr> <td>synic</td> - <td>Enable Synthetic Interrupt Controller (SyNIC)</td> + <td>Enable Synthetic Interrupt Controller (SynIC)</td> <td>on, off</td> <td><span class="since">1.3.3 (QEMU 2.6)</span></td> </tr> <tr> <td>stimer</td> - <td>Enable SyNIC timers</td> + <td>Enable SynIC timers</td> <td>on, off</td> <td><span class="since">1.3.3 (QEMU 2.6)</span></td> </tr> -- 2.20.1

Introduced by: commit e9528f41c612fff334e958d5e5df197aa8e83792 'msrs' is a feature unrelated to Hyper-V Enlightenments, the commit message which added it and the test have it right: <features> ... <msrs unknown='ignore'> ... </features> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> --- docs/formatdomain.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 44b1ae7597..f5c882141a 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2041,7 +2041,6 @@ <tlbflush state='on'/> <ipi state='on'/> <evmcs state='on'/> - <msrs unknown='ignore'/> </hyperv> <kvm> <hidden state='on'/> @@ -2057,6 +2056,7 @@ <tseg unit='MiB'>48</tseg> </smm> <htm state='on'/> + <msrs unknown='ignore'/> </features> ...</pre> -- 2.20.1

Some Hyper-V features (like the upcoming Direct Synthetic timers) are announced by feature bits in Edx but KVM_FEATURE_DEF() supports only Eax. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- src/cpu/cpu_x86.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 387c365512..8575915597 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -59,9 +59,9 @@ struct _virCPUx86Feature { { .type = VIR_CPU_X86_DATA_CPUID, \ .data = { .cpuid = {__VA_ARGS__} } } -#define KVM_FEATURE_DEF(Name, Eax_in, Eax) \ +#define KVM_FEATURE_DEF(Name, Eax_in, Eax, Edx) \ static virCPUx86DataItem Name ## _data[] = { \ - CPUID(.eax_in = Eax_in, .eax = Eax), \ + CPUID(.eax_in = Eax_in, .eax = Eax, .edx = Edx), \ } #define KVM_FEATURE(Name) \ @@ -74,34 +74,34 @@ struct _virCPUx86Feature { } KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT, - 0x40000001, 0x00000080); + 0x40000001, 0x00000080, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME, - 0x40000003, 0x00000001); + 0x40000003, 0x00000001, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_SYNIC, - 0x40000003, 0x00000004); + 0x40000003, 0x00000004, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER, - 0x40000003, 0x00000008); + 0x40000003, 0x00000008, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED, - 0x40000003, 0x00000020); + 0x40000003, 0x00000020, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_SPINLOCKS, - 0x40000003, 0x00000022); + 0x40000003, 0x00000022, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC, - 0x40000003, 0x00000030); + 0x40000003, 0x00000030, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX, - 0x40000003, 0x00000040); + 0x40000003, 0x00000040, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_RESET, - 0x40000003, 0x00000080); + 0x40000003, 0x00000080, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_FREQUENCIES, - 0x40000003, 0x00000800); + 0x40000003, 0x00000800, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_REENLIGHTENMENT, - 0x40000003, 0x00002000); + 0x40000003, 0x00002000, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_TLBFLUSH, - 0x40000004, 0x00000004); + 0x40000004, 0x00000004, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_IPI, - 0x40000004, 0x00000400); + 0x40000004, 0x00000400, 0x0); KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS, - 0x40000004, 0x00004000); + 0x40000004, 0x00004000, 0x0); static virCPUx86Feature x86_kvm_features[] = { -- 2.20.1

Current code doesn't allow us to add sub-features as we always print the closing '/>'. As a preparatory change to implementing 'direct' sub-feature for 'stimer' feature switch to printing closing tag individually. No functional change. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- src/conf/domain_conf.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 441eb1a5a2..0871f21494 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28073,19 +28073,24 @@ virDomainDefFormatFeatures(virBufferPtr buf, case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: + virBufferAddLit(&childBuf, "/>\n"); break; case VIR_DOMAIN_HYPERV_SPINLOCKS: - if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) + if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) { + virBufferAddLit(&childBuf, "/>\n"); break; - virBufferAsprintf(&childBuf, " retries='%d'", + } + virBufferAsprintf(&childBuf, " retries='%d'/>\n", def->hyperv_spinlocks); break; case VIR_DOMAIN_HYPERV_VENDOR_ID: - if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) + if (def->hyperv_features[j] != VIR_TRISTATE_SWITCH_ON) { + virBufferAddLit(&childBuf, "/>\n"); break; - virBufferEscapeString(&childBuf, " value='%s'", + } + virBufferEscapeString(&childBuf, " value='%s'/>\n", def->hyperv_vendor_id); break; @@ -28093,8 +28098,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, case VIR_DOMAIN_HYPERV_LAST: break; } - - virBufferAddLit(&childBuf, "/>\n"); } virBufferAdjustIndent(&childBuf, -2); virBufferAddLit(&childBuf, "</hyperv>\n"); -- 2.20.1

Support 'Direct Mode' for Hyper-V Synthetic Timers in domain config. Make it 'stimer' enlightenment option as it is not a separate thing. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- docs/formatdomain.html.in | 10 +++--- docs/schemas/domaincommon.rng | 16 ++++++++- src/conf/domain_conf.c | 62 ++++++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 3 ++ src/cpu/cpu_x86_data.h | 2 ++ 6 files changed, 88 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index f5c882141a..d778fc3f62 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2033,7 +2033,9 @@ <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'/> @@ -2148,9 +2150,9 @@ </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.6.0 (QEMU 4.1)</span></td> </tr> <tr> <td>reset</td> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a0771da45b..6707dcc634 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5907,7 +5907,7 @@ </optional> <optional> <element name="stimer"> - <ref name="featurestate"/> + <ref name="stimer"/> </element> </optional> <optional> @@ -5956,6 +5956,20 @@ </element> </define> + <!-- Hyper-V stimer features --> + <define name="stimer"> + <interleave> + <optional> + <ref name="featurestate"/> + </optional> + <optional> + <element name="direct"> + <ref name="featurestate"/> + </element> + </optional> + </interleave> + </define> + <!-- Optional KVM features --> <define name="kvm"> <element name="kvm"> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0871f21494..98273ab62a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -20383,6 +20383,39 @@ virDomainDefParseXML(xmlDocPtr xml, 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; @@ -22607,6 +22640,17 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, } } + 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++) { @@ -28066,7 +28110,6 @@ virDomainDefFormatFeatures(virBufferPtr buf, 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: @@ -28085,6 +28128,23 @@ virDomainDefFormatFeatures(virBufferPtr buf, 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"); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8a4425df64..7a2a9e16c0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2400,6 +2400,7 @@ struct _virDomainDef { int kvm_features[VIR_DOMAIN_KVM_LAST]; int msrs_features[VIR_DOMAIN_MSRS_LAST]; unsigned int hyperv_spinlocks; + int hyperv_stimer_direct; virGICVersion gic_version; virDomainHPTResizing hpt_resizing; unsigned long long hpt_maxpagesize; /* Stored in KiB */ diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 8575915597..fbfd9a5bfa 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -102,6 +102,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_HV_IPI, 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[] = { @@ -119,6 +121,7 @@ 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; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index cc0c93dff0..cebf3b6669 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -64,6 +64,8 @@ struct _virCPUx86MSR { #define VIR_CPU_x86_HV_IPI "hv-ipi" #define VIR_CPU_x86_HV_EVMCS "hv-evmcs" +/* Hyper-V Synthetic Timer option */ +#define VIR_CPU_x86_HV_STIMER_DIRECT "hv-stimer-direct" #define VIR_CPU_X86_DATA_INIT { 0 } -- 2.20.1

QEMU-4.1 supports 'Direct Mode' for Hyper-V synthetic timers (hv-stimer-direct CPU flag): Windows guests can request that timer expiration notifications are delivered as normal interrupts (and not VMBus messages). This is used by Hyper-V on KVM. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- src/qemu/qemu_command.c | 12 ++++++++---- src/qemu/qemu_process.c | 20 ++++++++++++++++++-- tests/qemuxml2argvdata/hyperv.args | 4 ++-- tests/qemuxml2argvdata/hyperv.xml | 4 +++- tests/qemuxml2xmloutdata/hyperv.xml | 4 +++- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fee51158a9..be5777023c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7151,10 +7151,10 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } if (def->features[VIR_DOMAIN_FEATURE_HYPERV] == VIR_TRISTATE_SWITCH_ON) { - const char *hvPrefix = "hv-"; + const char *hvDelimiter = "-"; if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES)) - hvPrefix = "hv_"; + hvDelimiter = "_"; for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) { switch ((virDomainHyperv) i) { @@ -7171,9 +7171,13 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s%s", - hvPrefix, + virBufferAsprintf(&buf, ",hv%s%s", + hvDelimiter, virDomainHypervTypeToString(i)); + if ((i == VIR_DOMAIN_HYPERV_STIMER) && + (def->hyperv_stimer_direct == VIR_TRISTATE_SWITCH_ON)) + virBufferAsprintf(&buf, ",hv%sstimer%sdirect", hvDelimiter, + hvDelimiter); break; case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0ee97e2296..ad1a75bfee 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4111,10 +4111,26 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, rc = virCPUDataCheckFeature(cpu, cpuFeature); VIR_FREE(cpuFeature); - if (rc < 0) + if (rc < 0) { return -1; - else if (rc == 1) + } else if (rc == 1) { + if (i == VIR_DOMAIN_HYPERV_STIMER) { + if (def->hyperv_stimer_direct != VIR_TRISTATE_SWITCH_ON) + continue; + + rc = virCPUDataCheckFeature(cpu, "hv-stimer-direct"); + if (rc < 0) + return -1; + else if (rc == 1) + continue; + + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("host doesn't support hyperv stimer '%s' feature"), + "direct"); + return -1; + } continue; + } switch ((virDomainHyperv) i) { case VIR_DOMAIN_HYPERV_RELAXED: diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hyperv.args index 086adaa349..8040da9caa 100644 --- a/tests/qemuxml2argvdata/hyperv.args +++ b/tests/qemuxml2argvdata/hyperv.args @@ -12,8 +12,8 @@ QEMU_AUDIO_DRV=none \ -S \ -machine pc,accel=tcg,usb=off,dump-guest-core=off \ -cpu 'qemu32,hv_relaxed,hv_vapic,hv-spinlocks=0x2fff,hv_vpindex,hv_runtime,\ -hv_synic,hv_stimer,hv_reset,hv-vendor-id=KVM Hv,hv_frequencies,\ -hv_reenlightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ +hv_synic,hv_stimer,hv_stimer_direct,hv_reset,hv-vendor-id=KVM Hv,\ +hv_frequencies,hv_reenlightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ -m 214 \ -realtime mlock=off \ -smp 6,sockets=6,cores=1,threads=1 \ diff --git a/tests/qemuxml2argvdata/hyperv.xml b/tests/qemuxml2argvdata/hyperv.xml index c6feaed528..ae0f934f76 100644 --- a/tests/qemuxml2argvdata/hyperv.xml +++ b/tests/qemuxml2argvdata/hyperv.xml @@ -17,7 +17,9 @@ <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'/> diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata/hyperv.xml index 5510d3dfad..2e4b43d4c6 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -17,7 +17,9 @@ <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'/> -- 2.20.1

The QEMU driver now supports Direct Mode for Hyper-V Synthetic timers for Hyper-V guests. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 1134309ec2..e4d8f1ecac 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -54,6 +54,15 @@ <libvirt> <release version="v5.6.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: Support Direct Mode for Hyper-V Synthetic timers + </summary> + <description> + The QEMU driver now supports Direct Mode for Hyper-V Synthetic timers + for Hyper-V guests. + </description> + </change> <change> <summary> qemu: Introduce a new video model of type 'bochs' -- 2.20.1

On Tue, Jul 30, 2019 at 12:13:40PM +0200, Vitaly Kuznetsov wrote:
Changes since v1: - Rebase - Add Ján's R-b tags. - Hardcode 'direct' as the only stimer feature to avoid over-engineering [Ján Tomko] - Split 'conf' patch into three [Ján Tomko] - Minor fixes [Ján Tomko]
QEMU-4.1 will bring us Direct Mode for Hyper-V Synthetic timers support, we need to support it in libvirt too. As this is not a new enlightenment but rather an enhancement of an existing one ('stimer'), support it in
<stimer state='on'> <direct state='on'/> </stimer>
form. Backwards compatibility is (hopefully) preserved.
Vitaly Kuznetsov (8): docs: formatdomain: add stimer flag to the example xml docs: formatdomain: fix 'SynIC' spelling docs: formatdomain: move 'msrs' out of Hyper-V Enlightenments
I went ahead and pushed these now in the freeze since they are fixing the documentation. Jano
cpu_x86: add Edx to KVM_FEATURE_DEF() conf: change the way how Hyper-V features are printed out conf: add support for Direct Mode for Hyper-V Synthetic timers qemu: add support for Direct Mode for Hyper-V Synthetic timers news: mention Direct Mode for Hyper-V Synthetic timers support
docs/formatdomain.html.in | 13 +++-- docs/news.xml | 9 ++++ docs/schemas/domaincommon.rng | 16 +++++- src/conf/domain_conf.c | 77 ++++++++++++++++++++++++++--- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 35 +++++++------ src/cpu/cpu_x86_data.h | 2 + src/qemu/qemu_command.c | 12 +++-- src/qemu/qemu_process.c | 20 +++++++- tests/qemuxml2argvdata/hyperv.args | 4 +- tests/qemuxml2argvdata/hyperv.xml | 4 +- tests/qemuxml2xmloutdata/hyperv.xml | 4 +- 12 files changed, 158 insertions(+), 39 deletions(-)
-- 2.20.1
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (2)
-
Ján Tomko
-
Vitaly Kuznetsov