kvm.c (6e2d6b2728fcb408eabd7991804f8cb33ff59f20) kvm.c (5c83511bdb9832c86be20fb86b783356e2f58062)
1/*
2 * KVM paravirt_ops implementation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 269 unchanged lines hidden (view full) ---

278}
279NOKPROBE_SYMBOL(do_async_page_fault);
280
281static void __init paravirt_ops_setup(void)
282{
283 pv_info.name = "KVM";
284
285 if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
1/*
2 * KVM paravirt_ops implementation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *

--- 269 unchanged lines hidden (view full) ---

278}
279NOKPROBE_SYMBOL(do_async_page_fault);
280
281static void __init paravirt_ops_setup(void)
282{
283 pv_info.name = "KVM";
284
285 if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
286 pv_cpu_ops.io_delay = kvm_io_delay;
286 pv_ops.cpu.io_delay = kvm_io_delay;
287
288#ifdef CONFIG_X86_IO_APIC
289 no_timer_check = 1;
290#endif
291}
292
293static void kvm_register_steal_time(void)
294{

--- 332 unchanged lines hidden (view full) ---

627 register_reboot_notifier(&kvm_pv_reboot_nb);
628 for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
629 raw_spin_lock_init(&async_pf_sleepers[i].lock);
630 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF))
631 x86_init.irqs.trap_init = kvm_apf_trap_init;
632
633 if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
634 has_steal_clock = 1;
287
288#ifdef CONFIG_X86_IO_APIC
289 no_timer_check = 1;
290#endif
291}
292
293static void kvm_register_steal_time(void)
294{

--- 332 unchanged lines hidden (view full) ---

627 register_reboot_notifier(&kvm_pv_reboot_nb);
628 for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++)
629 raw_spin_lock_init(&async_pf_sleepers[i].lock);
630 if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF))
631 x86_init.irqs.trap_init = kvm_apf_trap_init;
632
633 if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
634 has_steal_clock = 1;
635 pv_time_ops.steal_clock = kvm_steal_clock;
635 pv_ops.time.steal_clock = kvm_steal_clock;
636 }
637
638 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
639 !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
640 kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
636 }
637
638 if (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
639 !kvm_para_has_hint(KVM_HINTS_REALTIME) &&
640 kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
641 pv_mmu_ops.flush_tlb_others = kvm_flush_tlb_others;
642 pv_mmu_ops.tlb_remove_table = tlb_remove_table;
641 pv_ops.mmu.flush_tlb_others = kvm_flush_tlb_others;
642 pv_ops.mmu.tlb_remove_table = tlb_remove_table;
643 }
644
645 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
646 apic_set_eoi_write(kvm_guest_apic_eoi_write);
647
648#ifdef CONFIG_SMP
649 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;
650 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;

--- 194 unchanged lines hidden (view full) ---

845 if (kvm_para_has_hint(KVM_HINTS_REALTIME))
846 return;
847
848 /* Don't use the pvqspinlock code if there is only 1 vCPU. */
849 if (num_possible_cpus() == 1)
850 return;
851
852 __pv_init_lock_hash();
643 }
644
645 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
646 apic_set_eoi_write(kvm_guest_apic_eoi_write);
647
648#ifdef CONFIG_SMP
649 smp_ops.smp_prepare_cpus = kvm_smp_prepare_cpus;
650 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;

--- 194 unchanged lines hidden (view full) ---

845 if (kvm_para_has_hint(KVM_HINTS_REALTIME))
846 return;
847
848 /* Don't use the pvqspinlock code if there is only 1 vCPU. */
849 if (num_possible_cpus() == 1)
850 return;
851
852 __pv_init_lock_hash();
853 pv_lock_ops.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath;
854 pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock);
855 pv_lock_ops.wait = kvm_wait;
856 pv_lock_ops.kick = kvm_kick_cpu;
853 pv_ops.lock.queued_spin_lock_slowpath = __pv_queued_spin_lock_slowpath;
854 pv_ops.lock.queued_spin_unlock =
855 PV_CALLEE_SAVE(__pv_queued_spin_unlock);
856 pv_ops.lock.wait = kvm_wait;
857 pv_ops.lock.kick = kvm_kick_cpu;
857
858 if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
858
859 if (kvm_para_has_feature(KVM_FEATURE_STEAL_TIME)) {
859 pv_lock_ops.vcpu_is_preempted =
860 pv_ops.lock.vcpu_is_preempted =
860 PV_CALLEE_SAVE(__kvm_vcpu_is_preempted);
861 }
862}
863
864#endif /* CONFIG_PARAVIRT_SPINLOCKS */
861 PV_CALLEE_SAVE(__kvm_vcpu_is_preempted);
862 }
863}
864
865#endif /* CONFIG_PARAVIRT_SPINLOCKS */