diff options
Diffstat (limited to 'include/linux/kvm_host.h')
| -rw-r--r-- | include/linux/kvm_host.h | 35 |
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 | ||
| 128 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) | 130 | static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot) |
| @@ -266,6 +268,8 @@ extern pfn_t bad_pfn; | |||
| 266 | 268 | ||
| 267 | int is_error_page(struct page *page); | 269 | int is_error_page(struct page *page); |
| 268 | int is_error_pfn(pfn_t pfn); | 270 | int is_error_pfn(pfn_t pfn); |
| 271 | int is_hwpoison_pfn(pfn_t pfn); | ||
| 272 | int is_fault_pfn(pfn_t pfn); | ||
| 269 | int kvm_is_error_hva(unsigned long addr); | 273 | int kvm_is_error_hva(unsigned long addr); |
| 270 | int kvm_set_memory_region(struct kvm *kvm, | 274 | int 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); |
| 285 | void kvm_disable_largepages(void); | 289 | void kvm_disable_largepages(void); |
| 286 | void kvm_arch_flush_shadow(struct kvm *kvm); | 290 | void kvm_arch_flush_shadow(struct kvm *kvm); |
| 287 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | ||
| 288 | gfn_t unalias_gfn_instantiation(struct kvm *kvm, gfn_t gfn); | ||
| 289 | 291 | ||
| 290 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 292 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
| 291 | unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); | 293 | unsigned 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); |
| 446 | void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | 448 | void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, |
| 447 | struct kvm_irq_mask_notifier *kimn); | 449 | struct kvm_irq_mask_notifier *kimn); |
| 448 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); | 450 | void 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 |
| 451 | void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | 454 | void 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 | ||
| 630 | static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) | ||
| 631 | { | ||
| 632 | set_bit(req, &vcpu->requests); | ||
| 633 | } | ||
| 634 | |||
| 635 | static inline bool kvm_make_check_request(int req, struct kvm_vcpu *vcpu) | ||
| 636 | { | ||
| 637 | return test_and_set_bit(req, &vcpu->requests); | ||
| 638 | } | ||
| 639 | |||
| 640 | static 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 | ||
