diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bd5a616d9373..782bfb185f8a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -150,14 +150,18 @@ struct kvm_irq_routing_table {}; | |||
150 | 150 | ||
151 | #endif | 151 | #endif |
152 | 152 | ||
153 | struct kvm_memslots { | ||
154 | int nmemslots; | ||
155 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | ||
156 | KVM_PRIVATE_MEM_SLOTS]; | ||
157 | }; | ||
158 | |||
153 | struct kvm { | 159 | struct kvm { |
154 | spinlock_t mmu_lock; | 160 | spinlock_t mmu_lock; |
155 | spinlock_t requests_lock; | 161 | spinlock_t requests_lock; |
156 | struct rw_semaphore slots_lock; | 162 | struct rw_semaphore slots_lock; |
157 | struct mm_struct *mm; /* userspace tied to this vm */ | 163 | struct mm_struct *mm; /* userspace tied to this vm */ |
158 | int nmemslots; | 164 | struct kvm_memslots *memslots; |
159 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | ||
160 | KVM_PRIVATE_MEM_SLOTS]; | ||
161 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | 165 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE |
162 | u32 bsp_vcpu_id; | 166 | u32 bsp_vcpu_id; |
163 | struct kvm_vcpu *bsp_vcpu; | 167 | struct kvm_vcpu *bsp_vcpu; |
@@ -482,7 +486,7 @@ static inline void kvm_guest_exit(void) | |||
482 | 486 | ||
483 | static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) | 487 | static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) |
484 | { | 488 | { |
485 | return slot - kvm->memslots; | 489 | return slot - kvm->memslots->memslots; |
486 | } | 490 | } |
487 | 491 | ||
488 | static inline gpa_t gfn_to_gpa(gfn_t gfn) | 492 | static inline gpa_t gfn_to_gpa(gfn_t gfn) |