Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm

* 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: Prevent kvm_init from corrupting debugfs structures
KVM: MMU: fix pointer cast
KVM: use proper hrtimer function to retrieve expiration time

+15 -12
+1 -1
arch/x86/kvm/i8254.c
··· 116 116 * itself with the initial count and continues counting 117 117 * from there. 118 118 */ 119 - remaining = hrtimer_expires_remaining(&ps->pit_timer.timer); 119 + remaining = hrtimer_get_remaining(&ps->pit_timer.timer); 120 120 elapsed = ps->pit_timer.period - ktime_to_ns(remaining); 121 121 elapsed = mod_64(elapsed, ps->pit_timer.period); 122 122
+1 -1
arch/x86/kvm/lapic.c
··· 521 521 if (apic_get_reg(apic, APIC_TMICT) == 0) 522 522 return 0; 523 523 524 - remaining = hrtimer_expires_remaining(&apic->lapic_timer.timer); 524 + remaining = hrtimer_get_remaining(&apic->lapic_timer.timer); 525 525 if (ktime_to_ns(remaining) < 0) 526 526 remaining = ktime_set(0, 0); 527 527
+10 -6
arch/x86/kvm/mmu.c
··· 748 748 return write_protected; 749 749 } 750 750 751 - static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) 751 + static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, 752 + unsigned long data) 752 753 { 753 754 u64 *spte; 754 755 int need_tlb_flush = 0; ··· 764 763 return need_tlb_flush; 765 764 } 766 765 767 - static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) 766 + static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, 767 + unsigned long data) 768 768 { 769 769 int need_flush = 0; 770 770 u64 *spte, new_spte; ··· 801 799 return 0; 802 800 } 803 801 804 - static int kvm_handle_hva(struct kvm *kvm, unsigned long hva, u64 data, 802 + static int kvm_handle_hva(struct kvm *kvm, unsigned long hva, 803 + unsigned long data, 805 804 int (*handler)(struct kvm *kvm, unsigned long *rmapp, 806 - u64 data)) 805 + unsigned long data)) 807 806 { 808 807 int i, j; 809 808 int retval = 0; ··· 849 846 850 847 void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte) 851 848 { 852 - kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp); 849 + kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp); 853 850 } 854 851 855 - static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) 852 + static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, 853 + unsigned long data) 856 854 { 857 855 u64 *spte; 858 856 int young = 0;
+3 -4
virt/kvm/kvm_main.c
··· 2717 2717 int r; 2718 2718 int cpu; 2719 2719 2720 - kvm_init_debug(); 2721 - 2722 2720 r = kvm_arch_init(opaque); 2723 2721 if (r) 2724 2722 goto out_fail; ··· 2783 2785 kvm_preempt_ops.sched_in = kvm_sched_in; 2784 2786 kvm_preempt_ops.sched_out = kvm_sched_out; 2785 2787 2788 + kvm_init_debug(); 2789 + 2786 2790 return 0; 2787 2791 2788 2792 out_free: ··· 2807 2807 out: 2808 2808 kvm_arch_exit(); 2809 2809 out_fail: 2810 - kvm_exit_debug(); 2811 2810 return r; 2812 2811 } 2813 2812 EXPORT_SYMBOL_GPL(kvm_init); ··· 2814 2815 void kvm_exit(void) 2815 2816 { 2816 2817 tracepoint_synchronize_unregister(); 2818 + kvm_exit_debug(); 2817 2819 misc_deregister(&kvm_dev); 2818 2820 kmem_cache_destroy(kvm_vcpu_cache); 2819 2821 sysdev_unregister(&kvm_sysdev); ··· 2824 2824 on_each_cpu(hardware_disable, NULL, 1); 2825 2825 kvm_arch_hardware_unsetup(); 2826 2826 kvm_arch_exit(); 2827 - kvm_exit_debug(); 2828 2827 free_cpumask_var(cpus_hardware_enabled); 2829 2828 __free_page(bad_page); 2830 2829 }