Commit a18de5a4 authored by Avi Kivity's avatar Avi Kivity

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: default avatarAvi Kivity <avi@qumranet.com>
parent 97a0a01e
...@@ -218,6 +218,7 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, ...@@ -218,6 +218,7 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu,
FNAME(mark_pagetable_dirty)(vcpu->kvm, walker); FNAME(mark_pagetable_dirty)(vcpu->kvm, walker);
} }
*shadow_pte |= *gpte & PT_PTE_COPY_MASK;
*shadow_pte |= access_bits << PT_SHADOW_BITS_OFFSET; *shadow_pte |= access_bits << PT_SHADOW_BITS_OFFSET;
if (!dirty) if (!dirty)
access_bits &= ~PT_WRITABLE_MASK; access_bits &= ~PT_WRITABLE_MASK;
...@@ -288,7 +289,6 @@ static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t *gpte, ...@@ -288,7 +289,6 @@ static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t *gpte,
struct guest_walker *walker, gfn_t gfn) struct guest_walker *walker, gfn_t gfn)
{ {
access_bits &= *gpte; access_bits &= *gpte;
*shadow_pte |= (*gpte & PT_PTE_COPY_MASK);
FNAME(set_pte_common)(vcpu, shadow_pte, *gpte & PT_BASE_ADDR_MASK, FNAME(set_pte_common)(vcpu, shadow_pte, *gpte & PT_BASE_ADDR_MASK,
gpte, access_bits, user_fault, write_fault, gpte, access_bits, user_fault, write_fault,
ptwrite, walker, gfn); ptwrite, walker, gfn);
...@@ -322,7 +322,6 @@ static void FNAME(set_pde)(struct kvm_vcpu *vcpu, pt_element_t *gpde, ...@@ -322,7 +322,6 @@ static void FNAME(set_pde)(struct kvm_vcpu *vcpu, pt_element_t *gpde,
if (PTTYPE == 32 && is_cpuid_PSE36()) if (PTTYPE == 32 && is_cpuid_PSE36())
gaddr |= (*gpde & PT32_DIR_PSE36_MASK) << gaddr |= (*gpde & PT32_DIR_PSE36_MASK) <<
(32 - PT32_DIR_PSE36_SHIFT); (32 - PT32_DIR_PSE36_SHIFT);
*shadow_pte |= *gpde & PT_PTE_COPY_MASK;
FNAME(set_pte_common)(vcpu, shadow_pte, gaddr, FNAME(set_pte_common)(vcpu, shadow_pte, gaddr,
gpde, access_bits, user_fault, write_fault, gpde, access_bits, user_fault, write_fault,
ptwrite, walker, gfn); ptwrite, walker, gfn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment