diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-21 07:16:30 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:11 -0500 |
commit | 230c9a8f2354dc51f55bf81147f408d8fc2f3dd1 (patch) | |
tree | 3a0d2a1129a7cf5fb71553d64a25b2faba03dd6e | |
parent | 050e64992f90abee4e1e77b57fe7abf1ba22d330 (diff) |
KVM: MMU: Merge set_pte() and set_pte_common()
Since set_pte() is now the only caller of set_pte_common(), merge the two
functions.
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 062f4f574649..54a6ee802dc2 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -186,15 +186,11 @@ err: | |||
186 | return 0; | 186 | return 0; |
187 | } | 187 | } |
188 | 188 | ||
189 | static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, | 189 | static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t gpte, |
190 | u64 *shadow_pte, | 190 | u64 *shadow_pte, u64 access_bits, |
191 | pt_element_t gpte, | 191 | int user_fault, int write_fault, |
192 | u64 access_bits, | 192 | int *ptwrite, struct guest_walker *walker, |
193 | int user_fault, | 193 | gfn_t gfn) |
194 | int write_fault, | ||
195 | int *ptwrite, | ||
196 | struct guest_walker *walker, | ||
197 | gfn_t gfn) | ||
198 | { | 194 | { |
199 | int dirty = gpte & PT_DIRTY_MASK; | 195 | int dirty = gpte & PT_DIRTY_MASK; |
200 | u64 spte; | 196 | u64 spte; |
@@ -206,6 +202,7 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, | |||
206 | __FUNCTION__, *shadow_pte, (u64)gpte, access_bits, | 202 | __FUNCTION__, *shadow_pte, (u64)gpte, access_bits, |
207 | write_fault, user_fault, gfn); | 203 | write_fault, user_fault, gfn); |
208 | 204 | ||
205 | access_bits &= gpte; | ||
209 | /* | 206 | /* |
210 | * We don't set the accessed bit, since we sometimes want to see | 207 | * We don't set the accessed bit, since we sometimes want to see |
211 | * whether the guest actually used the pte (in order to detect | 208 | * whether the guest actually used the pte (in order to detect |
@@ -275,17 +272,6 @@ unshadowed: | |||
275 | vcpu->last_pte_updated = shadow_pte; | 272 | vcpu->last_pte_updated = shadow_pte; |
276 | } | 273 | } |
277 | 274 | ||
278 | static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t gpte, | ||
279 | u64 *shadow_pte, u64 access_bits, | ||
280 | int user_fault, int write_fault, int *ptwrite, | ||
281 | struct guest_walker *walker, gfn_t gfn) | ||
282 | { | ||
283 | access_bits &= gpte; | ||
284 | FNAME(set_pte_common)(vcpu, shadow_pte, | ||
285 | gpte, access_bits, user_fault, write_fault, | ||
286 | ptwrite, walker, gfn); | ||
287 | } | ||
288 | |||
289 | static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page, | 275 | static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page, |
290 | u64 *spte, const void *pte, int bytes, | 276 | u64 *spte, const void *pte, int bytes, |
291 | int offset_in_pte) | 277 | int offset_in_pte) |