From patchwork Thu Feb 18 14:01:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102748 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp604790lbl; Thu, 18 Feb 2016 06:04:00 -0800 (PST) X-Received: by 10.98.89.215 with SMTP id k84mr10374054pfj.66.1455804238373; Thu, 18 Feb 2016 06:03:58 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si9675363pfj.77.2016.02.18.06.03.57; Thu, 18 Feb 2016 06:03:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946183AbcBRODz (ORCPT + 30 others); Thu, 18 Feb 2016 09:03:55 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64877 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425940AbcBRODu (ORCPT ); Thu, 18 Feb 2016 09:03:50 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MhUQs-1aJhcJ0npq-00McWr; Thu, 18 Feb 2016 15:03:21 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Marc Zyngier , Daniel Thompson , linux-kernel@vger.kernel.org Subject: [PATCH 2/9] ARM: change NR_IPIS to 8 Date: Thu, 18 Feb 2016 15:01:54 +0100 Message-Id: <1455804123-2526139-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:EYl9zg+MC6/f1TH4BCKmbakplC/UPu9i3JxxtLz+HDsugVLkHNz ca5q98HI9PXL/3qpJo9Qo3Kl570FvyL+DtcJlIMfoPwW009vmVJs8MApb0mXKyMP63Ep0sK E1Xl8oScTz1yhwjsMnb0plmhnLi7OEbgGAtfd1VcLcPfW63JmdxnVl7SHYtGeiiAU9jGc5C xkhs8W1py/WOuWGI58Ywg== X-UI-Out-Filterresults: notjunk:1; V01:K0:xeMkiULrTOY=:CkhkmJGmzQSnBhoHZ1o6Ew JfqVAY6wfNa0KCz1B7vzsxOQo3b47sEsMxUOXdVU0orndfPmMJh7QEGJLSTU0LFI1MDpi0oVf 1B4w2+6Aq265FSBvwaPOo6R4HWqQJeg45F/xdsbWZL59LU2LZFxAmNEl2bh+/w40PFXmzDnzY VnC0CE7luOi/dNKaBRXQ+IfUQwLL4SpgPHAol9Lyzs1CtzxE/YNcVpWDI1nTkMTy/YjI+0qkO wQkx9LzR9dxO5bG9pEuwAcDrsAscN3FeLgwcJb4h+5HLR3CK/LL4mB3xnSLLMQGetYVgUIv++ 9scCar9Ml/3E1nxCpxcuN6XiAlDUfAPppCrEqQFp5zDj2vzwvWW77qKhmV6VbZItFL1yifbWu 3kwO1QvhWxnzsWCiLoHVqUr3yc1GOsyh0o2T3Yx4QXLYKPwDUyeQhb6fPwiAOS9TmtM9JdMiE wqMNjpI1xLj8LLKNUeMEnKic1M3efSbL3CGut2Ut2VU6aU8RpO/8Xo7szCldncwsDXeHzNU0k qFBw/mrDz14muznWFM97Z7JTZxBgEFnMZfxuLEDFKofY97GAdo4gVpQXb/CLZ2LZG43hWhf9s Gt330vrNutrO5WcfvAZKR9yAL3TbJGQMWlfD43pkxT6S2RIBgJGQm+vzoK0QK1J+puurbOIIz dakYQbaeX/qdmtrI1+K5x5DiA3kY0BCn/U2PX5UtTC0anUMd8UVXtcdKOziCODVVwhAk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 --- arch/arm/include/asm/hardirq.h | 2 +- arch/arm/kernel/smp.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 3d7351c844aa..fe3ea776dc34 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -5,7 +5,7 @@ #include #include -#define NR_IPI 7 +#define NR_IPI 8 typedef struct { unsigned int __softirq_pending; diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index b4048e370730..d021566d71c2 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -482,6 +482,7 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { S(IPI_CPU_STOP, "CPU stop interrupts"), S(IPI_IRQ_WORK, "IRQ work interrupts"), S(IPI_COMPLETION, "completion interrupts"), + S(IPI_CPU_BACKTRACE, "CPU backtrace"), }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr)