diff options
author | Avi Kivity <avi@qumranet.com> | 2007-06-04 08:58:30 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 05:05:45 -0400 |
commit | 17c3ba9d37dbda490792a2b52953f09d0dee30d6 (patch) | |
tree | 44749b8658b61c7aa6cdb38d7823fa061d24b12c /drivers/kvm/svm.c | |
parent | bd2b2baa5c5fbb08b4b0df7508ff419407f7ece6 (diff) |
KVM: Lazy guest cr3 switching
Switch guest paging context may require us to allocate memory, which
might fail. Instead of wiring up error paths everywhere, make context
switching lazy and actually do the switch before the next guest entry,
where we can return an error if allocation fails.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 6cd6a50a0340..ec040e2f8c58 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -1483,6 +1483,10 @@ static int svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1483 | int r; | 1483 | int r; |
1484 | 1484 | ||
1485 | again: | 1485 | again: |
1486 | r = kvm_mmu_reload(vcpu); | ||
1487 | if (unlikely(r)) | ||
1488 | return r; | ||
1489 | |||
1486 | if (!vcpu->mmio_read_completed) | 1490 | if (!vcpu->mmio_read_completed) |
1487 | do_interrupt_requests(vcpu, kvm_run); | 1491 | do_interrupt_requests(vcpu, kvm_run); |
1488 | 1492 | ||