Blame 0039-qxl-fix-release-ring-overrun.patch

Justin M. Forbes a81953
From 9394cbaab7701fe421d5c0168854d39d6a8ecfc2 Mon Sep 17 00:00:00 2001
Justin M. Forbes a81953
From: Gerd Hoffmann <kraxel@redhat.com>
Justin M. Forbes a81953
Date: Tue, 7 Sep 2010 16:45:27 +0200
Justin M. Forbes a81953
Subject: [PATCH 39/39] qxl: fix release ring overrun
Justin M. Forbes a81953
Justin M. Forbes a81953
---
Justin M. Forbes a81953
 hw/qxl.c |    6 +++---
Justin M. Forbes a81953
 1 files changed, 3 insertions(+), 3 deletions(-)
Justin M. Forbes a81953
Justin M. Forbes a81953
diff --git a/hw/qxl.c b/hw/qxl.c
Justin M. Forbes a81953
index 4a15200..8448893 100644
Justin M. Forbes a81953
--- a/hw/qxl.c
Justin M. Forbes a81953
+++ b/hw/qxl.c
Justin M. Forbes a81953
@@ -377,10 +377,10 @@ static inline void qxl_push_free_res(PCIQXLDevice *d)
Justin M. Forbes a81953
     QXLReleaseRing *ring = &d->ram->release_ring;
Justin M. Forbes a81953
     uint64_t *item;
Justin M. Forbes a81953
Justin M. Forbes a81953
-#define QXL_FREE_BUNCH_SIZE 10
Justin M. Forbes a81953
+#define QXL_FREE_BUNCH_SIZE 32
Justin M. Forbes a81953
Justin M. Forbes a81953
-    if (SPICE_RING_IS_EMPTY(ring) || (d->num_free_res == QXL_FREE_BUNCH_SIZE &&
Justin M. Forbes a81953
-                                      ring->prod - ring->cons + 1 != ring->num_items)) {
Justin M. Forbes a81953
+    if (SPICE_RING_IS_EMPTY(ring) || (d->num_free_res >= QXL_FREE_BUNCH_SIZE &&
Justin M. Forbes a81953
+                                      ring->prod - ring->cons + 2 != ring->num_items)) {
Justin M. Forbes a81953
         int notify;
Justin M. Forbes a81953
Justin M. Forbes a81953
         SPICE_RING_PUSH(ring, notify);
Justin M. Forbes a81953
-- 
Justin M. Forbes a81953
1.7.2.3
Justin M. Forbes a81953