[libvirt] [PATCH 0/2] conf: qemu: support new Hyper-V enlightenments in Qemu-3.1

The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments: hv_ipi and hv_evmcs. Support these in libvirt. Vitaly Kuznetsov (2): conf: qemu: add support for Hyper-V PV IPIs conf: qemu: add support for Hyper-V Enlightened VMCS docs/formatdomain.html.in | 14 ++++++++++++++ docs/schemas/domaincommon.rng | 10 ++++++++++ src/conf/domain_conf.c | 10 +++++++++- src/conf/domain_conf.h | 2 ++ src/cpu/cpu_x86.c | 6 ++++++ src/cpu/cpu_x86_data.h | 2 ++ src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_parse_command.c | 2 ++ src/qemu/qemu_process.c | 2 ++ tests/qemuxml2argvdata/hyperv-off.xml | 2 ++ tests/qemuxml2argvdata/hyperv.args | 2 +- tests/qemuxml2argvdata/hyperv.xml | 2 ++ tests/qemuxml2xmloutdata/hyperv-off.xml | 2 ++ tests/qemuxml2xmloutdata/hyperv.xml | 2 ++ 14 files changed, 58 insertions(+), 2 deletions(-) -- 2.17.2

Qemu-3.1 supports Hyper-V-style PV IPIs making it cheaper for Windows guests to send an IPI, especially when it targets many CPUs. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- docs/formatdomain.html.in | 7 +++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 6 +++++- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 3 +++ src/cpu/cpu_x86_data.h | 1 + src/qemu/qemu_command.c | 1 + src/qemu/qemu_parse_command.c | 1 + src/qemu/qemu_process.c | 1 + tests/qemuxml2argvdata/hyperv-off.xml | 1 + tests/qemuxml2argvdata/hyperv.args | 2 +- tests/qemuxml2argvdata/hyperv.xml | 1 + tests/qemuxml2xmloutdata/hyperv-off.xml | 1 + tests/qemuxml2xmloutdata/hyperv.xml | 1 + 14 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 269741a690..24d4b68d7b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1981,6 +1981,7 @@ <frequencies state='on'/> <reenlightenment state='on'/> <tlbflush state='on'/> + <ipi state='on'/> </hyperv> <kvm> <hidden state='on'/> @@ -2121,6 +2122,12 @@ <td> on, off</td> <td><span class="since">4.7.0 (QEMU 3.0)</span></td> </tr> + <tr> + <td>ipi</td> + <td>Enable PV IPI support</td> + <td> on, off</td> + <td><span class="since">4.10.0 (QEMU 3.1)</span></td> + </tr> </table> </dd> <dt><code>pvspinlock</code></dt> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index b9ac5df479..26019b3279 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5769,6 +5769,11 @@ <ref name="featurestate"/> </element> </optional> + <optional> + <element name="ipi"> + <ref name="featurestate"/> + </element> + </optional> </interleave> </element> </define> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e8e0adc819..c8cde90808 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -172,7 +172,8 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, "vendor_id", "frequencies", "reenlightenment", - "tlbflush") + "tlbflush", + "ipi") VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, "hidden") @@ -19990,6 +19991,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: @@ -22184,6 +22186,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: if (src->hyperv_features[i] != dst->hyperv_features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV enlightenment " @@ -27948,6 +27951,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e30a4b2fe7..9eea75548d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1795,6 +1795,7 @@ typedef enum { VIR_DOMAIN_HYPERV_FREQUENCIES, VIR_DOMAIN_HYPERV_REENLIGHTENMENT, VIR_DOMAIN_HYPERV_TLBFLUSH, + VIR_DOMAIN_HYPERV_IPI, VIR_DOMAIN_HYPERV_LAST } virDomainHyperv; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 69a0c8db28..33252e927e 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -114,6 +114,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT, 0x40000003, 0x00002000); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH, 0x40000004, 0x00000004); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_IPI, + 0x40000004, 0x00000400); static virCPUx86Feature x86_kvm_features[] = { @@ -137,6 +139,7 @@ static virCPUx86Feature x86_kvm_features[] = KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES), KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT), KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_IPI), }; typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index e75b3a2d0d..8c51d88e1a 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -65,6 +65,7 @@ struct _virCPUx86CPUID { # define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies" # define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment" # define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush" +# define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi" # define VIR_CPU_X86_DATA_INIT { 0 } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f59cbf559e..6fc8deff00 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6882,6 +6882,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON) virBufferAsprintf(&buf, ",hv_%s", virDomainHypervTypeToString(i)); diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 5b4a378a18..a15f4d1121 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -1539,6 +1539,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: if (value) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("HyperV feature '%s' should not " diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1850923914..85e2f7046b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3953,6 +3953,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: + case VIR_DOMAIN_HYPERV_IPI: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("host doesn't support hyperv '%s' feature"), virDomainHypervTypeToString(i)); diff --git a/tests/qemuxml2argvdata/hyperv-off.xml b/tests/qemuxml2argvdata/hyperv-off.xml index dc5777355f..e51cca45b5 100644 --- a/tests/qemuxml2argvdata/hyperv-off.xml +++ b/tests/qemuxml2argvdata/hyperv-off.xml @@ -23,6 +23,7 @@ <frequencies state='off'/> <reenlightenment state='off'/> <tlbflush state='off'/> + <ipi state='off'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hyperv.args index c55204b0c8..0800e4f79d 100644 --- a/tests/qemuxml2argvdata/hyperv.args +++ b/tests/qemuxml2argvdata/hyperv.args @@ -10,7 +10,7 @@ QEMU_AUDIO_DRV=none \ -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_reenlightenment,hv_tlbflush,hv_ipi' \ -m 214 \ -smp 6,sockets=6,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ diff --git a/tests/qemuxml2argvdata/hyperv.xml b/tests/qemuxml2argvdata/hyperv.xml index 816adf6907..05c7d478f7 100644 --- a/tests/qemuxml2argvdata/hyperv.xml +++ b/tests/qemuxml2argvdata/hyperv.xml @@ -23,6 +23,7 @@ <frequencies state='on'/> <reenlightenment state='on'/> <tlbflush state='on'/> + <ipi state='on'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2xmloutdata/hyperv-off.xml b/tests/qemuxml2xmloutdata/hyperv-off.xml index 77a8dac810..2282b763b5 100644 --- a/tests/qemuxml2xmloutdata/hyperv-off.xml +++ b/tests/qemuxml2xmloutdata/hyperv-off.xml @@ -23,6 +23,7 @@ <frequencies state='off'/> <reenlightenment state='off'/> <tlbflush state='off'/> + <ipi state='off'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata/hyperv.xml index fc8c59a557..97f387c172 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -23,6 +23,7 @@ <frequencies state='on'/> <reenlightenment state='on'/> <tlbflush state='on'/> + <ipi state='on'/> </hyperv> </features> <clock offset='utc'/> -- 2.17.2

On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
Qemu-3.1 supports Hyper-V-style PV IPIs making it cheaper for Windows
s/Qemu-3.1/QEMU 3.1/ [...]
+ <tr> + <td>ipi</td> + <td>Enable PV IPI support</td> + <td> on, off</td>
No whitespace before "on", please. Pre-existing: several entires in the section have the same issue, feel free to fix them (in a separate patch).
+ <td><span class="since">4.10.0 (QEMU 3.1)</span></td>
Again pre-existing: what does the first version number refer to? It would be nice to have it spelled out. [...]
@@ -172,7 +172,8 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, "vendor_id", "frequencies", "reenlightenment", - "tlbflush") + "tlbflush", + "ipi")
Since you're touching this anyway, you can take the opportunity to rewrite it as VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, ... "tlbflush", "ipi", ); so that the next patch and any subsequent ones will look nicer. [...]
+KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_IPI, + 0x40000004, 0x00000400);
I'm going to assume the magic numbers here are correct :) Everything else looks good. -- Andrea Bolognani / Red Hat / Virtualization

