From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426242AbcBRO0g (ORCPT ); Thu, 18 Feb 2016 09:26:36 -0500 Received: from foss.arm.com ([217.140.101.70]:39528 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBRO0e (ORCPT ); Thu, 18 Feb 2016 09:26:34 -0500 Subject: Re: [PATCH 2/9] ARM: change NR_IPIS to 8 To: Arnd Bergmann , Russell King References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> <1455804123-2526139-3-git-send-email-arnd@arndb.de> Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Daniel Thompson , linux-kernel@vger.kernel.org From: Marc Zyngier X-Enigmail-Draft-Status: N1110 Organization: ARM Ltd Message-ID: <56C5D497.7030309@arm.com> Date: Thu, 18 Feb 2016 14:26:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <1455804123-2526139-3-git-send-email-arnd@arndb.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On 18/02/16 14:01, 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]); > > This is a correct warning as we actually overflow the array here. > To make the tracing work correctly, this extends the array by one > entry and increases NR_IPI accordingly. > > This only works after patch e7273ff49acf ("ARM: 8488/1: Make > IPI_CPU_BACKTRACE a "non-secure" SGI"), which changed the number > assignment from '15' to '8'. If we decide to backport this patch > to stable kernels, we probably need to backport e7273ff49acf > as well. I may actually have made the bug worse in 89d798b ("ARM: 8487/1: Remove IPI_CALL_FUNC_SINGLE"), which changed NR_IPI from 8 to 7. It would need to be backported as well (as otherwise we don't have a free non-secure IP slot). > > As far as I can tell, the problem has existed since the tracepoints > were originally added, but it only triggered a gcc warning with the > later change to NR_IPIS. > > Signed-off-by: Arnd Bergmann > Fixes: e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI") > Fixes: 365ec7b17327 ("ARM: add IPI tracepoints") # v3.17 Acked-by: Marc Zyngier Thanks, M. -- Jazz is not dead. It just smells funny...