linux-stable/arch
Arnd Bergmann 525ea118ba ARM: prevent tracing IPI_CPU_BACKTRACE
[ Upstream commit be167862ae ]

Patch series "compiler: allow all arches to enable
CONFIG_OPTIMIZE_INLINING", v3.

This patch (of 11):

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.

This patch raise_nmi() to call __smp_cross_call() instead of
smp_cross_call(), to avoid calling into ftrace.  For clarification, I'm
also adding a two new code comments describing how this one is special.

The warning appears to have shown up after commit e7273ff49a ("ARM:
8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI"), which changed the
number assignment from '15' to '8', but as far as I can tell has existed
since the IPI tracepoints were first introduced.  If we decide to
backport this patch to stable kernels, we probably need to backport
e7273ff49a as well.

[yamada.masahiro@socionext.com: rebase on v5.1-rc1]
Link: http://lkml.kernel.org/r/20190423034959.13525-2-yamada.masahiro@socionext.com
Fixes: e7273ff49a ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI")
Fixes: 365ec7b173 ("ARM: add IPI tracepoints") # v3.17
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Mathieu Malaterre <malat@debian.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Borislav Petkov <bp@suse.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-15 11:54:51 +02:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:20:53 +01:00
arc arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM 2019-04-20 09:14:59 +02:00
arm ARM: prevent tracing IPI_CPU_BACKTRACE 2019-06-15 11:54:51 +02:00
arm64 arm64: cpu_ops: fix a leaked reference by adding missing of_node_put 2019-05-31 06:47:30 -07:00
blackfin
c6x
cris
frv
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:31:25 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:54:25 +02:00
ia64
m32r
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 14:35:21 +01:00
metag
microblaze microblaze: Fix simpleImage format generation 2018-08-03 07:50:40 +02:00
mips Revert "MIPS: perf: ath79: Fix perfcount IRQ assignment" 2019-06-11 12:21:49 +02:00
mn10300
nios2
openrisc openrisc: entry: Fix delay slot exception detection 2018-08-24 13:09:11 +02:00
parisc parisc: Rename LEVEL to PA_ASM_LEVEL to avoid name clash with DRBD code 2019-05-25 18:25:18 +02:00
powerpc pstore: Convert buf_lock to semaphore 2019-06-11 12:21:48 +02:00
s390 KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:18:16 +02:00
score
sh sh: fix multiple function definition build errors 2019-05-08 07:20:51 +02:00
sparc sparc64: Fix regression in non-hypervisor TLB flush xcall 2019-06-09 09:18:13 +02:00
tile
um um: Avoid marking pages with "changed protection" 2019-02-12 19:46:08 +01:00
unicore32
x86 x86/power: Fix 'nosmt' vs hibernation triple fault during resume 2019-06-11 12:21:48 +02:00
xtensa xtensa: xtfpga.dtsi: fix dtc warnings about SPI 2019-05-16 19:42:30 +02:00
.gitignore
Kconfig compiler.h: Allow arch-specific asm/compiler.h 2018-11-04 14:52:46 +01:00