diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-06 00:36:53 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 07:55:27 (GMT) |
commit | 714b93da1a6d97307dfafb9915517879d8a66c0d (patch) | |
tree | 619f30567c9e13b79830301023bef58b98b8f433 /drivers/kvm/paging_tmpl.h | |
parent | f51234c2cd3ab8bed836e09686e27877e1b55f2a (diff) | |
download | linux-fsl-qoriq-714b93da1a6d97307dfafb9915517879d8a66c0d.tar.xz |
[PATCH] KVM: MMU: Replace atomic allocations by preallocated objects
The mmu sometimes needs memory for reverse mapping and parent pte chains.
however, we can't allocate from within the mmu because of the atomic context.
So, move the allocations to a central place that can be executed before the
main mmu machinery, where we can bail out on failure before any damage is
done.
(error handling is deffered for now, but the basic structure is there)
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 'drivers/kvm/paging_tmpl.h')
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 6acb16e..4e6670ff 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -323,7 +323,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); + rmap_add(vcpu, shadow_ent); return 1; } @@ -353,6 +353,9 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, int write_pt = 0; pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); + + mmu_topup_memory_caches(vcpu); + /* * Look up the shadow pte for the faulting address. */ |