Andrea Bolognani <abologna@redhat.com> writes: ...
+ <td><span class="since">4.10.0 (QEMU 3.1)</span></td>
Again pre-existing: what does the first version number refer to? It would be nice to have it spelled out.
My understanding is that this is libvirt version. We can, of course, spell it out but: $ git grep -c 'class="since"' docs/formatdomain.html.in docs/formatdomain.html.in:400 $ git grep -c 'class="since".*libvirt' docs/formatdomain.html.in docs/formatdomain.html.in:10 Do you want a patch changing the remaining 390 entries? :-) (Thanks for the review btw!) -- Vitaly

On Wed, 2018-11-14 at 11:13 +0100, Vitaly Kuznetsov wrote:
Andrea Bolognani <abologna@redhat.com> writes: ...
+ <td><span class="since">4.10.0 (QEMU 3.1)</span></td>
Again pre-existing: what does the first version number refer to? It would be nice to have it spelled out.
My understanding is that this is libvirt version. We can, of course, spell it out but:
$ git grep -c 'class="since"' docs/formatdomain.html.in docs/formatdomain.html.in:400
$ git grep -c 'class="since".*libvirt' docs/formatdomain.html.in docs/formatdomain.html.in:10
Do you want a patch changing the remaining 390 entries? :-)
Of course it is! Not sure why I got confused in the first place :/ Never mind then, just address the remaining points and respin. -- Andrea Bolognani / Red Hat / Virtualization

