From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbbJMNlj (ORCPT ); Tue, 13 Oct 2015 09:41:39 -0400 Received: from www.linutronix.de ([62.245.132.108]:50057 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752559AbbJMNlh (ORCPT ); Tue, 13 Oct 2015 09:41:37 -0400 Date: Tue, 13 Oct 2015 15:40:59 +0200 (CEST) From: Thomas Gleixner To: Qais Yousef cc: linux-kernel@vger.kernel.org, jason@lakedaemon.net, marc.zyngier@arm.com, jiang.liu@linux.intel.com, ralf@linux-mips.org, linux-mips@linux-mips.org Subject: Re: [RFC v2 PATCH 08/14] irq: implement irq_send_ipi In-Reply-To: <1444731382-19313-9-git-send-email-qais.yousef@imgtec.com> Message-ID: References: <1444731382-19313-1-git-send-email-qais.yousef@imgtec.com> <1444731382-19313-9-git-send-email-qais.yousef@imgtec.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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