diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2012-02-07 23:02:18 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-08 07:10:22 -0500 |
commit | db3fe4eb45f3555d91a7124e18cf3a2f2a30eb90 (patch) | |
tree | 5d294feef8f6281d4cd6c67180e0514c74e87079 /include | |
parent | 189a2f7b24677deced3d2a9803969ba69f4b75f6 (diff) |
KVM: Introduce kvm_memory_slot::arch and move lpage_info into it
Some members of kvm_memory_slot are not used by every architecture.
This patch is the first step to make this difference clear by
introducing kvm_memory_slot::arch; lpage_info is moved into it.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_host.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7a08496b974a..355e44555c39 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -171,11 +171,6 @@ static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu) | |||
171 | */ | 171 | */ |
172 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | 172 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) |
173 | 173 | ||
174 | struct kvm_lpage_info { | ||
175 | unsigned long rmap_pde; | ||
176 | int write_count; | ||
177 | }; | ||
178 | |||
179 | struct kvm_memory_slot { | 174 | struct kvm_memory_slot { |
180 | gfn_t base_gfn; | 175 | gfn_t base_gfn; |
181 | unsigned long npages; | 176 | unsigned long npages; |
@@ -184,7 +179,7 @@ struct kvm_memory_slot { | |||
184 | unsigned long *dirty_bitmap; | 179 | unsigned long *dirty_bitmap; |
185 | unsigned long *dirty_bitmap_head; | 180 | unsigned long *dirty_bitmap_head; |
186 | unsigned long nr_dirty_pages; | 181 | unsigned long nr_dirty_pages; |
187 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; | 182 | struct kvm_arch_memory_slot arch; |
188 | unsigned long userspace_addr; | 183 | unsigned long userspace_addr; |
189 | int user_alloc; | 184 | int user_alloc; |
190 | int id; | 185 | int id; |
@@ -376,6 +371,9 @@ int kvm_set_memory_region(struct kvm *kvm, | |||
376 | int __kvm_set_memory_region(struct kvm *kvm, | 371 | int __kvm_set_memory_region(struct kvm *kvm, |
377 | struct kvm_userspace_memory_region *mem, | 372 | struct kvm_userspace_memory_region *mem, |
378 | int user_alloc); | 373 | int user_alloc); |
374 | void kvm_arch_free_memslot(struct kvm_memory_slot *free, | ||
375 | struct kvm_memory_slot *dont); | ||
376 | int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); | ||
379 | int kvm_arch_prepare_memory_region(struct kvm *kvm, | 377 | int kvm_arch_prepare_memory_region(struct kvm *kvm, |
380 | struct kvm_memory_slot *memslot, | 378 | struct kvm_memory_slot *memslot, |
381 | struct kvm_memory_slot old, | 379 | struct kvm_memory_slot old, |
@@ -385,6 +383,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm, | |||
385 | struct kvm_userspace_memory_region *mem, | 383 | struct kvm_userspace_memory_region *mem, |
386 | struct kvm_memory_slot old, | 384 | struct kvm_memory_slot old, |
387 | int user_alloc); | 385 | int user_alloc); |
386 | bool kvm_largepages_enabled(void); | ||
388 | void kvm_disable_largepages(void); | 387 | void kvm_disable_largepages(void); |
389 | void kvm_arch_flush_shadow(struct kvm *kvm); | 388 | void kvm_arch_flush_shadow(struct kvm *kvm); |
390 | 389 | ||