aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-05-31 08:14:09 -0400
committerAvi Kivity <avi@qumranet.com>2007-07-16 05:05:44 -0400
commita18de5a403f9b5010527b2e7b05049b539b4facd (patch)
tree7b183d7a4191cebd089702d8512f697c23f23a05 /drivers/kvm
parent97a0a01ea9229e4f3f0f06e0584227e9687159a5 (diff)
KVM: Move shadow pte modifications from set_pte/set_pde to set_pde_common()
We want all shadow pte modifications in one place. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/paging_tmpl.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index c06720385551..35f264f346d8 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -218,6 +218,7 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu,
218 FNAME(mark_pagetable_dirty)(vcpu->kvm, walker); 218 FNAME(mark_pagetable_dirty)(vcpu->kvm, walker);
219 } 219 }
220 220
221 *shadow_pte |= *gpte & PT_PTE_COPY_MASK;
221 *shadow_pte |= access_bits << PT_SHADOW_BITS_OFFSET; 222 *shadow_pte |= access_bits << PT_SHADOW_BITS_OFFSET;
222 if (!dirty) 223 if (!dirty)
223 access_bits &= ~PT_WRITABLE_MASK; 224 access_bits &= ~PT_WRITABLE_MASK;
@@ -288,7 +289,6 @@ static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t *gpte,
288 struct guest_walker *walker, gfn_t gfn) 289 struct guest_walker *walker, gfn_t gfn)
289{ 290{
290 access_bits &= *gpte; 291 access_bits &= *gpte;
291 *shadow_pte |= (*gpte & PT_PTE_COPY_MASK);
292 FNAME(set_pte_common)(vcpu, shadow_pte, *gpte & PT_BASE_ADDR_MASK, 292 FNAME(set_pte_common)(vcpu, shadow_pte, *gpte & PT_BASE_ADDR_MASK,
293 gpte, access_bits, user_fault, write_fault, 293 gpte, access_bits, user_fault, write_fault,
294 ptwrite, walker, gfn); 294 ptwrite, walker, gfn);
@@ -322,7 +322,6 @@ static void FNAME(set_pde)(struct kvm_vcpu *vcpu, pt_element_t *gpde,
322 if (PTTYPE == 32 && is_cpuid_PSE36()) 322 if (PTTYPE == 32 && is_cpuid_PSE36())
323 gaddr |= (*gpde & PT32_DIR_PSE36_MASK) << 323 gaddr |= (*gpde & PT32_DIR_PSE36_MASK) <<
324 (32 - PT32_DIR_PSE36_SHIFT); 324 (32 - PT32_DIR_PSE36_SHIFT);
325 *shadow_pte |= *gpde & PT_PTE_COPY_MASK;
326 FNAME(set_pte_common)(vcpu, shadow_pte, gaddr, 325 FNAME(set_pte_common)(vcpu, shadow_pte, gaddr,
327 gpde, access_bits, user_fault, write_fault, 326 gpde, access_bits, user_fault, write_fault,
328 ptwrite, walker, gfn); 327 ptwrite, walker, gfn);