xemu/include
Peter Crosthwaite 2dc7975300 qom: Split out object and class caches
The object-cast and class-cast caches cannot be shared because class
caching is conditional on the target type not being an interface and
object caching is unconditional. Leads to a bug when a class cast
to an interface follows an object cast to the same interface type:

FooObject = FOO(obj);
FooClass = FOO_GET_CLASS(obj);

Where TYPE_FOO is an interface. The first (object) cast will be
successful and cache the casting result (i.e. TYPE_FOO will be cached).
The second (class) cast will then check the shared cast cache
and register a hit. The issue is, when a class cast hits in the cache
it just returns a pointer cast of the input class (i.e. the concrete
class).

When casting to an interface, the cast itself must return the
interface class, not the concrete class. The implementation of class
cast caching already ensures that the returned cast result is only
a pointer cast before caching. The object cast logic however does
not have this check.

Resolve by just splitting the object and class caches.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Nathan Rossi <nathan.rossi@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit 0ab4c94c84)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2014-02-20 21:59:18 -06:00
..
block coroutine: add co_aio_sleep_ns() to allow sleep in block drivers 2013-10-30 12:22:09 +01:00
disas Add moxie disassembler 2013-03-23 14:25:41 +00:00
exec pci, pc, acpi fixes, enhancements 2013-10-31 16:58:32 +01:00
fpu softfloat: Implement uint64_to_float128 2013-01-05 10:12:50 +00:00
hw virtio-scsi: switch exit callback to VirtioDeviceClass 2014-02-20 21:36:15 -06:00
migration migration: add version supporting macros for struct pointer 2013-09-24 13:22:50 +02:00
monitor Merge remote-tracking branch 'kwolf/for-anthony' into staging 2013-09-03 12:32:46 -05:00
net net: disallow to specify multicast MAC address 2013-11-08 17:32:34 +01:00
qapi qemu-ga: Extend 'guest-info' command to expose flag 'success-response' 2013-10-10 14:52:37 -05:00
qemu atomic.h: Fix build with clang 2013-11-21 17:38:57 +01:00
qom qom: Split out object and class caches 2014-02-20 21:59:18 -06:00
sysemu qmp: access the local QemuOptsLists for drive option 2013-11-14 13:09:07 +01:00
ui spice: fix multihead support 2013-10-17 12:42:54 +02:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h target-ppc: dump-guest-memory support 2013-10-25 23:25:48 +02:00
glib-compat.h glib: add a compatibility interface for g_timeout_add_seconds 2013-03-25 13:10:40 -05:00
qemu-common.h qmp: add interface blockdev-snapshot-delete-internal-sync 2013-09-12 10:12:47 +02:00
qemu-io.h qemu-io: Interface cleanup 2013-06-06 11:27:05 +02:00
trace.h build: some simplifications for "trace/Makefile.objs" 2013-01-12 18:42:51 +01:00