diff options
author | Sasha Levin <levinsasha928@gmail.com> | 2011-07-20 13:59:00 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 12:17:57 -0400 |
commit | 2b3c246a682c50f5415c71fc5387a114a6f0d643 (patch) | |
tree | e520633a4c5460bd4e8ebd761af06d1a3af8b722 /virt/kvm/coalesced_mmio.h | |
parent | 8c3ba334f8588e1d5099f8602cf01897720e0eca (diff) |
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.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/virt/kvm/coalesced_mmio.h b/virt/kvm/coalesced_mmio.h index 8a5959e3535f..b280c20444d1 100644 --- a/virt/kvm/coalesced_mmio.h +++ b/virt/kvm/coalesced_mmio.h | |||
@@ -12,14 +12,13 @@ | |||
12 | 12 | ||
13 | #ifdef CONFIG_KVM_MMIO | 13 | #ifdef CONFIG_KVM_MMIO |
14 | 14 | ||
15 | #define KVM_COALESCED_MMIO_ZONE_MAX 100 | 15 | #include <linux/list.h> |
16 | 16 | ||
17 | struct kvm_coalesced_mmio_dev { | 17 | struct kvm_coalesced_mmio_dev { |
18 | struct list_head list; | ||
18 | struct kvm_io_device dev; | 19 | struct kvm_io_device dev; |
19 | struct kvm *kvm; | 20 | struct kvm *kvm; |
20 | spinlock_t lock; | 21 | struct kvm_coalesced_mmio_zone zone; |
21 | int nb_zones; | ||
22 | struct kvm_coalesced_mmio_zone zone[KVM_COALESCED_MMIO_ZONE_MAX]; | ||
23 | }; | 22 | }; |
24 | 23 | ||
25 | int kvm_coalesced_mmio_init(struct kvm *kvm); | 24 | int kvm_coalesced_mmio_init(struct kvm *kvm); |