On 27/09/13 08:16, Shanker Balan wrote:
> Helo,
> 
> Now that XENHVM has been merged into the GENERIC kernel, I recompiled todays 
> -CURRENT (rev 255904)
> and hit the following panic. It seeems to be HyperV related.
> 
> GENERIC without "device hyperv" works properly. The hypervisor is XenServer 
> 6.2.
> 
> # HyperV drivers
> device          hyperv          # HyperV drivers 
> 
> Panic screenshots with backtrace at http://imgur.com/cZsDsKE&VCkh4VS

Hello,

This is because XenServer enables viridian by default when running HVM
guests. That makes Xen also announce itself as HyperV for compatibility
reasons, as a workaround you can try to disable viridian support (not
sure if this is possible on XenServer).

I'm attaching a patch that should solve the problem, Ccing the virt
mailing list and the persons that I think are involved in the HyperV
support for FreeBSD.

Roger.

diff --git a/sys/dev/hyperv/vmbus/hv_hv.c b/sys/dev/hyperv/vmbus/hv_hv.c
index e3f3ae0..64b10fb 100644
--- a/sys/dev/hyperv/vmbus/hv_hv.c
+++ b/sys/dev/hyperv/vmbus/hv_hv.c
@@ -88,6 +88,16 @@ hv_vmbus_query_hypervisor_presence(void)
 {
        u_int regs[4];
        int hyper_v_detected = 0;
+
+       /*
+        * The Xen Hypervisor also announces itself as HyperV when
+        * viridian support is enabled, but we should only use Xen
+        * in this case, so check for Xen first and disable HyperV
+        * support if Xen is found.
+        */
+       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 2286cf0..9539dd1 100644
--- a/sys/x86/xen/hvm.c
+++ b/sys/x86/xen/hvm.c
@@ -699,6 +699,7 @@ xen_hvm_init(enum xen_hvm_init_type init_type)
                        return;
 
                setup_xen_features();
+               vm_guest = VM_GUEST_XEN;
                break;
        case XEN_HVM_INIT_RESUME:
                if (error != 0)
_______________________________________________
freebsd-xen@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-xen
To unsubscribe, send any mail to "freebsd-xen-unsubscr...@freebsd.org"

Reply via email to