From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946571AbcBROh2 (ORCPT ); Thu, 18 Feb 2016 09:37:28 -0500 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:60710 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946451AbcBROhY (ORCPT ); Thu, 18 Feb 2016 09:37:24 -0500 Date: Thu, 18 Feb 2016 14:37:09 +0000 From: Russell King - ARM Linux To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Daniel Thompson , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/9] ARM: change NR_IPIS to 8 Message-ID: <20160218143709.GQ19428@n2100.arm.linux.org.uk> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> <1455804123-2526139-3-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455804123-2526139-3-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2016 at 03:01:54PM +0100, Arnd Bergmann wrote: > When function tracing for IPIs is enabled, we get a warning for an > overflow of the ipi_types array with the IPI_CPU_BACKTRACE type > as triggered by raise_nmi(): > > arch/arm/kernel/smp.c: In function 'raise_nmi': > arch/arm/kernel/smp.c:489:2: error: array subscript is above array bounds [-Werror=array-bounds] > trace_ipi_raise(target, ipi_types[ipinr]); We really don't want to treat the backtrace IPI as a normal IPI at all - we want it to invoke the least amount of code possible. Hence this code which avoids the issue: if ((unsigned)ipinr < NR_IPI) { trace_ipi_entry_rcuidle(ipi_types[ipinr]); __inc_irq_stat(cpu, ipi_irqs[ipinr]); } However, what's missing is that the addition of tracing here missed that CPU_BACKTRACE is not to be traced. The call in raise_nmi() should have been converted to __smp_cross_call() to avoid the tracing code. -- RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.