summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorIzik Eidus <izike@qumranet.com>2007-09-27 14:11:22 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 16:52:50 +0100
commit290fc38da8187b53b78dd4d5ab27a20b88ef8b61 (patch)
tree983b2b4cecbe489f7b84391c5eed34aa9f073da0 /drivers/kvm/paging_tmpl.h
parentKVM: VMX: Simplify vcpu_clear() (diff)
downloadlinux-290fc38da8187b53b78dd4d5ab27a20b88ef8b61.tar.xz
linux-290fc38da8187b53b78dd4d5ab27a20b88ef8b61.zip
KVM: Remove the usage of page->private field by rmap
When kvm uses user-allocated pages in the future for the guest, we won't be able to use page->private for rmap, since page->rmap is reserved for the filesystem. So we move the rmap base pointers to the memory slot. A side effect of this is that we need to store the gfn of each gpte in the shadow pages, since the memory slot is addressed by gfn, instead of hfn like struct page. Signed-off-by: Izik Eidus <izik@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/paging_tmpl.h')
-rw-r--r--drivers/kvm/paging_tmpl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index be0f85231da9..fbe595f880af 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -295,7 +295,8 @@ unshadowed:
set_shadow_pte(shadow_pte, spte);
page_header_update_slot(vcpu->kvm, shadow_pte, gaddr);
if (!was_rmapped)
- rmap_add(vcpu, shadow_pte);
+ rmap_add(vcpu, shadow_pte, (gaddr & PT64_BASE_ADDR_MASK)
+ >> PAGE_SHIFT);
if (!ptwrite || !*ptwrite)
vcpu->last_pte_updated = shadow_pte;
}