From owner-freebsd-current@FreeBSD.ORG Mon Nov 5 17:38:25 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91DC916A417 for ; Mon, 5 Nov 2007 17:38:25 +0000 (UTC) (envelope-from fabio@freebsd.org) Received: from sssup.it (ms01.sssup.it [193.205.80.99]) by mx1.freebsd.org (Postfix) with ESMTP id E084113C480 for ; Mon, 5 Nov 2007 17:38:24 +0000 (UTC) (envelope-from fabio@freebsd.org) Received: from [193.205.82.7] (HELO gandalf.sssup.it) by sssup.it (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 35666344; Mon, 05 Nov 2007 17:24:49 +0100 Received: from sauron.retis (sauron.retis [10.30.3.13]) by gandalf.sssup.it (8.12.10/8.12.10) with ESMTP id lA5FW5kw010721; Mon, 5 Nov 2007 16:32:05 +0100 Received: by sauron.retis (Postfix, from userid 1001) id D350939837; Mon, 5 Nov 2007 17:39:21 +0100 (CET) Date: Mon, 5 Nov 2007 17:39:21 +0100 From: Fabio Checconi To: Milos Vyletel Message-ID: <20071105163921.GF58179@gandalf.sssup.it> Mail-Followup-To: Milos Vyletel , freebsd-current@freebsd.org References: <20071105135235.GA51986@rulez.sk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071105135235.GA51986@rulez.sk> User-Agent: Mutt/1.4.2.3i Cc: freebsd-current@freebsd.org Subject: Re: Linux KVM FreeBSD 8.0-CURRENT amd64 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2007 17:38:25 -0000 Hi, > From: Milos Vyletel > Date: Mon, Nov 05, 2007 02:52:35PM +0100 > > Hi Fabio, > > recently a found out about your SoC project and today I finnaly had time to > test it. Unfortunatelly it fails to load kernel module with following error > > # kldload ./lkvm.so ./svm.ko > link_elf_obj: symbol M_USBDEV undefined > kldload: Unsupported file type > KLD svm.ko: depends on lkvm - not available > kldload: Unsupported file type > > Don't know if it's important, but I have usb loaded as kld, not built in kernel > and my machine is Core 2 Quad with 4GB ram running amd64 CURRENT. > thanks for trying out the code. The problem should be the one you point out, i.e., you're using usb as a module; the kvm modules do not declare explicitly their dependency from usb (they inherit this dependency from linux-kmod-compat, that was born to support usb drivers, and has some usb specific code.) With Intel processors you should use the vmx.ko module and not svm.ko (I'll fix that in the documentation.) Actually loading svm.ko on Intel machines ends up in a panic. This patch should fix the problem, even if I think a long term solution would involve turning linux-kmod-compat into a kernel module on its own, rather than using it as a library, as it's done now. Can you please (git-)apply it to HEAD and try it out? Thanks. diff --git a/lkvm/kvm_main.c b/lkvm/kvm_main.c index 15395ed..79d833e 100644 --- a/lkvm/kvm_main.c +++ b/lkvm/kvm_main.c @@ -2815,6 +2815,7 @@ static moduledata_t mod_data = { DECLARE_MODULE(lkvm, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_VERSION(lkvm, 1); +MODULE_DEPEND(lkvm, usb, 1, 1, 1); #endif diff --git a/lkvm/svm.c b/lkvm/svm.c index 441a7e1..68a1fa5 100644 --- a/lkvm/svm.c +++ b/lkvm/svm.c @@ -1835,6 +1835,7 @@ static moduledata_t mod_data = { DECLARE_MODULE(svm, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_VERSION(svm, 1); MODULE_DEPEND(svm, lkvm, 1, 1, 1); +MODULE_DEPEND(svm, usb, 1, 1, 1); #endif diff --git a/lkvm/vmx.c b/lkvm/vmx.c index bdfe92f..67337db 100644 --- a/lkvm/vmx.c +++ b/lkvm/vmx.c @@ -2153,6 +2153,7 @@ static moduledata_t mod_data = { DECLARE_MODULE(vmx, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_VERSION(vmx, 1); MODULE_DEPEND(vmx, lkvm, 1, 1, 1); +MODULE_DEPEND(vmx, usb, 1, 1, 1); #endif