|
Re: [PATCH] kvm: initialize kvm_arch_ops in kvm_init(): msg#00253emulators.kvm.devel
>> static __init int kvm_init(void) >> @@ -1914,6 +1920,7 @@ static __init int kvm_init(void) >> static struct page *bad_page; >> int r = 0; >> >> + kvm_arch_ops = NULL; >> kvm_init_debug(); >> >> kvm_init_msr_list(); >> >> > >This bit is unnecessary, no? I think kvm_init() will only be called >after the module is loaded, at which point kvm_arch_ops is initialized >from the .bss section. > Logically it's not required, however it's better to initialize explicitly in general. By the way, the previous patch didn't fix the problem completely. You can't load the supported arch's module if you load the unsupported arch's module beforehand. The following patch will fix this problem. Please take a look. Signed-off-by: Yoshimi Ichiyanagi <ichiyanagi.yoshimi@xxxxxxxxxxxxx> Index: kvm_main.c =================================================================== --- kvm_main.c (revision 4190) +++ kvm_main.c (working copy) @@ -1972,17 +1972,17 @@ return -EEXIST; } - kvm_arch_ops = ops; - - if (!kvm_arch_ops->cpu_has_kvm_support()) { + if (!ops->cpu_has_kvm_support()) { printk(KERN_ERR "kvm: no hardware support\n"); return -EOPNOTSUPP; } - if (kvm_arch_ops->disabled_by_bios()) { + if (ops->disabled_by_bios()) { printk(KERN_ERR "kvm: disabled by bios\n"); return -EOPNOTSUPP; } + kvm_arch_ops = ops; + r = kvm_arch_ops->hardware_setup(); if (r < 0) return r; -- Yoshimi Ichiyanagi ------------------------------------------------------------------------- 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: | Re: [PATCH 0/8] KVM updates for 2.6.20-rc2: 00253, Ingo Molnar |
|---|---|
| Next by Date: | Re: [PATCH 0/8] KVM updates for 2.6.20-rc2: 00253, Avi Kivity |
| Previous by Thread: | Re: [PATCH] kvm: initialize kvm_arch_ops in kvm_init()i: 00253, Yoshimi Ichiyanagi |
| Next by Thread: | Re: [PATCH] kvm: initialize kvm_arch_ops in kvm_init(): 00253, Avi Kivity |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |