diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 169d07758ee5..7cb116afa1cd 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -105,6 +105,12 @@ struct kvm_vcpu { | |||
105 | struct kvm_vcpu_arch arch; | 105 | struct kvm_vcpu_arch arch; |
106 | }; | 106 | }; |
107 | 107 | ||
108 | /* | ||
109 | * Some of the bitops functions do not support too long bitmaps. | ||
110 | * This number must be determined not to exceed such limits. | ||
111 | */ | ||
112 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | ||
113 | |||
108 | struct kvm_memory_slot { | 114 | struct kvm_memory_slot { |
109 | gfn_t base_gfn; | 115 | gfn_t base_gfn; |
110 | unsigned long npages; | 116 | unsigned long npages; |
@@ -237,17 +243,23 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | |||
237 | void vcpu_load(struct kvm_vcpu *vcpu); | 243 | void vcpu_load(struct kvm_vcpu *vcpu); |
238 | void vcpu_put(struct kvm_vcpu *vcpu); | 244 | void vcpu_put(struct kvm_vcpu *vcpu); |
239 | 245 | ||
240 | int kvm_init(void *opaque, unsigned int vcpu_size, | 246 | int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, |
241 | struct module *module); | 247 | struct module *module); |
242 | void kvm_exit(void); | 248 | void kvm_exit(void); |
243 | 249 | ||
244 | void kvm_get_kvm(struct kvm *kvm); | 250 | void kvm_get_kvm(struct kvm *kvm); |
245 | void kvm_put_kvm(struct kvm *kvm); | 251 | void kvm_put_kvm(struct kvm *kvm); |
246 | 252 | ||
253 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | ||
254 | { | ||
255 | return rcu_dereference_check(kvm->memslots, | ||
256 | srcu_read_lock_held(&kvm->srcu) | ||
257 | || lockdep_is_held(&kvm->slots_lock)); | ||
258 | } | ||
259 | |||
247 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) | 260 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) |
248 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) | 261 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) |
249 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } | 262 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |
250 | struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); | ||
251 | 263 | ||
252 | extern struct page *bad_page; | 264 | extern struct page *bad_page; |
253 | extern pfn_t bad_pfn; | 265 | extern pfn_t bad_pfn; |