aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-04-28 05:50:07 -0400
committerGleb Natapov <gleb@redhat.com>2013-04-28 05:50:07 -0400
commit064d1afaa5a60fc391d0b4b77599fc8f63f99cd3 (patch)
tree2e640cdfa50b0048c52e021f07a8b24560251b26 /include/linux/kvm_host.h
parent730dca42c1d363c939da18c1499c7327c66e2b37 (diff)
parent8b78645c93b5d469e8006d68dbc92edc2640c654 (diff)
Merge git://github.com/agraf/linux-2.6.git kvm-ppc-next into queue
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h54
1 files changed, 45 insertions, 9 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 7bde42470e37..309774715897 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -303,10 +303,10 @@ struct kvm_kernel_irq_routing_entry {
303 struct hlist_node link; 303 struct hlist_node link;
304}; 304};
305 305
306#ifdef __KVM_HAVE_IOAPIC 306#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
307 307
308struct kvm_irq_routing_table { 308struct kvm_irq_routing_table {
309 int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS]; 309 int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS];
310 struct kvm_kernel_irq_routing_entry *rt_entries; 310 struct kvm_kernel_irq_routing_entry *rt_entries;
311 u32 nr_rt_entries; 311 u32 nr_rt_entries;
312 /* 312 /*
@@ -392,6 +392,7 @@ struct kvm {
392 long mmu_notifier_count; 392 long mmu_notifier_count;
393#endif 393#endif
394 long tlbs_dirty; 394 long tlbs_dirty;
395 struct list_head devices;
395}; 396};
396 397
397#define kvm_err(fmt, ...) \ 398#define kvm_err(fmt, ...) \
@@ -431,7 +432,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
431int __must_check vcpu_load(struct kvm_vcpu *vcpu); 432int __must_check vcpu_load(struct kvm_vcpu *vcpu);
432void vcpu_put(struct kvm_vcpu *vcpu); 433void vcpu_put(struct kvm_vcpu *vcpu);
433 434
434#ifdef __KVM_HAVE_IOAPIC 435#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
435int kvm_irqfd_init(void); 436int kvm_irqfd_init(void);
436void kvm_irqfd_exit(void); 437void kvm_irqfd_exit(void);
437#else 438#else
@@ -718,11 +719,6 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
718void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin, 719void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
719 bool mask); 720 bool mask);
720 721
721#ifdef __KVM_HAVE_IOAPIC
722void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
723 union kvm_ioapic_redirect_entry *entry,
724 unsigned long *deliver_bitmask);
725#endif
726int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, 722int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level,
727 bool line_status); 723 bool line_status);
728int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level); 724int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level);
@@ -956,7 +952,7 @@ static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq)
956} 952}
957#endif 953#endif
958 954
959#ifdef KVM_CAP_IRQ_ROUTING 955#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
960 956
961#define KVM_MAX_IRQ_ROUTES 1024 957#define KVM_MAX_IRQ_ROUTES 1024
962 958
@@ -965,6 +961,9 @@ int kvm_set_irq_routing(struct kvm *kvm,
965 const struct kvm_irq_routing_entry *entries, 961 const struct kvm_irq_routing_entry *entries,
966 unsigned nr, 962 unsigned nr,
967 unsigned flags); 963 unsigned flags);
964int kvm_set_routing_entry(struct kvm_irq_routing_table *rt,
965 struct kvm_kernel_irq_routing_entry *e,
966 const struct kvm_irq_routing_entry *ue);
968void kvm_free_irq_routing(struct kvm *kvm); 967void kvm_free_irq_routing(struct kvm *kvm);
969 968
970int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi); 969int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
@@ -1065,6 +1064,43 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
1065 1064
1066extern bool kvm_rebooting; 1065extern bool kvm_rebooting;
1067 1066
1067struct kvm_device_ops;
1068
1069struct kvm_device {
1070 struct kvm_device_ops *ops;
1071 struct kvm *kvm;
1072 void *private;
1073 struct list_head vm_node;
1074};
1075
1076/* create, destroy, and name are mandatory */
1077struct kvm_device_ops {
1078 const char *name;
1079 int (*create)(struct kvm_device *dev, u32 type);
1080
1081 /*
1082 * Destroy is responsible for freeing dev.
1083 *
1084 * Destroy may be called before or after destructors are called
1085 * on emulated I/O regions, depending on whether a reference is
1086 * held by a vcpu or other kvm component that gets destroyed
1087 * after the emulated I/O.
1088 */
1089 void (*destroy)(struct kvm_device *dev);
1090
1091 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1092 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1093 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
1094 long (*ioctl)(struct kvm_device *dev, unsigned int ioctl,
1095 unsigned long arg);
1096};
1097
1098void kvm_device_get(struct kvm_device *dev);
1099void kvm_device_put(struct kvm_device *dev);
1100struct kvm_device *kvm_device_from_filp(struct file *filp);
1101
1102extern struct kvm_device_ops kvm_mpic_ops;
1103
1068#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT 1104#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
1069 1105
1070static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val) 1106static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)