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.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 7cb116afa1c..c13cc48697a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -81,13 +81,14 @@ struct kvm_vcpu {
81 int vcpu_id; 81 int vcpu_id;
82 struct mutex mutex; 82 struct mutex mutex;
83 int cpu; 83 int cpu;
84 atomic_t guest_mode;
84 struct kvm_run *run; 85 struct kvm_run *run;
85 unsigned long requests; 86 unsigned long requests;
86 unsigned long guest_debug; 87 unsigned long guest_debug;
87 int srcu_idx; 88 int srcu_idx;
88 89
89 int fpu_active; 90 int fpu_active;
90 int guest_fpu_loaded; 91 int guest_fpu_loaded, guest_xcr0_loaded;
91 wait_queue_head_t wq; 92 wait_queue_head_t wq;
92 int sigset_active; 93 int sigset_active;
93 sigset_t sigset; 94 sigset_t sigset;
@@ -123,6 +124,7 @@ struct kvm_memory_slot {
123 } *lpage_info[KVM_NR_PAGE_SIZES - 1]; 124 } *lpage_info[KVM_NR_PAGE_SIZES - 1];
124 unsigned long userspace_addr; 125 unsigned long userspace_addr;
125 int user_alloc; 126 int user_alloc;
127 int id;
126}; 128};
127 129
128static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) 130static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
@@ -266,6 +268,8 @@ extern pfn_t bad_pfn;
266 268
267int is_error_page(struct page *page); 269int is_error_page(struct page *page);
268int is_error_pfn(pfn_t pfn); 270int is_error_pfn(pfn_t pfn);
271int is_hwpoison_pfn(pfn_t pfn);
272int is_fault_pfn(pfn_t pfn);
269int kvm_is_error_hva(unsigned long addr); 273int kvm_is_error_hva(unsigned long addr);
270int kvm_set_memory_region(struct kvm *kvm, 274int kvm_set_memory_region(struct kvm *kvm,
271 struct kvm_userspace_memory_region *mem, 275 struct kvm_userspace_memory_region *mem,
@@ -284,8 +288,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
284 int user_alloc); 288 int user_alloc);
285void kvm_disable_largepages(void); 289void kvm_disable_largepages(void);
286void kvm_arch_flush_shadow(struct kvm *kvm); 290void kvm_arch_flush_shadow(struct kvm *kvm);
287gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
288gfn_t unalias_gfn_instantiation(struct kvm *kvm, gfn_t gfn);
289 291
290struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 292struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
291unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 293unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
@@ -445,7 +447,8 @@ void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq,
445 struct kvm_irq_mask_notifier *kimn); 447 struct kvm_irq_mask_notifier *kimn);
446void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, 448void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
447 struct kvm_irq_mask_notifier *kimn); 449 struct kvm_irq_mask_notifier *kimn);
448void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); 450void kvm_fire_mask_notifiers(struct kvm *kvm, unsigned irqchip, unsigned pin,
451 bool mask);
449 452
450#ifdef __KVM_HAVE_IOAPIC 453#ifdef __KVM_HAVE_IOAPIC
451void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, 454void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
@@ -562,10 +565,6 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
562} 565}
563#endif 566#endif
564 567
565#ifndef KVM_ARCH_HAS_UNALIAS_INSTANTIATION
566#define unalias_gfn_instantiation unalias_gfn
567#endif
568
569#ifdef CONFIG_HAVE_KVM_IRQCHIP 568#ifdef CONFIG_HAVE_KVM_IRQCHIP
570 569
571#define KVM_MAX_IRQ_ROUTES 1024 570#define KVM_MAX_IRQ_ROUTES 1024
@@ -628,5 +627,25 @@ static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
628 627
629#endif 628#endif
630 629
630static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu)
631{
632 set_bit(req, &vcpu->requests);
633}
634
635static inline bool kvm_make_check_request(int req, struct kvm_vcpu *vcpu)
636{
637 return test_and_set_bit(req, &vcpu->requests);
638}
639
640static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
641{
642 if (test_bit(req, &vcpu->requests)) {
643 clear_bit(req, &vcpu->requests);
644 return true;
645 } else {
646 return false;
647 }
648}
649
631#endif 650#endif
632 651