On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
Qemu-3.1 supports Hyper-V-style PV IPIs making it cheaper for Windows
s/Qemu-3.1/QEMU 3.1/ [...]
+ <tr> + <td>ipi</td> + <td>Enable PV IPI support</td> + <td> on, off</td>
s/ on,/on,/ Everything else looks good. -- Andrea Bolognani / Red Hat / Virtualization

On Wed, 2018-11-14 at 10:00 +0100, Andrea Bolognani wrote:
On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
Qemu-3.1 supports Hyper-V-style PV IPIs making it cheaper for Windows
s/Qemu-3.1/QEMU 3.1/
[...]
+ <tr> + <td>ipi</td> + <td>Enable PV IPI support</td> + <td> on, off</td>
s/ on,/on,/
Everything else looks good.
Oops, these comments were supposed to be for 2/2 instead of 1/2, of course O:-) -- Andrea Bolognani / Red Hat / Virtualization

Qemu-3.1 supports Hyper-V Enlightened VMCS feature which significantly speeds up nested Hyper-V on KVM environments. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- docs/formatdomain.html.in | 7 +++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 6 +++++- src/conf/domain_conf.h | 1 + src/cpu/cpu_x86.c | 3 +++ src/cpu/cpu_x86_data.h | 1 + src/qemu/qemu_command.c | 1 + src/qemu/qemu_parse_command.c | 1 + src/qemu/qemu_process.c | 1 + tests/qemuxml2argvdata/hyperv-off.xml | 1 + tests/qemuxml2argvdata/hyperv.args | 2 +- tests/qemuxml2argvdata/hyperv.xml | 1 + tests/qemuxml2xmloutdata/hyperv-off.xml | 1 + tests/qemuxml2xmloutdata/hyperv.xml | 1 + 14 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 24d4b68d7b..ad58f3f1c7 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1982,6 +1982,7 @@ <reenlightenment state='on'/> <tlbflush state='on'/> <ipi state='on'/> + <evmcs state='on'/> </hyperv> <kvm> <hidden state='on'/> @@ -2128,6 +2129,12 @@ <td> on, off</td> <td><span class="since">4.10.0 (QEMU 3.1)</span></td> </tr> + <tr> + <td>evmcs</td> + <td>Enable Enlightened VMCS</td> + <td> on, off</td> + <td><span class="since">4.10.0 (QEMU 3.1)</span></td> + </tr> </table> </dd> <dt><code>pvspinlock</code></dt> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 26019b3279..ff57ce1015 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5774,6 +5774,11 @@ <ref name="featurestate"/> </element> </optional> + <optional> + <element name="evmcs"> + <ref name="featurestate"/> + </element> + </optional> </interleave> </element> </define> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c8cde90808..b0bb162d46 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -173,7 +173,8 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, "frequencies", "reenlightenment", "tlbflush", - "ipi") + "ipi", + "evmcs") VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, "hidden") @@ -19992,6 +19993,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: @@ -22187,6 +22189,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: if (src->hyperv_features[i] != dst->hyperv_features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV enlightenment " @@ -27952,6 +27955,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9eea75548d..061185e779 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1796,6 +1796,7 @@ typedef enum { VIR_DOMAIN_HYPERV_REENLIGHTENMENT, VIR_DOMAIN_HYPERV_TLBFLUSH, VIR_DOMAIN_HYPERV_IPI, + VIR_DOMAIN_HYPERV_EVMCS, VIR_DOMAIN_HYPERV_LAST } virDomainHyperv; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 33252e927e..ebfa74fccd 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -116,6 +116,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH, 0x40000004, 0x00000004); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_IPI, 0x40000004, 0x00000400); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_EVMCS, + 0x40000004, 0x00004000); static virCPUx86Feature x86_kvm_features[] = { @@ -140,6 +142,7 @@ static virCPUx86Feature x86_kvm_features[] = KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT), KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH), KVM_FEATURE(VIR_CPU_x86_KVM_HV_IPI), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_EVMCS), }; typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 8c51d88e1a..f52bba821f 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -66,6 +66,7 @@ struct _virCPUx86CPUID { # define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment" # define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush" # define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi" +# define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs" # define VIR_CPU_X86_DATA_INIT { 0 } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6fc8deff00..d543ada2a1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6883,6 +6883,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON) virBufferAsprintf(&buf, ",hv_%s", virDomainHypervTypeToString(i)); diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index a15f4d1121..d91fc8d901 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -1540,6 +1540,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: if (value) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("HyperV feature '%s' should not " diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 85e2f7046b..ebe8e244ae 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3954,6 +3954,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: case VIR_DOMAIN_HYPERV_TLBFLUSH: case VIR_DOMAIN_HYPERV_IPI: + case VIR_DOMAIN_HYPERV_EVMCS: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("host doesn't support hyperv '%s' feature"), virDomainHypervTypeToString(i)); diff --git a/tests/qemuxml2argvdata/hyperv-off.xml b/tests/qemuxml2argvdata/hyperv-off.xml index e51cca45b5..59c1e17ccd 100644 --- a/tests/qemuxml2argvdata/hyperv-off.xml +++ b/tests/qemuxml2argvdata/hyperv-off.xml @@ -24,6 +24,7 @@ <reenlightenment state='off'/> <tlbflush state='off'/> <ipi state='off'/> + <evmcs state='off'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hyperv.args index 0800e4f79d..5d59788e14 100644 --- a/tests/qemuxml2argvdata/hyperv.args +++ b/tests/qemuxml2argvdata/hyperv.args @@ -10,7 +10,7 @@ QEMU_AUDIO_DRV=none \ -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_reenlightenment,hv_tlbflush,hv_ipi,hv_evmcs' \ -m 214 \ -smp 6,sockets=6,cores=1,threads=1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ diff --git a/tests/qemuxml2argvdata/hyperv.xml b/tests/qemuxml2argvdata/hyperv.xml index 05c7d478f7..c6feaed528 100644 --- a/tests/qemuxml2argvdata/hyperv.xml +++ b/tests/qemuxml2argvdata/hyperv.xml @@ -24,6 +24,7 @@ <reenlightenment state='on'/> <tlbflush state='on'/> <ipi state='on'/> + <evmcs state='on'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2xmloutdata/hyperv-off.xml b/tests/qemuxml2xmloutdata/hyperv-off.xml index 2282b763b5..1b7d82b14a 100644 --- a/tests/qemuxml2xmloutdata/hyperv-off.xml +++ b/tests/qemuxml2xmloutdata/hyperv-off.xml @@ -24,6 +24,7 @@ <reenlightenment state='off'/> <tlbflush state='off'/> <ipi state='off'/> + <evmcs state='off'/> </hyperv> </features> <clock offset='utc'/> diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata/hyperv.xml index 97f387c172..5510d3dfad 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -24,6 +24,7 @@ <reenlightenment state='on'/> <tlbflush state='on'/> <ipi state='on'/> + <evmcs state='on'/> </hyperv> </features> <clock offset='utc'/> -- 2.17.2

On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments: hv_ipi and hv_evmcs. Support these in libvirt.
Vitaly Kuznetsov (2): conf: qemu: add support for Hyper-V PV IPIs conf: qemu: add support for Hyper-V Enlightened VMCS
I have pointed out a few very minor issues with the patches, as well as a couple areas where pre-existing issues could be fixed, although I don't consider the latter a requirement for merging the series ;) One thing that I would like to see, though, is the change being documented properly in the release notes (docs/news.xml). Please include that and respin. -- Andrea Bolognani / Red Hat / Virtualization

On 11/14/18 4:04 AM, Andrea Bolognani wrote:
On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments: hv_ipi and hv_evmcs. Support these in libvirt.
Vitaly Kuznetsov (2): conf: qemu: add support for Hyper-V PV IPIs conf: qemu: add support for Hyper-V Enlightened VMCS
I have pointed out a few very minor issues with the patches, as well as a couple areas where pre-existing issues could be fixed, although I don't consider the latter a requirement for merging the series ;)
One thing that I would like to see, though, is the change being documented properly in the release notes (docs/news.xml). Please include that and respin.
One other thing that I've really tried to see done is splitting the "conf" and "qemu" patches. That way one deals with conf, docs, conf, util, xml2xmltest, while the other deals with the qemu specific changes qemu, xml2argv. Sometimes it's "harder" to do that - such as may be the case with various switches when a new case is added; however, in that case the added case in the conf/docs/etc patch would go with the "default:" or "last" case and then be moved with the subsequent qemu patch. Tks, John

John Ferlan <jferlan@redhat.com> writes:
On 11/14/18 4:04 AM, Andrea Bolognani wrote:
On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments: hv_ipi and hv_evmcs. Support these in libvirt.
Vitaly Kuznetsov (2): conf: qemu: add support for Hyper-V PV IPIs conf: qemu: add support for Hyper-V Enlightened VMCS
I have pointed out a few very minor issues with the patches, as well as a couple areas where pre-existing issues could be fixed, although I don't consider the latter a requirement for merging the series ;)
One thing that I would like to see, though, is the change being documented properly in the release notes (docs/news.xml). Please include that and respin.
One other thing that I've really tried to see done is splitting the "conf" and "qemu" patches.
That way one deals with conf, docs, conf, util, xml2xmltest, while the other deals with the qemu specific changes qemu, xml2argv.
Sometimes it's "harder" to do that - such as may be the case with various switches when a new case is added; however, in that case the added case in the conf/docs/etc patch would go with the "default:" or "last" case and then be moved with the subsequent qemu patch.
I have to admit my overall knowledge of libvirt pretty limited, probably because of that I'm failing to see benefits of doing such split for Qemu/KVM-only features (as the whole Hyper-V emulation is Qemu/KVM-only). How is the first patch going to be tested? Compile-only? Also, which of these patches should src/cpu/* hunks go to? Would realy appreciate some guidance here) Thanks! -- Vitaly

On 11/14/18 8:24 AM, Vitaly Kuznetsov wrote:
John Ferlan <jferlan@redhat.com> writes:
On 11/14/18 4:04 AM, Andrea Bolognani wrote:
On Tue, 2018-11-13 at 18:53 +0100, Vitaly Kuznetsov wrote:
The upcoming Qemu-3.1 release will bring us two new Hyper-V enlightenments: hv_ipi and hv_evmcs. Support these in libvirt.
Vitaly Kuznetsov (2): conf: qemu: add support for Hyper-V PV IPIs conf: qemu: add support for Hyper-V Enlightened VMCS
I have pointed out a few very minor issues with the patches, as well as a couple areas where pre-existing issues could be fixed, although I don't consider the latter a requirement for merging the series ;)
One thing that I would like to see, though, is the change being documented properly in the release notes (docs/news.xml). Please include that and respin.
One other thing that I've really tried to see done is splitting the "conf" and "qemu" patches.
That way one deals with conf, docs, conf, util, xml2xmltest, while the other deals with the qemu specific changes qemu, xml2argv.
Sometimes it's "harder" to do that - such as may be the case with various switches when a new case is added; however, in that case the added case in the conf/docs/etc patch would go with the "default:" or "last" case and then be moved with the subsequent qemu patch.
I have to admit my overall knowledge of libvirt pretty limited, probably because of that I'm failing to see benefits of doing such split for Qemu/KVM-only features (as the whole Hyper-V emulation is
Generally speaking it's to keep conf/docs/XML changes separate from hypervisor specific to make bisecting easier and patches smaller for reviews. I see I didn't ask the last time (commit f4c39db736 for PV TLB flush support in Aug 2018), so either I had a lapse there or I was just feeling it wasn't that important since things are so tightly coupled. I look at a lot of patches and just try to be consistent in asks.
Qemu/KVM-only). How is the first patch going to be tested? Compile-only?
Since you've updated tests/qemuxml2xmloutdata/hyperv.xml (and the output). That means the XML parsing is being tested. So that's testing that the newly added XML/RNG field can be parsed and output as expected. There are cases I've reviewed where the formatting was wrong, but there was no xml2xml to test that.
Also, which of these patches should src/cpu/* hunks go to?
I would think the conf/docs/xml2xml since it seems they are defining supported bits.
Would realy appreciate some guidance here) Thanks!
In the long run it may not matter much - I'm not here to NAK something because the split isn't done. Again, I'm trying to be consistent in how I look at things. John
participants (3)
-
Andrea Bolognani
-
John Ferlan
-
Vitaly Kuznetsov