Re: [patch 2/4] KVM: move coalesced_mmio locking to its own device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcelo Tosatti wrote:
Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

Index: kvm/virt/kvm/coalesced_mmio.c
===================================================================
--- kvm.orig/virt/kvm/coalesced_mmio.c
+++ kvm/virt/kvm/coalesced_mmio.c
@@ -26,9 +26,10 @@ static int coalesced_mmio_in_range(struc
 	if (!is_write)
 		return 0;
- /* kvm->lock is taken by the caller and must be not released before
-         * dev.read/write
-         */
+	/*
+ 	 * dev->lock must not be released before coalesced_mmio_write.
+	 */
+	mutex_lock(&dev->lock);
/* Are we able to batch it ? */ @@ -41,6 +42,7 @@ static int coalesced_mmio_in_range(struc
 							KVM_COALESCED_MMIO_MAX;
 	if (next == dev->kvm->coalesced_mmio_ring->first) {
 		/* full */
+		mutex_unlock(&dev->lock);
 		return 0;
 	}
@@ -57,6 +59,7 @@ static int coalesced_mmio_in_range(struc
 		    addr + len <= zone->addr + zone->size)
 			return 1;
 	}
+	mutex_unlock(&dev->lock);
 	return 0;
 }

So we have a function that takes a lock and conditionally releases it?


--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux