Skip to content

Commit

Permalink
KVM: Disentangle mmu notifiers and coalesced_mmio registration
Browse files Browse the repository at this point in the history
They aren't related.

Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
avikivity authored and matosatti committed Mar 1, 2010
1 parent 953899b commit 283d0c6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,16 @@ static struct kvm *kvm_create_vm(void)
#endif

#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
{
kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops;
r = mmu_notifier_register(&kvm->mmu_notifier, current->mm);
if (r) {
kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops;
r = mmu_notifier_register(&kvm->mmu_notifier, current->mm);
#endif

if (r) {
#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
put_page(page);
put_page(page);
#endif
goto out_err;
}
goto out_err;
}
#endif

kvm->mm = current->mm;
atomic_inc(&kvm->mm->mm_count);
Expand All @@ -406,11 +405,8 @@ static struct kvm *kvm_create_vm(void)
out:
return kvm;

#if defined(KVM_COALESCED_MMIO_PAGE_OFFSET) || \
(defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER))
out_err:
hardware_disable_all();
#endif
out_err_nodisable:
kfree(kvm);
return ERR_PTR(r);
Expand Down

0 comments on commit 283d0c6

Please sign in to comment.