diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-20 14:25:19 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 12:35:41 -0300 |
commit | 283d0c65e4c277cf81d71418341c74eee199d149 (patch) | |
tree | 687beb9dc34ea52eae26de6a1a984da9005fbdb2 /virt | |
parent | 953899b659adce62cbe83d6a7527550ab8797c48 (diff) | |
download | linux-283d0c65e4c277cf81d71418341c74eee199d149.tar.gz linux-283d0c65e4c277cf81d71418341c74eee199d149.tar.bz2 linux-283d0c65e4c277cf81d71418341c74eee199d149.zip |
KVM: Disentangle mmu notifiers and coalesced_mmio registration
They aren't related.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-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) #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); @@ -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); |