From 2b3c246a682c50f5415c71fc5387a114a6f0d643 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 20 Jul 2011 20:59:00 +0300 Subject: 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 Signed-off-by: Sasha Levin Signed-off-by: Marcelo Tosatti --- virt/kvm/coalesced_mmio.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'virt/kvm/coalesced_mmio.h') diff --git a/virt/kvm/coalesced_mmio.h b/virt/kvm/coalesced_mmio.h index 8a5959e3535..b280c20444d 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 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); -- cgit v1.2.3