From: Ian Campbell Subject: Re: [RFC PATCH v1 03/10] xen/arm: move vgic data to vgic driver Date: Fri, 21 Mar 2014 09:22:17 +0000 Message-ID: <1395393737.27358.1.camel@kazak.uk.xensource.com> References: <1395238631-2024-1-git-send-email-vijay.kilari@gmail.com> <1395238631-2024-4-git-send-email-vijay.kilari@gmail.com> <532B2BE6.6020206@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: vijay.kilari@gmail.com, Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , Julien Grall , xen-devel@lists.xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-03-20 at 18:11 +0000, Stefano Stabellini wrote: > On Thu, 20 Mar 2014, Julien Grall wrote: > > On 03/20/2014 05:14 PM, Stefano Stabellini wrote: > > > On Wed, 19 Mar 2014, vijay.kilari@gmail.com wrote: > > >> @@ -142,7 +133,7 @@ struct arch_domain > > >> spinlock_t lock; > > >> int ctlr; > > >> int nr_lines; /* Number of SPIs */ > > >> - struct vgic_irq_rank *shared_irqs; > > >> + void *shared_irqs; > > > > > > I would prefer to avoid void* fields. Either we introduce a > > > vgic_irq_rank union that can be v2 or v3, or we could have a single > > > opaque void* pointer that each vgic implementation can use for whatever > > > they like. I think that the union is probably better because it would > > > let us avoid quite a few casts in the code. > > > > > > > Most of the cast can be removed without this trick :). > > > > IHMO, void * might better to avoid expanding the domain/VCPU structure. > > We are already close to the 1 page size. > > A pointer is fine, that is not an issue. > However we should try to avoid the usage of void* as a way to avoid type > checking at compile time. Yes. A (pointer to a) union is probably the way to go (not having reviewed the series myself yet mind). Ian.