diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 1bef9e21e725..5706a2108f0a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/irqflags.h> | 25 | #include <linux/irqflags.h> |
26 | #include <linux/context_tracking.h> | 26 | #include <linux/context_tracking.h> |
27 | #include <linux/irqbypass.h> | ||
27 | #include <asm/signal.h> | 28 | #include <asm/signal.h> |
28 | 29 | ||
29 | #include <linux/kvm.h> | 30 | #include <linux/kvm.h> |
@@ -140,6 +141,8 @@ static inline bool is_error_page(struct page *page) | |||
140 | #define KVM_REQ_APIC_PAGE_RELOAD 25 | 141 | #define KVM_REQ_APIC_PAGE_RELOAD 25 |
141 | #define KVM_REQ_SMI 26 | 142 | #define KVM_REQ_SMI 26 |
142 | #define KVM_REQ_HV_CRASH 27 | 143 | #define KVM_REQ_HV_CRASH 27 |
144 | #define KVM_REQ_IOAPIC_EOI_EXIT 28 | ||
145 | #define KVM_REQ_HV_RESET 29 | ||
143 | 146 | ||
144 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 147 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
145 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 | 148 | #define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 |
@@ -231,6 +234,9 @@ struct kvm_vcpu { | |||
231 | unsigned long requests; | 234 | unsigned long requests; |
232 | unsigned long guest_debug; | 235 | unsigned long guest_debug; |
233 | 236 | ||
237 | int pre_pcpu; | ||
238 | struct list_head blocked_vcpu_list; | ||
239 | |||
234 | struct mutex mutex; | 240 | struct mutex mutex; |
235 | struct kvm_run *run; | 241 | struct kvm_run *run; |
236 | 242 | ||
@@ -329,6 +335,18 @@ struct kvm_kernel_irq_routing_entry { | |||
329 | struct hlist_node link; | 335 | struct hlist_node link; |
330 | }; | 336 | }; |
331 | 337 | ||
338 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | ||
339 | struct kvm_irq_routing_table { | ||
340 | int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS]; | ||
341 | u32 nr_rt_entries; | ||
342 | /* | ||
343 | * Array indexed by gsi. Each entry contains list of irq chips | ||
344 | * the gsi is connected to. | ||
345 | */ | ||
346 | struct hlist_head map[0]; | ||
347 | }; | ||
348 | #endif | ||
349 | |||
332 | #ifndef KVM_PRIVATE_MEM_SLOTS | 350 | #ifndef KVM_PRIVATE_MEM_SLOTS |
333 | #define KVM_PRIVATE_MEM_SLOTS 0 | 351 | #define KVM_PRIVATE_MEM_SLOTS 0 |
334 | #endif | 352 | #endif |
@@ -455,10 +473,14 @@ void vcpu_put(struct kvm_vcpu *vcpu); | |||
455 | 473 | ||
456 | #ifdef __KVM_HAVE_IOAPIC | 474 | #ifdef __KVM_HAVE_IOAPIC |
457 | void kvm_vcpu_request_scan_ioapic(struct kvm *kvm); | 475 | void kvm_vcpu_request_scan_ioapic(struct kvm *kvm); |
476 | void kvm_arch_irq_routing_update(struct kvm *kvm); | ||
458 | #else | 477 | #else |
459 | static inline void kvm_vcpu_request_scan_ioapic(struct kvm *kvm) | 478 | static inline void kvm_vcpu_request_scan_ioapic(struct kvm *kvm) |
460 | { | 479 | { |
461 | } | 480 | } |
481 | static inline void kvm_arch_irq_routing_update(struct kvm *kvm) | ||
482 | { | ||
483 | } | ||
462 | #endif | 484 | #endif |
463 | 485 | ||
464 | #ifdef CONFIG_HAVE_KVM_IRQFD | 486 | #ifdef CONFIG_HAVE_KVM_IRQFD |
@@ -625,6 +647,8 @@ int kvm_vcpu_write_guest(struct kvm_vcpu *vcpu, gpa_t gpa, const void *data, | |||
625 | void kvm_vcpu_mark_page_dirty(struct kvm_vcpu *vcpu, gfn_t gfn); | 647 | void kvm_vcpu_mark_page_dirty(struct kvm_vcpu *vcpu, gfn_t gfn); |
626 | 648 | ||
627 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 649 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
650 | void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu); | ||
651 | void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu); | ||
628 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 652 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
629 | int kvm_vcpu_yield_to(struct kvm_vcpu *target); | 653 | int kvm_vcpu_yield_to(struct kvm_vcpu *target); |
630 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 654 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
@@ -803,10 +827,13 @@ int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned irqchip, unsigned pin); | |||
803 | 827 | ||
804 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, | 828 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, |
805 | bool line_status); | 829 | bool line_status); |
806 | int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); | ||
807 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, | 830 | int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, |
808 | int irq_source_id, int level, bool line_status); | 831 | int irq_source_id, int level, bool line_status); |
832 | int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e, | ||
833 | struct kvm *kvm, int irq_source_id, | ||
834 | int level, bool line_status); | ||
809 | bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); | 835 | bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); |
836 | void kvm_notify_acked_gsi(struct kvm *kvm, int gsi); | ||
810 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 837 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
811 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 838 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
812 | struct kvm_irq_ack_notifier *kian); | 839 | struct kvm_irq_ack_notifier *kian); |
@@ -1002,6 +1029,7 @@ static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq) | |||
1002 | #endif | 1029 | #endif |
1003 | 1030 | ||
1004 | int kvm_setup_default_irq_routing(struct kvm *kvm); | 1031 | int kvm_setup_default_irq_routing(struct kvm *kvm); |
1032 | int kvm_setup_empty_irq_routing(struct kvm *kvm); | ||
1005 | int kvm_set_irq_routing(struct kvm *kvm, | 1033 | int kvm_set_irq_routing(struct kvm *kvm, |
1006 | const struct kvm_irq_routing_entry *entries, | 1034 | const struct kvm_irq_routing_entry *entries, |
1007 | unsigned nr, | 1035 | unsigned nr, |
@@ -1144,5 +1172,16 @@ static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) | |||
1144 | { | 1172 | { |
1145 | } | 1173 | } |
1146 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ | 1174 | #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ |
1147 | #endif | ||
1148 | 1175 | ||
1176 | #ifdef CONFIG_HAVE_KVM_IRQ_BYPASS | ||
1177 | int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *, | ||
1178 | struct irq_bypass_producer *); | ||
1179 | void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *, | ||
1180 | struct irq_bypass_producer *); | ||
1181 | void kvm_arch_irq_bypass_stop(struct irq_bypass_consumer *); | ||
1182 | void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *); | ||
1183 | int kvm_arch_update_irqfd_routing(struct kvm *kvm, unsigned int host_irq, | ||
1184 | uint32_t guest_irq, bool set); | ||
1185 | #endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */ | ||
1186 | |||
1187 | #endif | ||