|
[PATCH 3/8] KVM: Initialize kvm_arch_ops on unload: msg#00246emulators.kvm.devel
From: Yoshimi Ichiyanagi <ichiyanagi.yoshimi@xxxxxxxxxxxxx> The latest version of kvm doesn't initialize kvm_arch_ops in kvm_init(), which causes an error with the following sequence. 1. Load the supported arch's module. 2. Load the unsupported arch's module. (loading error) 3. Unload the unsupported arch's module. You'll get the following error message after step 3. "BUG: unable to handle to handle kernel paging request at virtual address xxxxxxxx" The problem here is that the unsupported arch's module overwrites kvm_arch_ops of the supported arch's module at step 2. This patch initializes kvm_arch_ops upon loading architecture specific kvm module, and prevents overwriting kvm_arch_ops when kvm_arch_ops is already set correctly. Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx> Index: linux-2.6/drivers/kvm/kvm_main.c =================================================================== --- linux-2.6.orig/drivers/kvm/kvm_main.c +++ linux-2.6/drivers/kvm/kvm_main.c @@ -1865,6 +1865,11 @@ int kvm_init_arch(struct kvm_arch_ops *o { int r; + if (kvm_arch_ops) { + printk(KERN_ERR "kvm: already loaded the other module\n"); + return -EEXIST; + } + kvm_arch_ops = ops; if (!kvm_arch_ops->cpu_has_kvm_support()) { @@ -1907,6 +1912,7 @@ void kvm_exit_arch(void) unregister_reboot_notifier(&kvm_reboot_notifier); on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); kvm_arch_ops->hardware_unsetup(); + kvm_arch_ops = NULL; } static __init int kvm_init(void) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [PATCH 2/8] KVM: Simplify is_long_mode(): 00246, Avi Kivity |
|---|---|
| Next by Date: | [PATCH 4/8] KVM: Implement a few system configuration msrs: 00246, Avi Kivity |
| Previous by Thread: | [PATCH 2/8] KVM: Simplify is_long_mode()i: 00246, Avi Kivity |
| Next by Thread: | [PATCH 4/8] KVM: Implement a few system configuration msrs: 00246, Avi Kivity |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |