diff options
author | Izik Eidus <izike@qumranet.com> | 2007-09-27 08:11:22 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:50 -0500 |
commit | 290fc38da8187b53b78dd4d5ab27a20b88ef8b61 (patch) | |
tree | 983b2b4cecbe489f7b84391c5eed34aa9f073da0 /drivers/kvm/paging_tmpl.h | |
parent | f566e09fc2c9f4164e1f0017c8c1c7a18bad7d72 (diff) |
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.h | 3 |
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: | |||
295 | set_shadow_pte(shadow_pte, spte); | 295 | set_shadow_pte(shadow_pte, spte); |
296 | page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); | 296 | page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); |
297 | if (!was_rmapped) | 297 | if (!was_rmapped) |
298 | rmap_add(vcpu, shadow_pte); | 298 | rmap_add(vcpu, shadow_pte, (gaddr & PT64_BASE_ADDR_MASK) |
299 | >> PAGE_SHIFT); | ||
299 | if (!ptwrite || !*ptwrite) | 300 | if (!ptwrite || !*ptwrite) |
300 | vcpu->last_pte_updated = shadow_pte; | 301 | vcpu->last_pte_updated = shadow_pte; |
301 | } | 302 | } |