aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-01-05 16:36:38 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-05 23:55:24 -0800
commitcd4a4e5374110444dc38831af517e51ff5a053c3 (patch)
treeed82756435e7909c7698d112195994c2e8062328 /drivers/kvm/paging_tmpl.h
parent[PATCH] KVM: Prevent stale bits in cr0 and cr4 (diff)
downloadlinux-dev-cd4a4e5374110444dc38831af517e51ff5a053c3.tar.xz
linux-dev-cd4a4e5374110444dc38831af517e51ff5a053c3.zip
[PATCH] KVM: MMU: Implement simple reverse mapping
Keep in each host page frame's page->private a pointer to the shadow pte which maps it. If there are multiple shadow ptes mapping the page, set bit 0 of page->private, and use the rest as a pointer to a linked list of all such mappings. Reverse mappings are needed because we when we cache shadow page tables, we must protect the guest page tables from being modified by the guest, as that would invalidate the cached ptes. Signed-off-by: Avi Kivity <avi@qumranet.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to '')
-rw-r--r--drivers/kvm/paging_tmpl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 09bb9b4ed12d..8c48528a6e89 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -261,6 +261,7 @@ static int FNAME(fix_write_pf)(struct kvm_vcpu *vcpu,
mark_page_dirty(vcpu->kvm, gfn);
*shadow_ent |= PT_WRITABLE_MASK;
*guest_ent |= PT_DIRTY_MASK;
+ rmap_add(vcpu->kvm, shadow_ent);
return 1;
}