diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2010-12-06 22:59:07 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:30:47 -0500 |
commit | d4dbf470096c51cb4785167ea59fdbdea87ccbe4 (patch) | |
tree | fbc50ca20c1ed53ce431c5e923fb46e7faeef986 /include/linux/kvm_host.h | |
parent | 443381a828910efa3d71ba4491d180f2d0bb4212 (diff) |
KVM: MMU: Make the way of accessing lpage_info more generic
Large page information has two elements but one of them, write_count, alone
is accessed by a helper function.
This patch replaces this helper function with more generic one which returns
newly named kvm_lpage_info structure and use it to access the other element
rmap_pde.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ac4e83a1a10d..bd0da8f12500 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -146,6 +146,11 @@ struct kvm_vcpu { | |||
146 | */ | 146 | */ |
147 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | 147 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) |
148 | 148 | ||
149 | struct kvm_lpage_info { | ||
150 | unsigned long rmap_pde; | ||
151 | int write_count; | ||
152 | }; | ||
153 | |||
149 | struct kvm_memory_slot { | 154 | struct kvm_memory_slot { |
150 | gfn_t base_gfn; | 155 | gfn_t base_gfn; |
151 | unsigned long npages; | 156 | unsigned long npages; |
@@ -153,10 +158,7 @@ struct kvm_memory_slot { | |||
153 | unsigned long *rmap; | 158 | unsigned long *rmap; |
154 | unsigned long *dirty_bitmap; | 159 | unsigned long *dirty_bitmap; |
155 | unsigned long *dirty_bitmap_head; | 160 | unsigned long *dirty_bitmap_head; |
156 | struct { | 161 | struct kvm_lpage_info *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
157 | unsigned long rmap_pde; | ||
158 | int write_count; | ||
159 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; | ||
160 | unsigned long userspace_addr; | 162 | unsigned long userspace_addr; |
161 | int user_alloc; | 163 | int user_alloc; |
162 | int id; | 164 | int id; |