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.h53
1 files changed, 48 insertions, 5 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index b7bbb5ddd7ae..bd5a616d9373 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -120,7 +120,7 @@ struct kvm_kernel_irq_routing_entry {
120 u32 gsi; 120 u32 gsi;
121 u32 type; 121 u32 type;
122 int (*set)(struct kvm_kernel_irq_routing_entry *e, 122 int (*set)(struct kvm_kernel_irq_routing_entry *e,
123 struct kvm *kvm, int level); 123 struct kvm *kvm, int irq_source_id, int level);
124 union { 124 union {
125 struct { 125 struct {
126 unsigned irqchip; 126 unsigned irqchip;
@@ -128,9 +128,28 @@ struct kvm_kernel_irq_routing_entry {
128 } irqchip; 128 } irqchip;
129 struct msi_msg msi; 129 struct msi_msg msi;
130 }; 130 };
131 struct list_head link; 131 struct hlist_node link;
132};
133
134#ifdef __KVM_HAVE_IOAPIC
135
136struct kvm_irq_routing_table {
137 int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS];
138 struct kvm_kernel_irq_routing_entry *rt_entries;
139 u32 nr_rt_entries;
140 /*
141 * Array indexed by gsi. Each entry contains list of irq chips
142 * the gsi is connected to.
143 */
144 struct hlist_head map[0];
132}; 145};
133 146
147#else
148
149struct kvm_irq_routing_table {};
150
151#endif
152
134struct kvm { 153struct kvm {
135 spinlock_t mmu_lock; 154 spinlock_t mmu_lock;
136 spinlock_t requests_lock; 155 spinlock_t requests_lock;
@@ -166,8 +185,9 @@ struct kvm {
166 185
167 struct mutex irq_lock; 186 struct mutex irq_lock;
168#ifdef CONFIG_HAVE_KVM_IRQCHIP 187#ifdef CONFIG_HAVE_KVM_IRQCHIP
169 struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ 188 struct kvm_irq_routing_table *irq_routing;
170 struct hlist_head mask_notifier_list; 189 struct hlist_head mask_notifier_list;
190 struct hlist_head irq_ack_notifier_list;
171#endif 191#endif
172 192
173#ifdef KVM_ARCH_WANT_MMU_NOTIFIER 193#ifdef KVM_ARCH_WANT_MMU_NOTIFIER
@@ -266,6 +286,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
266void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 286void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
267 287
268void kvm_vcpu_block(struct kvm_vcpu *vcpu); 288void kvm_vcpu_block(struct kvm_vcpu *vcpu);
289void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
269void kvm_resched(struct kvm_vcpu *vcpu); 290void kvm_resched(struct kvm_vcpu *vcpu);
270void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 291void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
271void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 292void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
@@ -325,7 +346,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
325void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); 346void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
326 347
327int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); 348int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
328void kvm_arch_hardware_enable(void *garbage); 349int kvm_arch_hardware_enable(void *garbage);
329void kvm_arch_hardware_disable(void *garbage); 350void kvm_arch_hardware_disable(void *garbage);
330int kvm_arch_hardware_setup(void); 351int kvm_arch_hardware_setup(void);
331void kvm_arch_hardware_unsetup(void); 352void kvm_arch_hardware_unsetup(void);
@@ -390,7 +411,12 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
390 struct kvm_irq_mask_notifier *kimn); 411 struct kvm_irq_mask_notifier *kimn);
391void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); 412void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask);
392 413
393int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); 414#ifdef __KVM_HAVE_IOAPIC
415void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
416 union kvm_ioapic_redirect_entry *entry,
417 unsigned long *deliver_bitmask);
418#endif
419int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
394void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 420void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
395void kvm_register_irq_ack_notifier(struct kvm *kvm, 421void kvm_register_irq_ack_notifier(struct kvm *kvm,
396 struct kvm_irq_ack_notifier *kian); 422 struct kvm_irq_ack_notifier *kian);
@@ -552,4 +578,21 @@ static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu)
552 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; 578 return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id;
553} 579}
554#endif 580#endif
581
582#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
583
584long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
585 unsigned long arg);
586
587#else
588
589static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
590 unsigned long arg)
591{
592 return -ENOTTY;
593}
594
555#endif 595#endif
596
597#endif
598