Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi

From: Thomas Gleixner
Date: Tue Oct 13 2015 - 09:41:54 EST


On Tue, 13 Oct 2015, Qais Yousef wrote:

Lacks kerneldoc

> +int __irq_desc_send_ipi(struct irq_desc *desc, const struct ipi_mask *dest)
> +{
> + struct irq_data *data = irq_desc_get_irq_data(desc);
> + struct irq_chip *chip = irq_data_get_irq_chip(data);
> +
> + if (!chip || !chip->irq_send_ipi)
> + return -EINVAL;
> +
> + /*
> + * Do not validate the mask for IPIs marked global. These are
> + * regular IPIs so we can avoid the operation as their target
> + * mask is the cpu_possible_mask.
> + */
> + if (!dest->global) {
> + if (!bitmap_subset(dest->cpumask, data->ipi_mask.cpumask,
> + dest->nbits))
> + return -EINVAL;
> + }

This looks half thought out. You rely on the caller getting the global
bit right. There should be a sanity check for this versus
data->ipi_mask and also you need to validate nbits.

> +EXPORT_SYMBOL(irq_send_ipi);

EXPORT_SYMBOL_GPL please

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/