summaryrefslogtreecommitdiffstats
path: root/virt/kvm/coalesced_mmio.h
diff options
context:
space:
mode:
authorSasha Levin <levinsasha928@gmail.com>2011-07-20 20:59:00 +0300
committerAvi Kivity <avi@redhat.com>2011-09-25 19:17:57 +0300
commit2b3c246a682c50f5415c71fc5387a114a6f0d643 (patch)
treee520633a4c5460bd4e8ebd761af06d1a3af8b722 /virt/kvm/coalesced_mmio.h
parent8c3ba334f8588e1d5099f8602cf01897720e0eca (diff)
downloadop-kernel-dev-2b3c246a682c50f5415c71fc5387a114a6f0d643.zip
op-kernel-dev-2b3c246a682c50f5415c71fc5387a114a6f0d643.tar.gz
KVM: Make coalesced mmio use a device per zone
This patch changes coalesced mmio to create one mmio device per zone instead of handling all zones in one device. Doing so enables us to take advantage of existing locking and prevents a race condition between coalesced mmio registration/unregistration and lookups. Suggested-by: Avi Kivity <avi@redhat.com> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/coalesced_mmio.h')
-rw-r--r--virt/kvm/coalesced_mmio.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/virt/kvm/coalesced_mmio.h b/virt/kvm/coalesced_mmio.h
index 8a5959e..b280c20 100644
--- a/virt/kvm/coalesced_mmio.h
+++ b/virt/kvm/coalesced_mmio.h
@@ -12,14 +12,13 @@
#ifdef CONFIG_KVM_MMIO
-#define KVM_COALESCED_MMIO_ZONE_MAX 100
+#include <linux/list.h>
struct kvm_coalesced_mmio_dev {
+ struct list_head list;
struct kvm_io_device dev;
struct kvm *kvm;
- spinlock_t lock;
- int nb_zones;
- struct kvm_coalesced_mmio_zone zone[KVM_COALESCED_MMIO_ZONE_MAX];
+ struct kvm_coalesced_mmio_zone zone;
};
int kvm_coalesced_mmio_init(struct kvm *kvm);
OpenPOWER on IntegriCloud