diff options
author | Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> | 2015-11-20 03:41:28 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-25 11:25:44 -0500 |
commit | 018aabb56d6109c8f12397c24e59f67c58870ac1 (patch) | |
tree | 87a1f55b8a8228ffa3283d8df6e813e92863258d /arch/x86/include | |
parent | 378b417d652c4ff20be3144b7064e3a4ecd2571d (diff) |
KVM: x86: MMU: Encapsulate the type of rmap-chain head in a new struct
New struct kvm_rmap_head makes the code type-safe to some extent.
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index f608e170ba3d..814007701f8b 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -214,6 +214,10 @@ union kvm_mmu_page_role { | |||
214 | }; | 214 | }; |
215 | }; | 215 | }; |
216 | 216 | ||
217 | struct kvm_rmap_head { | ||
218 | unsigned long val; | ||
219 | }; | ||
220 | |||
217 | struct kvm_mmu_page { | 221 | struct kvm_mmu_page { |
218 | struct list_head link; | 222 | struct list_head link; |
219 | struct hlist_node hash_link; | 223 | struct hlist_node hash_link; |
@@ -231,7 +235,7 @@ struct kvm_mmu_page { | |||
231 | bool unsync; | 235 | bool unsync; |
232 | int root_count; /* Currently serving as active root */ | 236 | int root_count; /* Currently serving as active root */ |
233 | unsigned int unsync_children; | 237 | unsigned int unsync_children; |
234 | unsigned long parent_ptes; /* Reverse mapping for parent_pte */ | 238 | struct kvm_rmap_head parent_ptes; /* rmap pointers to parent sptes */ |
235 | 239 | ||
236 | /* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen. */ | 240 | /* The page is obsolete if mmu_valid_gen != kvm->arch.mmu_valid_gen. */ |
237 | unsigned long mmu_valid_gen; | 241 | unsigned long mmu_valid_gen; |
@@ -606,7 +610,7 @@ struct kvm_lpage_info { | |||
606 | }; | 610 | }; |
607 | 611 | ||
608 | struct kvm_arch_memory_slot { | 612 | struct kvm_arch_memory_slot { |
609 | unsigned long *rmap[KVM_NR_PAGE_SIZES]; | 613 | struct kvm_rmap_head *rmap[KVM_NR_PAGE_SIZES]; |
610 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; | 614 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
611 | }; | 615 | }; |
612 | 616 | ||