Commit 283d0c65 authored by Avi Kivity's avatar Avi Kivity Committed by Marcelo Tosatti

KVM: Disentangle mmu notifiers and coalesced_mmio registration

They aren't related.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 953899b6
...@@ -374,17 +374,16 @@ static struct kvm *kvm_create_vm(void) ...@@ -374,17 +374,16 @@ static struct kvm *kvm_create_vm(void)
#endif #endif
#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
{
kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops; kvm->mmu_notifier.ops = &kvm_mmu_notifier_ops;
r = mmu_notifier_register(&kvm->mmu_notifier, current->mm); r = mmu_notifier_register(&kvm->mmu_notifier, current->mm);
#endif
if (r) { if (r) {
#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET #ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
put_page(page); put_page(page);
#endif #endif
goto out_err; goto out_err;
} }
}
#endif
kvm->mm = current->mm; kvm->mm = current->mm;
atomic_inc(&kvm->mm->mm_count); atomic_inc(&kvm->mm->mm_count);
...@@ -406,11 +405,8 @@ static struct kvm *kvm_create_vm(void) ...@@ -406,11 +405,8 @@ static struct kvm *kvm_create_vm(void)
out: out:
return kvm; return kvm;
#if defined(KVM_COALESCED_MMIO_PAGE_OFFSET) || \
(defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER))
out_err: out_err:
hardware_disable_all(); hardware_disable_all();
#endif
out_err_nodisable: out_err_nodisable:
kfree(kvm); kfree(kvm);
return ERR_PTR(r); return ERR_PTR(r);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment