diff options
author | Avi Kivity <avi@qumranet.com> | 2007-10-11 09:30:21 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:52 -0500 |
commit | c4fcc2724628c6548748ec80a90b548fc300e81f (patch) | |
tree | 30bfbb4b8624636270a6921a4c8fdbcef054bff0 /drivers/kvm | |
parent | 5df34a86f917024b67f9e7c850153390973cdfe3 (diff) |
KVM: MMU: When updating the dirty bit, inform the mmu about it
Since the mmu uses different shadow pages for dirty large pages and clean
large pages, this allows the mmu to drop ptes that are now invalid.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index a0f84a5379a4..a9e687b5c1e9 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -74,9 +74,14 @@ static void FNAME(update_dirty_bit)(struct kvm_vcpu *vcpu, | |||
74 | pt_element_t *ptep, | 74 | pt_element_t *ptep, |
75 | gfn_t table_gfn) | 75 | gfn_t table_gfn) |
76 | { | 76 | { |
77 | gpa_t pte_gpa; | ||
78 | |||
77 | if (write_fault && !is_dirty_pte(*ptep)) { | 79 | if (write_fault && !is_dirty_pte(*ptep)) { |
78 | mark_page_dirty(vcpu->kvm, table_gfn); | 80 | mark_page_dirty(vcpu->kvm, table_gfn); |
79 | *ptep |= PT_DIRTY_MASK; | 81 | *ptep |= PT_DIRTY_MASK; |
82 | pte_gpa = ((gpa_t)table_gfn << PAGE_SHIFT); | ||
83 | pte_gpa += offset_in_page(ptep); | ||
84 | kvm_mmu_pte_write(vcpu, pte_gpa, (u8 *)ptep, sizeof(*ptep)); | ||
80 | } | 85 | } |
81 | } | 86 | } |
82 | 87 | ||