summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2013-12-10 17:51:35 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2013-12-11 15:37:59 +1000
commit82fcd5710441815ef5ab1677db7f724b84f2ae45 (patch)
tree60b8b8db62f655906038f9740f123ce447971ea9 /recipes-devtools
parent6e06d20596681ac60dc3eaae5560daaa09dcd863 (diff)
downloadmeta-xilinx-82fcd5710441815ef5ab1677db7f724b84f2ae45.tar.gz
qemu: Add patch to resolve MicroBlaze ethernet issues
* Add patch to resolve the QEMU segfault when a AXI Ethernet device attempts to transmit/recieve packets. * Patch is from mailing list, back-ported for 1.6.1. Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/qemu/files/qom_object_c_Split_out_object_and_class_caches.patch101
-rw-r--r--recipes-devtools/qemu/qemu_1.6.1.bbappend1
2 files changed, 102 insertions, 0 deletions
diff --git a/recipes-devtools/qemu/files/qom_object_c_Split_out_object_and_class_caches.patch b/recipes-devtools/qemu/files/qom_object_c_Split_out_object_and_class_caches.patch
new file mode 100644
index 00000000..b64a8391
--- /dev/null
+++ b/recipes-devtools/qemu/files/qom_object_c_Split_out_object_and_class_caches.patch
@@ -0,0 +1,101 @@
1Subject: [qom,v1,1/1] qom/object.c: Split out object and class caches.
2From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
3Message-Id: <23ad4a5a9283ffcf4fc384832f369df46db18ef6.1385612379.git.peter.crosthwaite@xilinx.com>
4To: qemu-devel@nongnu.org,
5 aliguori@us.ibm.com,
6 pbonzini@redhat.com
7Cc: afaerber@suse.de
8Date: Wed, 27 Nov 2013 20:27:33 -0800
9
10The object-cast and class-cast caches cannot be shared because class
11caching is conditional on the target type not being an interface and
12object caching is unconditional. Leads to a bug when a class cast
13to an interface follows an object cast to the same interface type:
14
15FooObject = FOO(obj);
16FooClass = FOO_GET_CLASS(obj);
17
18Where TYPE_FOO is an interface. The first (object) cast will be
19successful and cache the casting result (i.e. TYPE_FOO will be cached).
20The second (class) cast will then check the shared cast cache
21and register a hit. The issue is, when a class cast hits in the cache
22it just returns a pointer cast of the input class (i.e. the concrete
23class).
24
25When casting to an interface, the cast itself must return the
26interface class, not the concrete class. The implementation of class
27cast caching already ensures that the returned cast result is only
28a pointer cast before caching. The object cast logic however does
29not have this check.
30
31Resolve by just splitting the object and class caches.
32
33Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
34Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
35Upstream-Status: Pending [Pulled from upstream mailing list]
36---
37include/qom/object.h | 3 ++-
38 qom/object.c | 13 +++++++------
39 2 files changed, 9 insertions(+), 7 deletions(-)
40
41diff --git a/include/qom/object.h b/include/qom/object.h
42index a275db2..5f78847 100644
43--- a/include/qom/object.h
44+++ b/include/qom/object.h
45@@ -358,7 +358,8 @@ struct ObjectClass
46 Type type;
47 GSList *interfaces;
48
49- const char *cast_cache[OBJECT_CLASS_CAST_CACHE];
50+ const char *object_cast_cache[OBJECT_CLASS_CAST_CACHE];
51+ const char *class_cast_cache[OBJECT_CLASS_CAST_CACHE];
52
53 ObjectUnparent *unparent;
54 };
55diff --git a/qom/object.c b/qom/object.c
56index fc19cf6..21b5a0b 100644
57--- a/qom/object.c
58+++ b/qom/object.c
59@@ -458,7 +458,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
60 Object *inst;
61
62 for (i = 0; obj && i < OBJECT_CLASS_CAST_CACHE; i++) {
63- if (obj->class->cast_cache[i] == typename) {
64+ if (obj->class->object_cast_cache[i] == typename) {
65 goto out;
66 }
67 }
68@@ -475,9 +475,10 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
69
70 if (obj && obj == inst) {
71 for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
72- obj->class->cast_cache[i - 1] = obj->class->cast_cache[i];
73+ obj->class->object_cast_cache[i - 1] =
74+ obj->class->object_cast_cache[i];
75 }
76- obj->class->cast_cache[i - 1] = typename;
77+ obj->class->object_cast_cache[i - 1] = typename;
78 }
79
80 out:
81@@ -547,7 +548,7 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
82 int i;
83
84 for (i = 0; class && i < OBJECT_CLASS_CAST_CACHE; i++) {
85- if (class->cast_cache[i] == typename) {
86+ if (class->class_cast_cache[i] == typename) {
87 ret = class;
88 goto out;
89 }
90@@ -568,9 +569,9 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
91 #ifdef CONFIG_QOM_CAST_DEBUG
92 if (class && ret == class) {
93 for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
94- class->cast_cache[i - 1] = class->cast_cache[i];
95+ class->class_cast_cache[i - 1] = class->class_cast_cache[i];
96 }
97- class->cast_cache[i - 1] = typename;
98+ class->class_cast_cache[i - 1] = typename;
99 }
100 out:
101 #endif
diff --git a/recipes-devtools/qemu/qemu_1.6.1.bbappend b/recipes-devtools/qemu/qemu_1.6.1.bbappend
index 584c2540..46211271 100644
--- a/recipes-devtools/qemu/qemu_1.6.1.bbappend
+++ b/recipes-devtools/qemu/qemu_1.6.1.bbappend
@@ -5,4 +5,5 @@ SRC_URI_append += " \
5 file://microblaze-Add-support-for-loading-initrd-images.patch \ 5 file://microblaze-Add-support-for-loading-initrd-images.patch \
6 file://HACK_target-arm_Harcode_the_SCU_offset.patch \ 6 file://HACK_target-arm_Harcode_the_SCU_offset.patch \
7 file://HACK_zynq_slcr_Bring_SLCR_out_of_reset_in_kernel_state.patch \ 7 file://HACK_zynq_slcr_Bring_SLCR_out_of_reset_in_kernel_state.patch \
8 file://qom_object_c_Split_out_object_and_class_caches.patch \
8 " 9 "