diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 47 |
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 | 328 | struct kvm_irq_routing_table; |
329 | |||
330 | struct 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 | |||
343 | struct 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); | |||
455 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); | 439 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); |
456 | void vcpu_put(struct kvm_vcpu *vcpu); | 440 | void vcpu_put(struct kvm_vcpu *vcpu); |
457 | 441 | ||
458 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 442 | #ifdef CONFIG_HAVE_KVM_IRQFD |
459 | int kvm_irqfd_init(void); | 443 | int kvm_irqfd_init(void); |
460 | void kvm_irqfd_exit(void); | 444 | void 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); |
603 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); | 587 | int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); |
604 | 588 | ||
605 | int kvm_dev_ioctl_check_extension(long ext); | 589 | int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext); |
606 | 590 | ||
607 | int kvm_get_dirty_log(struct kvm *kvm, | 591 | int 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, | |||
752 | void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, | 736 | void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, |
753 | bool mask); | 737 | bool mask); |
754 | 738 | ||
739 | int kvm_irq_map_gsi(struct kvm *kvm, | ||
740 | struct kvm_kernel_irq_routing_entry *entries, int gsi); | ||
741 | int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned irqchip, unsigned pin); | ||
742 | |||
755 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, | 743 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, |
756 | bool line_status); | 744 | bool line_status); |
757 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | 745 | int 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); |
945 | int kvm_set_routing_entry(struct kvm_irq_routing_table *rt, | 933 | int 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); |
948 | void kvm_free_irq_routing(struct kvm *kvm); | 935 | void kvm_free_irq_routing(struct kvm *kvm); |
949 | 936 | ||
950 | int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi); | ||
951 | |||
952 | #else | 937 | #else |
953 | 938 | ||
954 | static inline void kvm_free_irq_routing(struct kvm *kvm) {} | 939 | static inline void kvm_free_irq_routing(struct kvm *kvm) {} |
955 | 940 | ||
956 | #endif | 941 | #endif |
957 | 942 | ||
943 | int 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 | ||
960 | void kvm_eventfd_init(struct kvm *kvm); | 947 | void kvm_eventfd_init(struct kvm *kvm); |
961 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | 948 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); |
962 | 949 | ||
963 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 950 | #ifdef CONFIG_HAVE_KVM_IRQFD |
964 | int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); | 951 | int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); |
965 | void kvm_irqfd_release(struct kvm *kvm); | 952 | void kvm_irqfd_release(struct kvm *kvm); |
966 | void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); | 953 | void kvm_irq_routing_update(struct kvm *); |
967 | #else | 954 | #else |
968 | static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args) | 955 | static 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) | |||
985 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | 972 | static inline void kvm_irqfd_release(struct kvm *kvm) {} |
986 | 973 | ||
987 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 974 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
988 | static inline void kvm_irq_routing_update(struct kvm *kvm, | 975 | static 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 | ||