Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80657
b: refs/heads/master
c: 5df34a8
h: refs/heads/master
i:
  80655: fedca51
v: v3
  • Loading branch information
Avi Kivity committed Jan 30, 2008
1 parent f38ab92 commit cd28eac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6bfccdc9ae55bb2e0be2e015d7d1ba061f4071c5
refs/heads/master: 5df34a86f917024b67f9e7c850153390973cdfe3
23 changes: 15 additions & 8 deletions trunk/drivers/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ struct guest_walker {
u32 error_code;
};

static void FNAME(update_dirty_bit)(struct kvm_vcpu *vcpu,
int write_fault,
pt_element_t *ptep,
gfn_t table_gfn)
{
if (write_fault && !is_dirty_pte(*ptep)) {
mark_page_dirty(vcpu->kvm, table_gfn);
*ptep |= PT_DIRTY_MASK;
}
}

/*
* Fetch a guest pte for a guest virtual address
*/
Expand Down Expand Up @@ -144,10 +155,8 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
if (walker->level == PT_PAGE_TABLE_LEVEL) {
walker->gfn = (*ptep & PT_BASE_ADDR_MASK)
>> PAGE_SHIFT;
if (write_fault && !is_dirty_pte(*ptep)) {
mark_page_dirty(vcpu->kvm, table_gfn);
*ptep |= PT_DIRTY_MASK;
}
FNAME(update_dirty_bit)(vcpu, write_fault, ptep,
table_gfn);
break;
}

Expand All @@ -157,10 +166,8 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
walker->gfn = (*ptep & PT_DIR_BASE_ADDR_MASK)
>> PAGE_SHIFT;
walker->gfn += PT_INDEX(addr, PT_PAGE_TABLE_LEVEL);
if (write_fault && !is_dirty_pte(*ptep)) {
mark_page_dirty(vcpu->kvm, table_gfn);
*ptep |= PT_DIRTY_MASK;
}
FNAME(update_dirty_bit)(vcpu, write_fault, ptep,
table_gfn);
break;
}

Expand Down

0 comments on commit cd28eac

Please sign in to comment.