aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-20 08:13:43 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:41 -0500
commit980da6ce573b7c40886406674ff8f022a975e65e (patch)
treeb8751c6b766e937ea137d84a48d248b63c2ac02d /virt/kvm/kvm_main.c
parent50eb2a3cd0f50d912b26d0b79b7f443344608390 (diff)
KVM: Simplify coalesced mmio initialization
- add destructor function - move related allocation into constructor - add stubs for !CONFIG_KVM_MMIO Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index c10d117c4317..bc23b8e0609b 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -51,9 +51,7 @@
51#include <asm/pgtable.h> 51#include <asm/pgtable.h>
52#include <asm-generic/bitops/le.h> 52#include <asm-generic/bitops/le.h>
53 53
54#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
55#include "coalesced_mmio.h" 54#include "coalesced_mmio.h"
56#endif
57 55
58#define CREATE_TRACE_POINTS 56#define CREATE_TRACE_POINTS
59#include <trace/events/kvm.h> 57#include <trace/events/kvm.h>
@@ -468,10 +466,7 @@ static void kvm_destroy_vm(struct kvm *kvm)
468 kvm_free_irq_routing(kvm); 466 kvm_free_irq_routing(kvm);
469 kvm_io_bus_destroy(&kvm->pio_bus); 467 kvm_io_bus_destroy(&kvm->pio_bus);
470 kvm_io_bus_destroy(&kvm->mmio_bus); 468 kvm_io_bus_destroy(&kvm->mmio_bus);
471#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET 469 kvm_coalesced_mmio_free(kvm);
472 if (kvm->coalesced_mmio_ring != NULL)
473 free_page((unsigned long)kvm->coalesced_mmio_ring);
474#endif
475#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) 470#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
476 mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm); 471 mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm);
477#else 472#else