From owner-freebsd-xen@FreeBSD.ORG Fri Sep 27 14:50:59 2013 Return-Path: Delivered-To: freebsd-xen@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 77027C20; Fri, 27 Sep 2013 14:50:59 +0000 (UTC) (envelope-from roger.pau@citrix.com) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3737026EE; Fri, 27 Sep 2013 14:50:57 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.90,993,1371081600"; d="scan'208";a="55549937" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 27 Sep 2013 14:50:49 +0000 Received: from [IPv6:::1] (10.80.16.47) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Fri, 27 Sep 2013 10:50:49 -0400 Message-ID: <52459B47.8030101@citrix.com> Date: Fri, 27 Sep 2013 16:50:47 +0200 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Shanker Balan Subject: Re: Latest current -CURRENT (rev 255904) panics with "device hyperv" on XenServer 6.2 References: <7943FB36-C6F4-4529-A805-2C467192231F@shankerbalan.net> In-Reply-To: <7943FB36-C6F4-4529-A805-2C467192231F@shankerbalan.net> Content-Type: multipart/mixed; boundary="------------020200080305020009060200" X-DLP: MIA2 Cc: "freebsd-xen@freebsd.org" , abgupta@microsoft.com, grehan@FreeBSD.org, "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 14:50:59 -0000 --------------020200080305020009060200 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit 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. --------------020200080305020009060200 Content-Type: text/plain; charset="UTF-8"; x-mac-type=0; x-mac-creator=0; name="xen_hyperv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_hyperv.patch" 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) --------------020200080305020009060200--