summaryrefslogtreecommitdiff
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-12-09 18:32:30 +0300
committerAvi Kivity <avi@qumranet.com>2008-01-30 18:53:20 +0300
commite3f955042219a595b1c3208e12c20860f23f72fb (patch)
treef6ff71fa2026625bc0223ecb04ffaff67cb91008 /drivers/kvm/paging_tmpl.h
parentb4ab019ce71efe30790b5aaa396549a16bb20608 (diff)
downloadlinux-e3f955042219a595b1c3208e12c20860f23f72fb.tar.xz
KVM: MMU: Pass pte dirty flag to set_pte() instead of calculating it on-site
This allows us to remove its dependency on pt_element_t. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/paging_tmpl.h')
-rw-r--r--drivers/kvm/paging_tmpl.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 179ce9e8145e..ca8d51574118 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -235,14 +235,12 @@ err:
return 0;
}
-static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t gpte,
- u64 *shadow_pte, unsigned pt_access,
- unsigned pte_access,
- int user_fault, int write_fault,
+static void FNAME(set_pte)(struct kvm_vcpu *vcpu, u64 *shadow_pte,
+ unsigned pt_access, unsigned pte_access,
+ int user_fault, int write_fault, int dirty,
int *ptwrite, struct guest_walker *walker,
gfn_t gfn)
{
- int dirty = gpte & PT_DIRTY_MASK;
u64 spte;
int was_rmapped = is_rmap_pte(*shadow_pte);
struct page *page;
@@ -338,8 +336,8 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page,
return;
pgprintk("%s: gpte %llx spte %p\n", __FUNCTION__, (u64)gpte, spte);
pte_access = page->role.access & FNAME(gpte_access)(vcpu, gpte);
- FNAME(set_pte)(vcpu, gpte, spte, page->role.access, pte_access,
- 0, 0, NULL, NULL, gpte_to_gfn(gpte));
+ FNAME(set_pte)(vcpu, spte, page->role.access, pte_access, 0, 0,
+ gpte & PT_DIRTY_MASK, NULL, NULL, gpte_to_gfn(gpte));
}
/*
@@ -402,9 +400,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
*shadow_ent = shadow_pte;
}
- FNAME(set_pte)(vcpu, walker->pte, shadow_ent,
- access, walker->pte_access & access,
- user_fault, write_fault,
+ FNAME(set_pte)(vcpu, shadow_ent, access, walker->pte_access & access,
+ user_fault, write_fault, walker->pte & PT_DIRTY_MASK,
ptwrite, walker, walker->gfn);
return shadow_ent;