diff options
| author | Johannes Berg <johannes.berg@intel.com> | 2013-12-16 05:23:45 -0500 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2013-12-16 05:23:45 -0500 |
| commit | c4de673b775e4db48cd2db6277e0c6714332ca0c (patch) | |
| tree | 84f9e4728e6ccf257236d2ba063b6e784ec8b65d /include/linux/kvm_host.h | |
| parent | bafdc614a1f4f8be8cde41b8ab10ac17e67c1837 (diff) | |
| parent | 55957fb7a0b61d8ab6ff3f04e279b8fc22b738fa (diff) | |
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
Diffstat (limited to 'include/linux/kvm_host.h')
| -rw-r--r-- | include/linux/kvm_host.h | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 0fbbc7aa02cb..9523d2ad7535 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -142,7 +142,7 @@ struct kvm; | |||
| 142 | struct kvm_vcpu; | 142 | struct kvm_vcpu; |
| 143 | extern struct kmem_cache *kvm_vcpu_cache; | 143 | extern struct kmem_cache *kvm_vcpu_cache; |
| 144 | 144 | ||
| 145 | extern raw_spinlock_t kvm_lock; | 145 | extern spinlock_t kvm_lock; |
| 146 | extern struct list_head vm_list; | 146 | extern struct list_head vm_list; |
| 147 | 147 | ||
| 148 | struct kvm_io_range { | 148 | struct kvm_io_range { |
| @@ -189,8 +189,7 @@ struct kvm_async_pf { | |||
| 189 | gva_t gva; | 189 | gva_t gva; |
| 190 | unsigned long addr; | 190 | unsigned long addr; |
| 191 | struct kvm_arch_async_pf arch; | 191 | struct kvm_arch_async_pf arch; |
| 192 | struct page *page; | 192 | bool wakeup_all; |
| 193 | bool done; | ||
| 194 | }; | 193 | }; |
| 195 | 194 | ||
| 196 | void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); | 195 | void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu); |
| @@ -508,9 +507,10 @@ int kvm_set_memory_region(struct kvm *kvm, | |||
| 508 | struct kvm_userspace_memory_region *mem); | 507 | struct kvm_userspace_memory_region *mem); |
| 509 | int __kvm_set_memory_region(struct kvm *kvm, | 508 | int __kvm_set_memory_region(struct kvm *kvm, |
| 510 | struct kvm_userspace_memory_region *mem); | 509 | struct kvm_userspace_memory_region *mem); |
| 511 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | 510 | void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free, |
| 512 | struct kvm_memory_slot *dont); | 511 | struct kvm_memory_slot *dont); |
| 513 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | 512 | int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot, |
| 513 | unsigned long npages); | ||
| 514 | void kvm_arch_memslots_updated(struct kvm *kvm); | 514 | void kvm_arch_memslots_updated(struct kvm *kvm); |
| 515 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 515 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
| 516 | struct kvm_memory_slot *memslot, | 516 | struct kvm_memory_slot *memslot, |
| @@ -671,6 +671,25 @@ static inline void kvm_arch_free_vm(struct kvm *kvm) | |||
| 671 | } | 671 | } |
| 672 | #endif | 672 | #endif |
| 673 | 673 | ||
| 674 | #ifdef __KVM_HAVE_ARCH_NONCOHERENT_DMA | ||
| 675 | void kvm_arch_register_noncoherent_dma(struct kvm *kvm); | ||
| 676 | void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm); | ||
| 677 | bool kvm_arch_has_noncoherent_dma(struct kvm *kvm); | ||
| 678 | #else | ||
| 679 | static inline void kvm_arch_register_noncoherent_dma(struct kvm *kvm) | ||
| 680 | { | ||
| 681 | } | ||
| 682 | |||
| 683 | static inline void kvm_arch_unregister_noncoherent_dma(struct kvm *kvm) | ||
| 684 | { | ||
| 685 | } | ||
| 686 | |||
| 687 | static inline bool kvm_arch_has_noncoherent_dma(struct kvm *kvm) | ||
| 688 | { | ||
| 689 | return false; | ||
| 690 | } | ||
| 691 | #endif | ||
| 692 | |||
| 674 | static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) | 693 | static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) |
| 675 | { | 694 | { |
| 676 | #ifdef __KVM_HAVE_ARCH_WQP | 695 | #ifdef __KVM_HAVE_ARCH_WQP |
| @@ -747,9 +766,6 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | |||
| 747 | int kvm_request_irq_source_id(struct kvm *kvm); | 766 | int kvm_request_irq_source_id(struct kvm *kvm); |
| 748 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 767 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
| 749 | 768 | ||
| 750 | /* For vcpu->arch.iommu_flags */ | ||
| 751 | #define KVM_IOMMU_CACHE_COHERENCY 0x1 | ||
| 752 | |||
| 753 | #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT | 769 | #ifdef CONFIG_KVM_DEVICE_ASSIGNMENT |
| 754 | int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot); | 770 | int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot); |
| 755 | void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot); | 771 | void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot); |
| @@ -789,7 +805,7 @@ static inline void kvm_guest_enter(void) | |||
| 789 | 805 | ||
| 790 | /* KVM does not hold any references to rcu protected data when it | 806 | /* KVM does not hold any references to rcu protected data when it |
| 791 | * switches CPU into a guest mode. In fact switching to a guest mode | 807 | * switches CPU into a guest mode. In fact switching to a guest mode |
| 792 | * is very similar to exiting to userspase from rcu point of view. In | 808 | * is very similar to exiting to userspace from rcu point of view. In |
| 793 | * addition CPU may stay in a guest mode for quite a long time (up to | 809 | * addition CPU may stay in a guest mode for quite a long time (up to |
| 794 | * one time slice). Lets treat guest mode as quiescent state, just like | 810 | * one time slice). Lets treat guest mode as quiescent state, just like |
| 795 | * we do with user-mode execution. | 811 | * we do with user-mode execution. |
| @@ -842,13 +858,6 @@ static inline int memslot_id(struct kvm *kvm, gfn_t gfn) | |||
| 842 | return gfn_to_memslot(kvm, gfn)->id; | 858 | return gfn_to_memslot(kvm, gfn)->id; |
| 843 | } | 859 | } |
| 844 | 860 | ||
| 845 | static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) | ||
| 846 | { | ||
| 847 | /* KVM_HPAGE_GFN_SHIFT(PT_PAGE_TABLE_LEVEL) must be 0. */ | ||
| 848 | return (gfn >> KVM_HPAGE_GFN_SHIFT(level)) - | ||
| 849 | (base_gfn >> KVM_HPAGE_GFN_SHIFT(level)); | ||
| 850 | } | ||
| 851 | |||
| 852 | static inline gfn_t | 861 | static inline gfn_t |
| 853 | hva_to_gfn_memslot(unsigned long hva, struct kvm_memory_slot *slot) | 862 | hva_to_gfn_memslot(unsigned long hva, struct kvm_memory_slot *slot) |
| 854 | { | 863 | { |
| @@ -1066,6 +1075,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp); | |||
| 1066 | 1075 | ||
| 1067 | extern struct kvm_device_ops kvm_mpic_ops; | 1076 | extern struct kvm_device_ops kvm_mpic_ops; |
| 1068 | extern struct kvm_device_ops kvm_xics_ops; | 1077 | extern struct kvm_device_ops kvm_xics_ops; |
| 1078 | extern struct kvm_device_ops kvm_vfio_ops; | ||
| 1069 | 1079 | ||
| 1070 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT | 1080 | #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT |
| 1071 | 1081 | ||
