diff options
author | gibbs <gibbs@FreeBSD.org> | 2013-10-05 19:51:09 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2013-10-05 19:51:09 +0000 |
commit | 716c2031c71f1b1fbd78da6494f5c5e2a5115e9b (patch) | |
tree | 9e10b27ab32e89b88eed965f2e5b47be7f6f9610 /sys/dev/hyperv/vmbus | |
parent | e6885256cdc6759add16ed571a19768419ac65ef (diff) | |
download | FreeBSD-src-716c2031c71f1b1fbd78da6494f5c5e2a5115e9b.zip FreeBSD-src-716c2031c71f1b1fbd78da6494f5c5e2a5115e9b.tar.gz |
Correct panic caused by attaching both Xen PV and HyperV virtualization
aware drivers on Xen hypervisors that advertise support for some
HyperV features.
x86/xen/hvm.c:
When running in HVM mode on a Xen hypervisor, set vm_guest
to VM_GUEST_XEN so other virtualization aware components in
the FreeBSD kernel can detect this mode is active.
dev/hyperv/vmbus/hv_hv.c:
Use vm_guest to ignore Xen's HyperV emulation when Xen is
detected and Xen PV drivers are active.
Reported by: Shanker Balan
Submitted by: Roger Pau Monné
Sponsored by: Citrix Systems R&D
Reviewed by: gibbs
Approved by: re (Xen blanket)
Diffstat (limited to 'sys/dev/hyperv/vmbus')
-rw-r--r-- | sys/dev/hyperv/vmbus/hv_hv.c | 10 |
1 files changed, 10 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 */ |