On Thu, 2015-04-09 at 16:09 +0100, Julien Grall wrote:
> From: Julien Grall <julien.gr...@linaro.org>
> 
> 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.campb...@citrix.com>

Ian.


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

Reply via email to