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.h47
1 files changed, 16 insertions, 31 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ec4e3bd83d47..a4c33b34fe3f 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -325,24 +325,7 @@ struct kvm_kernel_irq_routing_entry {
325 struct hlist_node link; 325 struct hlist_node link;
326}; 326};
327 327
328#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING 328struct kvm_irq_routing_table;
329
330struct kvm_irq_routing_table {
331 int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS];
332 struct kvm_kernel_irq_routing_entry *rt_entries;
333 u32 nr_rt_entries;
334 /*
335 * Array indexed by gsi. Each entry contains list of irq chips
336 * the gsi is connected to.
337 */
338 struct hlist_head map[0];
339};
340
341#else
342
343struct kvm_irq_routing_table {};
344
345#endif
346 329
347#ifndef KVM_PRIVATE_MEM_SLOTS 330#ifndef KVM_PRIVATE_MEM_SLOTS
348#define KVM_PRIVATE_MEM_SLOTS 0 331#define KVM_PRIVATE_MEM_SLOTS 0
@@ -401,11 +384,12 @@ struct kvm {
401 struct mutex irq_lock; 384 struct mutex irq_lock;
402#ifdef CONFIG_HAVE_KVM_IRQCHIP 385#ifdef CONFIG_HAVE_KVM_IRQCHIP
403 /* 386 /*
404 * Update side is protected by irq_lock and, 387 * Update side is protected by irq_lock.
405 * if configured, irqfds.lock.
406 */ 388 */
407 struct kvm_irq_routing_table __rcu *irq_routing; 389 struct kvm_irq_routing_table __rcu *irq_routing;
408 struct hlist_head mask_notifier_list; 390 struct hlist_head mask_notifier_list;
391#endif
392#ifdef CONFIG_HAVE_KVM_IRQFD
409 struct hlist_head irq_ack_notifier_list; 393 struct hlist_head irq_ack_notifier_list;
410#endif 394#endif
411 395
@@ -455,7 +439,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
455int __must_check vcpu_load(struct kvm_vcpu *vcpu); 439int __must_check vcpu_load(struct kvm_vcpu *vcpu);
456void vcpu_put(struct kvm_vcpu *vcpu); 440void vcpu_put(struct kvm_vcpu *vcpu);
457 441
458#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING 442#ifdef CONFIG_HAVE_KVM_IRQFD
459int kvm_irqfd_init(void); 443int kvm_irqfd_init(void);
460void kvm_irqfd_exit(void); 444void kvm_irqfd_exit(void);
461#else 445#else
@@ -602,7 +586,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
602 unsigned int ioctl, unsigned long arg); 586 unsigned int ioctl, unsigned long arg);
603int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); 587int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf);
604 588
605int kvm_dev_ioctl_check_extension(long ext); 589int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext);
606 590
607int kvm_get_dirty_log(struct kvm *kvm, 591int kvm_get_dirty_log(struct kvm *kvm,
608 struct kvm_dirty_log *log, int *is_dirty); 592 struct kvm_dirty_log *log, int *is_dirty);
@@ -752,6 +736,10 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
752void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, 736void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
753 bool mask); 737 bool mask);
754 738
739int kvm_irq_map_gsi(struct kvm *kvm,
740 struct kvm_kernel_irq_routing_entry *entries, int gsi);
741int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned irqchip, unsigned pin);
742
755int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, 743int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level,
756 bool line_status); 744 bool line_status);
757int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); 745int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level);
@@ -942,28 +930,27 @@ int kvm_set_irq_routing(struct kvm *kvm,
942 const struct kvm_irq_routing_entry *entries, 930 const struct kvm_irq_routing_entry *entries,
943 unsigned nr, 931 unsigned nr,
944 unsigned flags); 932 unsigned flags);
945int kvm_set_routing_entry(struct kvm_irq_routing_table *rt, 933int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
946 struct kvm_kernel_irq_routing_entry *e,
947 const struct kvm_irq_routing_entry *ue); 934 const struct kvm_irq_routing_entry *ue);
948void kvm_free_irq_routing(struct kvm *kvm); 935void kvm_free_irq_routing(struct kvm *kvm);
949 936
950int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
951
952#else 937#else
953 938
954static inline void kvm_free_irq_routing(struct kvm *kvm) {} 939static inline void kvm_free_irq_routing(struct kvm *kvm) {}
955 940
956#endif 941#endif
957 942
943int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
944
958#ifdef CONFIG_HAVE_KVM_EVENTFD 945#ifdef CONFIG_HAVE_KVM_EVENTFD
959 946
960void kvm_eventfd_init(struct kvm *kvm); 947void kvm_eventfd_init(struct kvm *kvm);
961int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); 948int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
962 949
963#ifdef CONFIG_HAVE_KVM_IRQCHIP 950#ifdef CONFIG_HAVE_KVM_IRQFD
964int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); 951int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args);
965void kvm_irqfd_release(struct kvm *kvm); 952void kvm_irqfd_release(struct kvm *kvm);
966void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); 953void kvm_irq_routing_update(struct kvm *);
967#else 954#else
968static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) 955static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
969{ 956{
@@ -985,10 +972,8 @@ static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
985static inline void kvm_irqfd_release(struct kvm *kvm) {} 972static inline void kvm_irqfd_release(struct kvm *kvm) {}
986 973
987#ifdef CONFIG_HAVE_KVM_IRQCHIP 974#ifdef CONFIG_HAVE_KVM_IRQCHIP
988static inline void kvm_irq_routing_update(struct kvm *kvm, 975static inline void kvm_irq_routing_update(struct kvm *kvm)
989 struct kvm_irq_routing_table *irq_rt)
990{ 976{
991 rcu_assign_pointer(kvm->irq_routing, irq_rt);
992} 977}
993#endif 978#endif
994 979