diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 97b4f6612f81a7afb665811c3873ff27fad79652..e68223329c927bfbe4c6ac82661821346572cf4f 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1976,6 +1976,7 @@ <vendor_id state='on' value='KVM Hv'/> <frequencies state='on'/> <reenlightenment state='on'/> + <tlbflush state='on'/> </hyperv> <kvm> <hidden state='on'/> @@ -2110,6 +2111,12 @@ on, off 4.7.0 (QEMU 3.0) + + tlbflush + Enable PV TLB flush support + on, off + 4.7.0 (QEMU 3.0) +
pvspinlock
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index fcd8ef188376a347209dfbbf58f12b62ba0c211a..385fa8666ce73637baf1af3cdb3cb87e5539d51e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5743,6 +5743,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index bbd45bc720f799f16f58c8964c7e7d558f34ad36..3c254801cd6ef47cd3c64ae5a2673587cec292fc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -171,7 +171,8 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST, "reset", "vendor_id", "frequencies", - "reenlightenment") + "reenlightenment", + "tlbflush") VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, "hidden") @@ -20282,6 +20283,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: @@ -22468,6 +22470,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: if (src->hyperv_features[i] != dst->hyperv_features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of HyperV enlightenment " @@ -28185,6 +28188,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: break; case VIR_DOMAIN_HYPERV_SPINLOCKS: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 97921284ac9e44b037e91df1c7e6e5bf4fc9f3b3..e7f5a95e94b045c2dd9ebf3ff81669aaec33e799 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1793,6 +1793,7 @@ typedef enum { VIR_DOMAIN_HYPERV_VENDOR_ID, VIR_DOMAIN_HYPERV_FREQUENCIES, VIR_DOMAIN_HYPERV_REENLIGHTENMENT, + VIR_DOMAIN_HYPERV_TLBFLUSH, VIR_DOMAIN_HYPERV_LAST } virDomainHyperv; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7a48b78eb92893ab3493c039a86e237342a103d2..7fa84f6014c92c0f675c08d9c6239604f8fc4e85 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -113,6 +113,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_FREQUENCIES, 0x40000003, 0x00000800); KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT, 0x40000003, 0x00002000); +KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH, + 0x40000004, 0x00000004); static virCPUx86Feature x86_kvm_features[] = { @@ -135,6 +137,7 @@ static virCPUx86Feature x86_kvm_features[] = KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET), KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES), KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT), + KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH), }; typedef struct _virCPUx86Model virCPUx86Model; diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index a810c64fc92cdd452d2e7059cb0b7591da27a291..090a21156f0819553bea3aa6d2df2a53c0c7210b 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_RESET "__kvm_hv_reset" # 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_DATA_INIT { 0 } diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 08af6c9784195155605b15250afbeee7ddb5a749..ec46db5c360d58c778f13df2146d45dcc8376e44 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6868,6 +6868,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: 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 1e67a5a8c82918c6b3e48fe0dc5002bb3a7f328e..fdc1d3406873cd21d360167dd6a0f49d54efafa3 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -1538,6 +1538,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: 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 84f8534d3cac550f526692e5cd568c50b74dedb1..b42fda850fd4b3621db535c272c7439073af611a 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3914,6 +3914,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, case VIR_DOMAIN_HYPERV_RESET: case VIR_DOMAIN_HYPERV_FREQUENCIES: case VIR_DOMAIN_HYPERV_REENLIGHTENMENT: + case VIR_DOMAIN_HYPERV_TLBFLUSH: 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 b2e3612df9144e101e48dbd39bf41a706bdedc64..dc5777355f5d64e39f4bb14da0276acbf6a4d089 100644 --- a/tests/qemuxml2argvdata/hyperv-off.xml +++ b/tests/qemuxml2argvdata/hyperv-off.xml @@ -22,6 +22,7 @@ + diff --git a/tests/qemuxml2argvdata/hyperv.args b/tests/qemuxml2argvdata/hyperv.args index 304629fbdedb22444035c37a88a7785b48f92cdd..c55204b0c88a57838de72044e351163723d68cb4 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_reenlightenment,hv_tlbflush' \ -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 20fcdba59e1886d0c2a283b5b09d88851184b903..816adf6907e17ad75b127b5e2dccfd028ced4c50 100644 --- a/tests/qemuxml2argvdata/hyperv.xml +++ b/tests/qemuxml2argvdata/hyperv.xml @@ -22,6 +22,7 @@ + diff --git a/tests/qemuxml2xmloutdata/hyperv-off.xml b/tests/qemuxml2xmloutdata/hyperv-off.xml index 4a41e0c37ee9ffc4e5fbd32bb26f195780d7bd3b..77a8dac8104a3b60bc38d6155b57541562318c64 100644 --- a/tests/qemuxml2xmloutdata/hyperv-off.xml +++ b/tests/qemuxml2xmloutdata/hyperv-off.xml @@ -22,6 +22,7 @@ + diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata/hyperv.xml index 183b45980bd2492feead58aebe547aca937763fc..fc8c59a5577adf2a39d60d76dc24748c61855c3a 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -22,6 +22,7 @@ +