From 6131ce9627f5c601354b0428c2270ed7bf7c12d8 Mon Sep 17 00:00:00 2001 From: Max Bruning Date: Fri, 10 Jun 2011 07:39:01 -0700 Subject: HVM-358 alloc_page leaks memory --- kvm_x86host.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'kvm_x86host.h') diff --git a/kvm_x86host.h b/kvm_x86host.h index 09e1cdd..e52a618 100644 --- a/kvm_x86host.h +++ b/kvm_x86host.h @@ -143,9 +143,14 @@ enum { */ #define KVM_NR_MEM_OBJS 40 +struct kvm_objects { + void *kma_object; + void *kpm_object; +}; + typedef struct kvm_mmu_memory_cache { - int nobjs; - void *objects[KVM_NR_MEM_OBJS]; + int nobjs; /* current number free in cache */ + struct kvm_objects objects[KVM_NR_MEM_OBJS]; } kvm_mmu_memory_cache_t; #define NR_PTE_CHAIN_ENTRIES 5 @@ -196,9 +201,11 @@ typedef struct kvm_mmu_page { union kvm_mmu_page_role role; uint64_t *spt; + char *sptkma; uintptr_t kmp_avlspt; /* hold the gfn of each spte inside spt */ gfn_t *gfns; + char *gfnskma; /* * One bit set per slot which has memory * in this shadow page. @@ -212,6 +219,7 @@ typedef struct kvm_mmu_page { uint64_t *parent_pte; /* !multimapped */ list_t parent_ptes; /* multimapped, kvm_pte_chain */ }; + struct kvm_vcpu *vcpu; /* needed for free */ unsigned long unsync_child_bitmap[BT_BITOUL(512)]; } kvm_mmu_page_t; @@ -257,6 +265,7 @@ typedef struct kvm_mmu { union kvm_mmu_page_role base_role; uint64_t *pae_root; + void *alloc_pae_root; uint64_t rsvd_bits_mask[2][4]; } kvm_mmu_t; -- cgit v1.2.3