diff options
author | Nathan Rossi <nathan.rossi@xilinx.com> | 2013-12-10 17:51:35 +1000 |
---|---|---|
committer | Nathan Rossi <nathan.rossi@xilinx.com> | 2013-12-11 15:37:59 +1000 |
commit | 82fcd5710441815ef5ab1677db7f724b84f2ae45 (patch) | |
tree | 60b8b8db62f655906038f9740f123ce447971ea9 /recipes-devtools | |
parent | 6e06d20596681ac60dc3eaae5560daaa09dcd863 (diff) | |
download | meta-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.patch | 101 | ||||
-rw-r--r-- | recipes-devtools/qemu/qemu_1.6.1.bbappend | 1 |
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 @@ | |||
1 | Subject: [qom,v1,1/1] qom/object.c: Split out object and class caches. | ||
2 | From: Peter Crosthwaite <peter.crosthwaite@xilinx.com> | ||
3 | Message-Id: <23ad4a5a9283ffcf4fc384832f369df46db18ef6.1385612379.git.peter.crosthwaite@xilinx.com> | ||
4 | To: qemu-devel@nongnu.org, | ||
5 | aliguori@us.ibm.com, | ||
6 | pbonzini@redhat.com | ||
7 | Cc: afaerber@suse.de | ||
8 | Date: Wed, 27 Nov 2013 20:27:33 -0800 | ||
9 | |||
10 | The object-cast and class-cast caches cannot be shared because class | ||
11 | caching is conditional on the target type not being an interface and | ||
12 | object caching is unconditional. Leads to a bug when a class cast | ||
13 | to an interface follows an object cast to the same interface type: | ||
14 | |||
15 | FooObject = FOO(obj); | ||
16 | FooClass = FOO_GET_CLASS(obj); | ||
17 | |||
18 | Where TYPE_FOO is an interface. The first (object) cast will be | ||
19 | successful and cache the casting result (i.e. TYPE_FOO will be cached). | ||
20 | The second (class) cast will then check the shared cast cache | ||
21 | and register a hit. The issue is, when a class cast hits in the cache | ||
22 | it just returns a pointer cast of the input class (i.e. the concrete | ||
23 | class). | ||
24 | |||
25 | When casting to an interface, the cast itself must return the | ||
26 | interface class, not the concrete class. The implementation of class | ||
27 | cast caching already ensures that the returned cast result is only | ||
28 | a pointer cast before caching. The object cast logic however does | ||
29 | not have this check. | ||
30 | |||
31 | Resolve by just splitting the object and class caches. | ||
32 | |||
33 | Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> | ||
34 | Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> | ||
35 | Upstream-Status: Pending [Pulled from upstream mailing list] | ||
36 | --- | ||
37 | include/qom/object.h | 3 ++- | ||
38 | qom/object.c | 13 +++++++------ | ||
39 | 2 files changed, 9 insertions(+), 7 deletions(-) | ||
40 | |||
41 | diff --git a/include/qom/object.h b/include/qom/object.h | ||
42 | index 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 | }; | ||
55 | diff --git a/qom/object.c b/qom/object.c | ||
56 | index 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 | " |