aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-01-05 19:36:53 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:27 -0500
commit714b93da1a6d97307dfafb9915517879d8a66c0d (patch)
tree619f30567c9e13b79830301023bef58b98b8f433 /drivers/kvm/paging_tmpl.h
parentf51234c2cd3ab8bed836e09686e27877e1b55f2a (diff)
[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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 6acb16ea5ce..4e6670ff184 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,
323 mark_page_dirty(vcpu->kvm, gfn); 323 mark_page_dirty(vcpu->kvm, gfn);
324 *shadow_ent |= PT_WRITABLE_MASK; 324 *shadow_ent |= PT_WRITABLE_MASK;
325 *guest_ent |= PT_DIRTY_MASK; 325 *guest_ent |= PT_DIRTY_MASK;
326 rmap_add(vcpu->kvm, shadow_ent); 326 rmap_add(vcpu, shadow_ent);
327 327
328 return 1; 328 return 1;
329} 329}
@@ -353,6 +353,9 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
353 int write_pt = 0; 353 int write_pt = 0;
354 354
355 pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); 355 pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code);
356
357 mmu_topup_memory_caches(vcpu);
358
356 /* 359 /*
357 * Look up the shadow pte for the faulting address. 360 * Look up the shadow pte for the faulting address.
358 */ 361 */