Re: Linux KVM FreeBSD 8.0-CURRENT amd64

From: Fabio Checconi <fabio_at_freebsd.org>
Date: Mon, 5 Nov 2007 17:39:21 +0100
Hi,

> From: Milos Vyletel <mv_at_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
_at__at_ -2815,6 +2815,7 _at__at_ 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
_at__at_ -1835,6 +1835,7 _at__at_ 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
_at__at_ -2153,6 +2153,7 _at__at_ 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
 
Received on Mon Nov 05 2007 - 16:38:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:21 UTC