On 10/13/2015 02:40 PM, Thomas Gleixner wrote:
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.
Yes I might have rushed this part as I did it last. I'll improve it.
+EXPORT_SYMBOL(irq_send_ipi);
EXPORT_SYMBOL_GPL please
OK.
Thanks,
Qais