mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
conf: qemu: add support for Hyper-V reenlightenment notifications
Qemu-3.0 supports so-called 'Reenlightenment' notifications and this (in conjunction with 'hv-frequencies') can be used make Hyper-V on KVM pass stable TSC page clocksource to L2 guests. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
8253bca961
commit
b5d770e155
@ -1975,6 +1975,7 @@
|
||||
<reset state='on'/>
|
||||
<vendor_id state='on' value='KVM Hv'/>
|
||||
<frequencies state='on'/>
|
||||
<reenlightenment state='on'/>
|
||||
</hyperv>
|
||||
<kvm>
|
||||
<hidden state='on'/>
|
||||
@ -2103,6 +2104,12 @@
|
||||
<td> on, off</td>
|
||||
<td><span class="since">4.7.0 (QEMU 2.12)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>reenlightenment</td>
|
||||
<td>Enable re-enlightenment notification on migration</td>
|
||||
<td> on, off</td>
|
||||
<td><span class="since">4.7.0 (QEMU 3.0)</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</dd>
|
||||
<dt><code>pvspinlock</code></dt>
|
||||
|
@ -5738,6 +5738,11 @@
|
||||
<ref name="featurestate"/>
|
||||
</element>
|
||||
</optional>
|
||||
<optional>
|
||||
<element name="reenlightenment">
|
||||
<ref name="featurestate"/>
|
||||
</element>
|
||||
</optional>
|
||||
</interleave>
|
||||
</element>
|
||||
</define>
|
||||
|
@ -170,7 +170,8 @@ VIR_ENUM_IMPL(virDomainHyperv, VIR_DOMAIN_HYPERV_LAST,
|
||||
"stimer",
|
||||
"reset",
|
||||
"vendor_id",
|
||||
"frequencies")
|
||||
"frequencies",
|
||||
"reenlightenment")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST,
|
||||
"hidden")
|
||||
@ -20280,6 +20281,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HYPERV_SPINLOCKS:
|
||||
@ -22465,6 +22467,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
if (src->hyperv_features[i] != dst->hyperv_features[i]) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("State of HyperV enlightenment "
|
||||
@ -28181,6 +28184,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_HYPERV_SPINLOCKS:
|
||||
|
@ -1792,6 +1792,7 @@ typedef enum {
|
||||
VIR_DOMAIN_HYPERV_RESET,
|
||||
VIR_DOMAIN_HYPERV_VENDOR_ID,
|
||||
VIR_DOMAIN_HYPERV_FREQUENCIES,
|
||||
VIR_DOMAIN_HYPERV_REENLIGHTENMENT,
|
||||
|
||||
VIR_DOMAIN_HYPERV_LAST
|
||||
} virDomainHyperv;
|
||||
|
@ -111,6 +111,8 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RESET,
|
||||
0x40000003, 0x00000080);
|
||||
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_FREQUENCIES,
|
||||
0x40000003, 0x00000800);
|
||||
KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT,
|
||||
0x40000003, 0x00002000);
|
||||
|
||||
static virCPUx86Feature x86_kvm_features[] =
|
||||
{
|
||||
@ -132,6 +134,7 @@ static virCPUx86Feature x86_kvm_features[] =
|
||||
KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX),
|
||||
KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET),
|
||||
KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES),
|
||||
KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT),
|
||||
};
|
||||
|
||||
typedef struct _virCPUx86Model virCPUx86Model;
|
||||
|
@ -64,6 +64,7 @@ struct _virCPUx86CPUID {
|
||||
# define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex"
|
||||
# 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_DATA_INIT { 0 }
|
||||
|
@ -6867,6 +6867,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON)
|
||||
virBufferAsprintf(&buf, ",hv_%s",
|
||||
virDomainHypervTypeToString(i));
|
||||
|
@ -1537,6 +1537,7 @@ qemuParseCommandLineCPU(virDomainDefPtr dom,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
if (value) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("HyperV feature '%s' should not "
|
||||
|
@ -3913,6 +3913,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def,
|
||||
case VIR_DOMAIN_HYPERV_STIMER:
|
||||
case VIR_DOMAIN_HYPERV_RESET:
|
||||
case VIR_DOMAIN_HYPERV_FREQUENCIES:
|
||||
case VIR_DOMAIN_HYPERV_REENLIGHTENMENT:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("host doesn't support hyperv '%s' feature"),
|
||||
virDomainHypervTypeToString(i));
|
||||
|
@ -21,6 +21,7 @@
|
||||
<reset state='off'/>
|
||||
<vendor_id state='off'/>
|
||||
<frequencies state='off'/>
|
||||
<reenlightenment state='off'/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
|
@ -9,7 +9,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_synic,hv_stimer,hv_reset,hv_vendor_id=KVM Hv,hv_frequencies,\
|
||||
hv_reenlightenment' \
|
||||
-m 214 \
|
||||
-smp 6,sockets=6,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
|
@ -21,6 +21,7 @@
|
||||
<reset state='on'/>
|
||||
<vendor_id state='on' value='KVM Hv'/>
|
||||
<frequencies state='on'/>
|
||||
<reenlightenment state='on'/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
|
@ -21,6 +21,7 @@
|
||||
<reset state='off'/>
|
||||
<vendor_id state='off'/>
|
||||
<frequencies state='off'/>
|
||||
<reenlightenment state='off'/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
|
@ -21,6 +21,7 @@
|
||||
<reset state='on'/>
|
||||
<vendor_id state='on' value='KVM Hv'/>
|
||||
<frequencies state='on'/>
|
||||
<reenlightenment state='on'/>
|
||||
</hyperv>
|
||||
</features>
|
||||
<clock offset='utc'/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user