From: Glauber Costa <glom...@t60.(none)> There is no reason why kvm_init_ap() and friends are placed outside kvm_init(). After we call kvm_init(), no extra initialization step should be necessary. There are now no references to KVM_UPSTREAM outside of kvm*.c files
Signed-off-by: Glauber Costa <glom...@t60.(none)> Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> diff --git a/qemu-kvm.c b/qemu-kvm.c index 5e7dc0a..32dce4a 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -2111,6 +2111,8 @@ int kvm_arch_init_irq_routing(void) } #endif +extern int no_hpet; + static int kvm_create_context() { int r; @@ -2143,6 +2145,24 @@ static int kvm_create_context() return r; } + kvm_init_ap(); + if (kvm_irqchip) { + if (!qemu_kvm_has_gsi_routing()) { + irq0override = 0; +#ifdef TARGET_I386 + /* if kernel can't do irq routing, interrupt source + * override 0->2 can not be set up as required by hpet, + * so disable hpet. + */ + no_hpet=1; + } else if (!qemu_kvm_has_pit_state2()) { + no_hpet=1; + } +#else + } +#endif + } + return 0; } diff --git a/vl.c b/vl.c index 8ea0771..74a1c60 100644 --- a/vl.c +++ b/vl.c @@ -5998,28 +5998,6 @@ int main(int argc, char **argv, char **envp) module_call_init(MODULE_INIT_DEVICE); - if (kvm_enabled()) { - kvm_init_ap(); -#ifdef CONFIG_KVM - if (kvm_irqchip) { - if (!qemu_kvm_has_gsi_routing()) { - irq0override = 0; -#ifdef TARGET_I386 - /* if kernel can't do irq routing, interrupt source - * override 0->2 can not be set up as required by hpet, - * so disable hpet. - */ - no_hpet=1; - } else if (!qemu_kvm_has_pit_state2()) { - no_hpet=1; - } -#else - } -#endif - } -#endif - } - machine->init(ram_size, boot_devices, kernel_filename, kernel_cmdline, initrd_filename, cpu_model); -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html