[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 11/24] cpu/a15mpcore: Embed GICState
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v3 11/24] cpu/a15mpcore: Embed GICState |
Date: |
Thu, 22 Aug 2013 12:41:10 +0100 |
On 22 August 2013 11:56, Andreas Färber <address@hidden> wrote:
> Am 21.08.2013 23:05, schrieb Peter Maydell:
> Not sure if a union of only one member is permitted? We're not actually
> accessing the GICState, only void* and DEVICE()/SYS_BUS_DEVICE(), so it
> just needs to block the memory, hopefully without needing to distinguish
> between ->gic.emulated and ->gic.kvm pointers.
Yes, but we need to actually have the right amount of memory
even if we don't care which of the subclasses this is. When
we were just storing a pointer this worked fine, because we
effectively deferred to the "create me a Foo" code to allocate
the right amount of memory for the specific object it returned.
> The decision doesn't depend on any user-settable property, just on the
> at this point global kvm_enabled() state, so I see nowhere else to
> allocate it dynamically.
>
> If you change the .instance_size struct one of the GICs uses, then a
> number of places will need to be reviewed, including
> ARM_GIC_COMMON()[*], ARM_GIC() and KVM_ARM_GIC() all returning the same
> type.
Yes, but those are part of the implementation, not the users,
and also they will be easy to find because there will be compile
errors where we've changed the type returned by one of those
macros but we haven't updated the callsite. (Conversely, users
which don't care which specific subclass they're dealing with
can continue to use the struct and macro corresponding to
the common base class.)
If there was a variant of object_initialize() that checked that
sizeof(*obj) was at least as big as the size of the object
instance that would be useful. (Would need to be a macro,
and I think we'd need to expose a function for "how big is
this type anyway").
-- PMM
- [Qemu-devel] [PATCH v3 00/24] arm: ARM11MPCore+A9MPCore+A15MPCore QOM'ification, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 02/24] intc/arm_gic: Extract headers hw/intc/arm_gic{, _common}.h, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 14/24] a9scu: Build only once, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 01/24] cpu/a9mpcore: Split off instance_init, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 03/24] cpu/a9mpcore: Embed GICState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 10/24] cpu/a15mpcore: Split off instance_init, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 08/24] cpu/a9mpcore: Convert to QOM realize, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 11/24] cpu/a15mpcore: Embed GICState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 04/24] misc/a9scu: QOM cleanups, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 15/24] arm11mpcore: Fix typo in MemoryRegion name, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 05/24] cpu/a9mpcore: Embed A9SCUState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 07/24] cpu/a9mpcore: Embed ARMMPTimerState, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 06/24] timer/arm_mptimer: Convert to QOM realize, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 17/24] arm11mpcore: Create container MemoryRegion in instance_init, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 20/24] realview_gic: Convert to QOM realize, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 16/24] arm11mpcore: Drop unused fields, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 21/24] realview_gic: Prepare for QOM embedding, Andreas Färber, 2013/08/20
- [Qemu-devel] [PATCH v3 13/24] cpu/a15mpcore: Prepare for QOM embedding, Andreas Färber, 2013/08/20