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

Re: [Xen-devel] [PATCH v5 p2 01/19] xen/arm: Let the toolstack configure the number of SPIs



On Thu, 2015-04-09 at 16:09 +0100, Julien Grall wrote:
> From: Julien Grall <julien.grall@xxxxxxxxxx>
> 
> Each domain may have a different number of IRQs depending on the devices
> assigned to it.

> Rather re-using the number of IRQs used by the hardwared GIC, let the

         ^than

> toolstack specify the number of SPIs when the domain is created. This
> will avoid to waste memory.

  "will avoid wasting memory."


> +    /* Limit the number of virtual SPIs supported to (1020 - 32) = 988  */
> +    if ( (nr_spis + NR_LOCAL_IRQS) > 1020 )
> +        return -EINVAL;

If there's any chance this can be called by not-completely trusted code
(e.g. a disaggregated toolstack) then this if susceptible to an overflow
(sorry, I gave you this code in a previous rev).

I think you can just move the NR_LOCAL_IRQS to the other side of the
expression, i.e.
    if ( nr_spis > 1020 - NR_LOCAL_IRQS )

With that and the grammar fixed:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Ian.


_______________________________________________
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®.