qemu supports this enlightenment since version 7.10.
From the qemu commit:
The newly introduced enlightenment allow L0 (KVM) and L1 (Hyper-V)
hypervisors to collaborate to avoid unnecessary updates to L2
MSR-Bitmap upon vmexits.
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
<tlbflush state='on'/>
<ipi state='on'/>
<evmcs state='on'/>
+ <emsr_bitmap state='on'/>
</hyperv>
<kvm>
<hidden state='on'/>
ipi Enable PV IPI support on, off :since:`4.10.0 (QEMU 3.1)`
evmcs Enable Enlightened VMCS on, off :since:`4.10.0 (QEMU 3.1)`
avic Enable use Hyper-V SynIC with hardware APICv/AVIC on, off :since:`8.10.0 (QEMU 6.2)`
+ emsr_bitmap Avoid unnecessary updates to L2 MSR Bitmap upon vmexits. on, off :since:`10.7.0 (QEMU 7.1)`
=============== ====================================================================== ============================================ =======================================================
:since:`Since 8.0.0`, the hypervisor can be configured further by setting
"ipi",
"evmcs",
"avic",
+ "emsr_bitmap",
);
VIR_ENUM_IMPL(virDomainKVM,
case VIR_DOMAIN_HYPERV_IPI:
case VIR_DOMAIN_HYPERV_EVMCS:
case VIR_DOMAIN_HYPERV_AVIC:
+ case VIR_DOMAIN_HYPERV_EMSR_BITMAP:
break;
case VIR_DOMAIN_HYPERV_STIMER:
case VIR_DOMAIN_HYPERV_IPI:
case VIR_DOMAIN_HYPERV_EVMCS:
case VIR_DOMAIN_HYPERV_AVIC:
+ case VIR_DOMAIN_HYPERV_EMSR_BITMAP:
if (src->hyperv_features[i] != dst->hyperv_features[i]) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of HyperV enlightenment feature '%1$s' differs: source: '%2$s', destination: '%3$s'"),
case VIR_DOMAIN_HYPERV_IPI:
case VIR_DOMAIN_HYPERV_EVMCS:
case VIR_DOMAIN_HYPERV_AVIC:
+ case VIR_DOMAIN_HYPERV_EMSR_BITMAP:
virBufferAddLit(&childBuf, "/>\n");
break;
VIR_DOMAIN_HYPERV_IPI,
VIR_DOMAIN_HYPERV_EVMCS,
VIR_DOMAIN_HYPERV_AVIC,
+ VIR_DOMAIN_HYPERV_EMSR_BITMAP,
VIR_DOMAIN_HYPERV_LAST
} virDomainHyperv;
<ref name="featurestate"/>
</element>
</optional>
+ <optional>
+ <element name="emsr_bitmap">
+ <ref name="featurestate"/>
+ </element>
+ </optional>
</interleave>
</group>
</choice>
KVM_FEATURE_DEF(VIR_CPU_x86_HV_EVMCS,
0x40000004, 0x00004000, 0x0);
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_EMSR_BITMAP,
+ 0x4000000A, 0x00080000, 0x0);
+
static virCPUx86Feature x86_kvm_features[] =
{
KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT),
KVM_FEATURE(VIR_CPU_x86_HV_IPI),
KVM_FEATURE(VIR_CPU_x86_HV_EVMCS),
KVM_FEATURE(VIR_CPU_x86_HV_STIMER_DIRECT),
+ KVM_FEATURE(VIR_CPU_x86_HV_EMSR_BITMAP),
};
typedef struct _virCPUx86Signature virCPUx86Signature;
#define VIR_CPU_x86_HV_IPI "hv-ipi"
#define VIR_CPU_x86_HV_EVMCS "hv-evmcs"
#define VIR_CPU_x86_HV_AVIC "hv-avic"
+#define VIR_CPU_x86_HV_EMSR_BITMAP "hv-emsr_bitmap"
/* Hyper-V Synthetic Timer option */
#define VIR_CPU_x86_HV_STIMER_DIRECT "hv-stimer-direct"
def->hyperv_vendor_id);
break;
+ case VIR_DOMAIN_HYPERV_EMSR_BITMAP:
+ if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON)
+ virBufferAsprintf(&buf, ",%s=on", "hv-emsr-bitmap");
+ break;
+
case VIR_DOMAIN_HYPERV_LAST:
break;
}
case VIR_DOMAIN_HYPERV_IPI:
case VIR_DOMAIN_HYPERV_EVMCS:
case VIR_DOMAIN_HYPERV_AVIC:
+ case VIR_DOMAIN_HYPERV_EMSR_BITMAP:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("host doesn't support hyperv '%1$s' feature"),
virDomainHypervTypeToString(i));
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<value>tlbflush</value>
<value>ipi</value>
<value>avic</value>
+ <value>emsr_bitmap</value>
</enum>
</hyperv>
<launchSecurity supported='no'/>
<cap name='tlbflush'/>
<cap name='ipi'/>
<cap name='avic'/>
+ <cap name='emsr_bitmap'/>
</hypervCapabilities>
</qemuCaps>
<cap name='tlbflush'/>
<cap name='ipi'/>
<cap name='avic'/>
+ <cap name='emsr_bitmap'/>
</hypervCapabilities>
</qemuCaps>
<cap name='tlbflush'/>
<cap name='ipi'/>
<cap name='avic'/>
+ <cap name='emsr_bitmap'/>
</hypervCapabilities>
</qemuCaps>
<cap name='tlbflush'/>
<cap name='ipi'/>
<cap name='avic'/>
+ <cap name='emsr_bitmap'/>
</hypervCapabilities>
</qemuCaps>
<cap name='tlbflush'/>
<cap name='ipi'/>
<cap name='avic'/>
+ <cap name='emsr_bitmap'/>
</hypervCapabilities>
</qemuCaps>
<tlbflush state='off'/>
<ipi state='off'/>
<evmcs state='off'/>
+ <emsr_bitmap state='off'/>
</hyperv>
</features>
<cpu mode='custom' match='exact' check='none'>
<tlbflush state='off'/>
<ipi state='off'/>
<evmcs state='off'/>
+ <emsr_bitmap state='off'/>
</hyperv>
</features>
<clock offset='utc'/>
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \
-accel tcg \
--cpu 'qemu64,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x2fff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-ipi=on,hv-evmcs=on,hv-avic=on' \
+-cpu 'qemu64,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x2fff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-stimer=on,hv-reset=on,hv-vendor-id=KVM Hv,hv-frequencies=on,hv-reenlightenment=on,hv-tlbflush=on,hv-ipi=on,hv-evmcs=on,hv-avic=on,hv-emsr-bitmap=on' \
-m size=219136k \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
-overcommit mem-lock=off \
<ipi state='on'/>
<evmcs state='on'/>
<avic state='on'/>
+ <emsr_bitmap state='on'/>
</hyperv>
</features>
<cpu mode='custom' match='exact' check='none'>
<ipi state='on'/>
<evmcs state='on'/>
<avic state='on'/>
+ <emsr_bitmap state='on'/>
</hyperv>
</features>
<clock offset='utc'/>