diff options
-rw-r--r-- | sys/dev/hyperv/vmbus/hv_hv.c | 10 | ||||
-rw-r--r-- | sys/x86/xen/hvm.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c index e3f3ae0..c316732 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 <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/malloc.h> @@ -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 bb7bb5b..510b8b9 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) |