aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a0557422715e..e56acc7857e2 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -40,6 +40,7 @@
40#define KVM_REQ_KICK 9 40#define KVM_REQ_KICK 9
41#define KVM_REQ_DEACTIVATE_FPU 10 41#define KVM_REQ_DEACTIVATE_FPU 10
42#define KVM_REQ_EVENT 11 42#define KVM_REQ_EVENT 11
43#define KVM_REQ_APF_HALT 12
43 44
44#define KVM_USERSPACE_IRQ_SOURCE_ID 0 45#define KVM_USERSPACE_IRQ_SOURCE_ID 0
45 46
@@ -74,6 +75,26 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
74int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 75int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
75 struct kvm_io_device *dev); 76 struct kvm_io_device *dev);
76 77
78#ifdef CONFIG_KVM_ASYNC_PF
79struct kvm_async_pf {
80 struct work_struct work;
81 struct list_head link;
82 struct list_head queue;
83 struct kvm_vcpu *vcpu;
84 struct mm_struct *mm;
85 gva_t gva;
86 unsigned long addr;
87 struct kvm_arch_async_pf arch;
88 struct page *page;
89 bool done;
90};
91
92void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu);
93void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu);
94int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
95 struct kvm_arch_async_pf *arch);
96#endif
97
77struct kvm_vcpu { 98struct kvm_vcpu {
78 struct kvm *kvm; 99 struct kvm *kvm;
79#ifdef CONFIG_PREEMPT_NOTIFIERS 100#ifdef CONFIG_PREEMPT_NOTIFIERS
@@ -104,6 +125,15 @@ struct kvm_vcpu {
104 gpa_t mmio_phys_addr; 125 gpa_t mmio_phys_addr;
105#endif 126#endif
106 127
128#ifdef CONFIG_KVM_ASYNC_PF
129 struct {
130 u32 queued;
131 struct list_head queue;
132 struct list_head done;
133 spinlock_t lock;
134 } async_pf;
135#endif
136
107 struct kvm_vcpu_arch arch; 137 struct kvm_vcpu_arch arch;
108}; 138};
109 139
@@ -302,6 +332,7 @@ void kvm_set_page_accessed(struct page *page);
302 332
303pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr); 333pfn_t hva_to_pfn_atomic(struct kvm *kvm, unsigned long addr);
304pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); 334pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
335pfn_t gfn_to_pfn_async(struct kvm *kvm, gfn_t gfn, bool *async);
305pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 336pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
306pfn_t gfn_to_pfn_memslot(struct kvm *kvm, 337pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
307 struct kvm_memory_slot *slot, gfn_t gfn); 338 struct kvm_memory_slot *slot, gfn_t gfn);