From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 08/24] xen/arm: Allow virq != irq Date: Fri, 27 Feb 2015 14:44:14 +0000 Message-ID: <1425048254.14641.218.camel@citrix.com> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-9-git-send-email-julien.grall@linaro.org> <1424447564.30924.322.camel@citrix.com> <54E76A2C.7030403@linaro.org> <54F08031.1070807@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YRMAJ-0006z4-Gu for xen-devel@lists.xenproject.org; Fri, 27 Feb 2015 14:45:19 +0000 In-Reply-To: <54F08031.1070807@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2015-02-27 at 14:33 +0000, Julien Grall wrote: > Hi Ian, > > On 20/02/15 17:09, Julien Grall wrote: > > On 20/02/15 15:52, Ian Campbell wrote: > >>> > >>> action = xmalloc(struct irqaction); > >>> - if (!action) > >>> + if ( !action ) > >>> + return -ENOMEM; > >>> + > >>> + info = xmalloc(struct irq_guest); > >> > >> FWIW you might (subject to sizing/alignment needs) be able to do > >> action = _xmalloc(sizeof(struct irqaction) + sizeof(struct irq_guest); > >> info = (sturct irq_guest *)(action + 1); > >> > >> which would save some memory overhead for free pointers etc and allow > >> you to avoid manually managing the info. > >> > >> You probably won't like that though, so feel free to ignore. > > > > Actually it's a good idea :). I haven't though about it. > > I though about it. The pointer to irq_guest may not be correctly aligned > with this solution, right? It depends on sizeof(struct irqaction) (which is what I meant by "subject to..."). t'd probably need a ROUNDUP(sizeof(foo), pointer-alignement) in there somewhere. > So I prefer to keep separate the allocation. We can revisit it later. OK.