Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2007 17:39:21 +0100
From:      Fabio Checconi <fabio@freebsd.org>
To:        Milos Vyletel <mv@rulez.sk>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Linux KVM FreeBSD 8.0-CURRENT amd64
Message-ID:  <20071105163921.GF58179@gandalf.sssup.it>
In-Reply-To: <20071105135235.GA51986@rulez.sk>
References:  <20071105135235.GA51986@rulez.sk>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> From: Milos Vyletel <mv@rulez.sk>
> 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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071105163921.GF58179>