[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 08/24] xen/arm: Allow virq != irq



On 27/02/15 14:44, Ian Campbell wrote:
> 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.

Oh right, I missed the parentheses part.

The pointer alignment is not the same on ARM32 and ARM64, I need to
think more about it.

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.