diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c index e3f3ae0870f2..c31673216c5b 100644 --- a/sys/dev/hyperv/vmbus/hv_hv.c +++ b/sys/dev/hyperv/vmbus/hv_hv.c @@ -29,6 +29,8 @@ /** * Implements low-level interactions with Hypver-V/Azure */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -88,6 +90,14 @@ hv_vmbus_query_hypervisor_presence(void) { u_int regs[4]; int hyper_v_detected = 0; + + /* + * When Xen is detected and native Xen PV support is enabled, + * ignore Xen's HyperV emulation. + */ + if (vm_guest == VM_GUEST_XEN) + return (0); + do_cpuid(1, regs); if (regs[2] & 0x80000000) { /* if(a hypervisor is detected) */ /* make sure this really is Hyper-V */ diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index bb7bb5b3c288..510b8b9a9e7c 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -700,6 +700,7 @@ xen_hvm_init(enum xen_hvm_init_type init_type) setup_xen_features(); cpu_ops = xen_hvm_cpu_ops; + vm_guest = VM_GUEST_XEN; break; case XEN_HVM_INIT_RESUME: if (error != 0)