summaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.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 17:52:50 +0200
commit290fc38da8187b53b78dd4d5ab27a20b88ef8b61 (patch)
tree983b2b4cecbe489f7b84391c5eed34aa9f073da0 /drivers/kvm/kvm.h
parentf566e09fc2c9f4164e1f0017c8c1c7a18bad7d72 (diff)
downloadlwn-290fc38da8187b53b78dd4d5ab27a20b88ef8b61.tar.gz
lwn-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/kvm.h')
-rw-r--r--drivers/kvm/kvm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 08ffc829f07f..80cfb99fffe0 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -126,6 +126,8 @@ struct kvm_mmu_page {
union kvm_mmu_page_role role;
u64 *spt;
+ /* hold the gfn of each spte inside spt */
+ gfn_t *gfns;
unsigned long slot_bitmap; /* One bit set per slot which has memory
* in this shadow page.
*/
@@ -159,7 +161,7 @@ struct kvm_mmu {
u64 *pae_root;
};
-#define KVM_NR_MEM_OBJS 20
+#define KVM_NR_MEM_OBJS 40
struct kvm_mmu_memory_cache {
int nobjs;
@@ -402,6 +404,7 @@ struct kvm_memory_slot {
unsigned long npages;
unsigned long flags;
struct page **phys_mem;
+ unsigned long *rmap;
unsigned long *dirty_bitmap;
};
@@ -554,6 +557,7 @@ struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
extern hpa_t bad_page_address;
+gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
void mark_page_dirty(struct kvm *kvm, gfn_t gfn);