diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:27 -0500 |
commit | e2dec939db126989808853d218e426daaeebc9e2 (patch) | |
tree | 5c742e609e43090df396fc1c7a6b4c526099dbea /drivers/kvm/paging_tmpl.h | |
parent | 714b93da1a6d97307dfafb9915517879d8a66c0d (diff) |
[PATCH] KVM: MMU: Detect oom conditions and propagate error to userspace
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 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 4e6670ff1847..32b385188454 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -339,7 +339,8 @@ static int FNAME(fix_write_pf)(struct kvm_vcpu *vcpu, | |||
339 | * - normal guest page fault due to the guest pte marked not present, not | 339 | * - normal guest page fault due to the guest pte marked not present, not |
340 | * writable, or not executable | 340 | * writable, or not executable |
341 | * | 341 | * |
342 | * Returns: 1 if we need to emulate the instruction, 0 otherwise | 342 | * Returns: 1 if we need to emulate the instruction, 0 otherwise, or |
343 | * a negative value on error. | ||
343 | */ | 344 | */ |
344 | static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | 345 | static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, |
345 | u32 error_code) | 346 | u32 error_code) |
@@ -351,10 +352,13 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
351 | u64 *shadow_pte; | 352 | u64 *shadow_pte; |
352 | int fixed; | 353 | int fixed; |
353 | int write_pt = 0; | 354 | int write_pt = 0; |
355 | int r; | ||
354 | 356 | ||
355 | pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); | 357 | pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); |
356 | 358 | ||
357 | mmu_topup_memory_caches(vcpu); | 359 | r = mmu_topup_memory_caches(vcpu); |
360 | if (r) | ||
361 | return r; | ||
358 | 362 | ||
359 | /* | 363 | /* |
360 | * Look up the shadow pte for the faulting address. | 364 | * Look up the shadow pte for the faulting address. |