diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-20 07:25:19 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:41 -0500 |
commit | 283d0c65e4c277cf81d71418341c74eee199d149 (patch) | |
tree | 687beb9dc34ea52eae26de6a1a984da9005fbdb2 | |
parent | 953899b659adce62cbe83d6a7527550ab8797c48 (diff) |
KVM: Disentangle mmu notifiers and coalesced_mmio registration
They aren't related.
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | virt/kvm/kvm_main.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a944be392d6e..92f5c98b6c4d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -374,17 +374,16 @@ static struct kvm *kvm_create_vm(void) | |||
374 | #endif | 374 | #endif |
375 | 375 | ||
376 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) | 376 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) |
377 | { | 377 | kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops; |
378 | kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops; | 378 | r = mmu_notifier_register(&kvm->mmu_notifier, current->mm); |
379 | r = mmu_notifier_register(&kvm->mmu_notifier, current->mm); | 379 | #endif |
380 | if (r) { | 380 | |
381 | if (r) { | ||
381 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET | 382 | #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET |
382 | put_page(page); | 383 | put_page(page); |
383 | #endif | 384 | #endif |
384 | goto out_err; | 385 | goto out_err; |
385 | } | ||
386 | } | 386 | } |
387 | #endif | ||
388 | 387 | ||
389 | kvm->mm = current->mm; | 388 | kvm->mm = current->mm; |
390 | atomic_inc(&kvm->mm->mm_count); | 389 | atomic_inc(&kvm->mm->mm_count); |
@@ -406,11 +405,8 @@ static struct kvm *kvm_create_vm(void) | |||
406 | out: | 405 | out: |
407 | return kvm; | 406 | return kvm; |
408 | 407 | ||
409 | #if defined(KVM_COALESCED_MMIO_PAGE_OFFSET) || \ | ||
410 | (defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)) | ||
411 | out_err: | 408 | out_err: |
412 | hardware_disable_all(); | 409 | hardware_disable_all(); |
413 | #endif | ||
414 | out_err_nodisable: | 410 | out_err_nodisable: |
415 | kfree(kvm); | 411 | kfree(kvm); |
416 | return ERR_PTR(r); | 412 | return ERR_PTR(r); |