summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch')
-rw-r--r--meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch152
1 files changed, 0 insertions, 152 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch b/meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch
deleted file mode 100644
index 4113fc2ad6..0000000000
--- a/meta/recipes-devtools/qemu/qemu-0.14.0/spice-qxl-locking-fix-for-qemu-kvm.patch
+++ /dev/null
@@ -1,152 +0,0 @@
1Description: spice/qxl: locking fix for qemu-kvm
2Author: Gerd Hoffmann <kraxel@redhat.com>
3Source: upstream, http://patchwork.ozlabs.org/patch/84704/
4Forwarding: not-needed
5
6Upstream-Status: Pending
7
8Index: qemu-0.14.0/hw/qxl.c
9===================================================================
10--- qemu-0.14.0.orig/hw/qxl.c
11+++ qemu-0.14.0/hw/qxl.c
12@@ -125,6 +125,27 @@ static void qxl_reset_memslots(PCIQXLDev
13 static void qxl_reset_surfaces(PCIQXLDevice *d);
14 static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
15
16+/* qemu-kvm locking ... */
17+void qxl_unlock_iothread(SimpleSpiceDisplay *ssd)
18+{
19+ if (cpu_single_env) {
20+ assert(ssd->env == NULL);
21+ ssd->env = cpu_single_env;
22+ cpu_single_env = NULL;
23+ }
24+ qemu_mutex_unlock_iothread();
25+}
26+
27+void qxl_lock_iothread(SimpleSpiceDisplay *ssd)
28+{
29+ qemu_mutex_lock_iothread();
30+ if (ssd->env) {
31+ assert(cpu_single_env == NULL);
32+ cpu_single_env = ssd->env;
33+ ssd->env = NULL;
34+ }
35+}
36+
37 static inline uint32_t msb_mask(uint32_t val)
38 {
39 uint32_t mask;
40@@ -662,10 +683,10 @@ static void qxl_hard_reset(PCIQXLDevice
41 dprint(d, 1, "%s: start%s\n", __FUNCTION__,
42 loadvm ? " (loadvm)" : "");
43
44- qemu_mutex_unlock_iothread();
45+ qxl_unlock_iothread(&d->ssd);
46 d->ssd.worker->reset_cursor(d->ssd.worker);
47 d->ssd.worker->reset_image_cache(d->ssd.worker);
48- qemu_mutex_lock_iothread();
49+ qxl_lock_iothread(&d->ssd);
50 qxl_reset_surfaces(d);
51 qxl_reset_memslots(d);
52
53@@ -795,9 +816,9 @@ static void qxl_reset_surfaces(PCIQXLDev
54 {
55 dprint(d, 1, "%s:\n", __FUNCTION__);
56 d->mode = QXL_MODE_UNDEFINED;
57- qemu_mutex_unlock_iothread();
58+ qxl_unlock_iothread(&d->ssd);
59 d->ssd.worker->destroy_surfaces(d->ssd.worker);
60- qemu_mutex_lock_iothread();
61+ qxl_lock_iothread(&d->ssd);
62 memset(&d->guest_surfaces.cmds, 0, sizeof(d->guest_surfaces.cmds));
63 }
64
65@@ -866,9 +887,9 @@ static void qxl_destroy_primary(PCIQXLDe
66 dprint(d, 1, "%s\n", __FUNCTION__);
67
68 d->mode = QXL_MODE_UNDEFINED;
69- qemu_mutex_unlock_iothread();
70+ qxl_unlock_iothread(&d->ssd);
71 d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0);
72- qemu_mutex_lock_iothread();
73+ qxl_lock_iothread(&d->ssd);
74 }
75
76 static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
77@@ -938,10 +959,10 @@ static void ioport_write(void *opaque, u
78 case QXL_IO_UPDATE_AREA:
79 {
80 QXLRect update = d->ram->update_area;
81- qemu_mutex_unlock_iothread();
82+ qxl_unlock_iothread(&d->ssd);
83 d->ssd.worker->update_area(d->ssd.worker, d->ram->update_surface,
84 &update, NULL, 0, 0);
85- qemu_mutex_lock_iothread();
86+ qxl_lock_iothread(&d->ssd);
87 break;
88 }
89 case QXL_IO_NOTIFY_CMD:
90Index: qemu-0.14.0/ui/spice-display.c
91===================================================================
92--- qemu-0.14.0.orig/ui/spice-display.c
93+++ qemu-0.14.0/ui/spice-display.c
94@@ -186,18 +186,18 @@ void qemu_spice_create_host_primary(Simp
95 surface.mem = (intptr_t)ssd->buf;
96 surface.group_id = MEMSLOT_GROUP_HOST;
97
98- qemu_mutex_unlock_iothread();
99+ qxl_unlock_iothread(ssd);
100 ssd->worker->create_primary_surface(ssd->worker, 0, &surface);
101- qemu_mutex_lock_iothread();
102+ qxl_lock_iothread(ssd);
103 }
104
105 void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
106 {
107 dprint(1, "%s:\n", __FUNCTION__);
108
109- qemu_mutex_unlock_iothread();
110+ qxl_unlock_iothread(ssd);
111 ssd->worker->destroy_primary_surface(ssd->worker, 0);
112- qemu_mutex_lock_iothread();
113+ qxl_lock_iothread(ssd);
114 }
115
116 void qemu_spice_vm_change_state_handler(void *opaque, int running, int reason)
117@@ -207,9 +207,9 @@ void qemu_spice_vm_change_state_handler(
118 if (running) {
119 ssd->worker->start(ssd->worker);
120 } else {
121- qemu_mutex_unlock_iothread();
122+ qxl_unlock_iothread(ssd);
123 ssd->worker->stop(ssd->worker);
124- qemu_mutex_lock_iothread();
125+ qxl_lock_iothread(ssd);
126 }
127 ssd->running = running;
128 }
129Index: qemu-0.14.0/ui/spice-display.h
130===================================================================
131--- qemu-0.14.0.orig/ui/spice-display.h
132+++ qemu-0.14.0/ui/spice-display.h
133@@ -43,6 +43,9 @@ typedef struct SimpleSpiceDisplay {
134 QXLRect dirty;
135 int notify;
136 int running;
137+
138+ /* qemu-kvm locking ... */
139+ void *env;
140 } SimpleSpiceDisplay;
141
142 typedef struct SimpleSpiceUpdate {
143@@ -52,6 +55,9 @@ typedef struct SimpleSpiceUpdate {
144 uint8_t *bitmap;
145 } SimpleSpiceUpdate;
146
147+void qxl_unlock_iothread(SimpleSpiceDisplay *ssd);
148+void qxl_lock_iothread(SimpleSpiceDisplay *ssd);
149+
150 int qemu_spice_rect_is_empty(const QXLRect* r);
151 void qemu_spice_rect_union(QXLRect *dest, const QXLRect *r);
152