linux/arch/sparc/kernel
David S. Miller ef3e035c3a sparc64: Fix register corruption in top-most kernel stack frame during boot.
Meelis Roos reported that kernels built with gcc-4.9 do not boot, we
eventually narrowed this down to only impacting machines using
UltraSPARC-III and derivitive cpus.

The crash happens right when the first user process is spawned:

[   54.451346] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[   54.451346]
[   54.571516] CPU: 1 PID: 1 Comm: init Not tainted 3.16.0-rc2-00211-gd7933ab #96
[   54.666431] Call Trace:
[   54.698453]  [0000000000762f8c] panic+0xb0/0x224
[   54.759071]  [000000000045cf68] do_exit+0x948/0x960
[   54.823123]  [000000000042cbc0] fault_in_user_windows+0xe0/0x100
[   54.902036]  [0000000000404ad0] __handle_user_windows+0x0/0x10
[   54.978662] Press Stop-A (L1-A) to return to the boot prom
[   55.050713] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004

Further investigation showed that compiling only per_cpu_patch() with
an older compiler fixes the boot.

Detailed analysis showed that the function is not being miscompiled by
gcc-4.9, but it is using a different register allocation ordering.

With the gcc-4.9 compiled function, something during the code patching
causes some of the %i* input registers to get corrupted.  Perhaps
we have a TLB miss path into the firmware that is deep enough to
cause a register window spill and subsequent restore when we get
back from the TLB miss trap.

Let's plug this up by doing two things:

1) Stop using the firmware stack for client interface calls into
   the firmware.  Just use the kernel's stack.

2) As soon as we can, call into a new function "start_early_boot()"
   to put a one-register-window buffer between the firmware's
   deepest stack frame and the top-most initial kernel one.

Reported-by: Meelis Roos <mroos@linux.ee>
Tested-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-24 09:52:49 -07:00
..
.gitignore
apc.c
asm-offsets.c [PATCH] sparc32: vm_area_struct access for old Sun SPARCs. 2013-07-10 13:56:10 -07:00
audit.c sparc64: fix sparse warnings in compat_audit.c 2014-05-18 19:01:34 -07:00
auxio_32.c sparc32: fix sparse warning in auxio_32.c 2014-05-18 19:01:27 -07:00
auxio_64.c
btext.c sparc64: fix sparse warning in btext.c 2014-05-18 19:01:30 -07:00
central.c
cherrs.S
chmc.c
compat_audit.c sparc64: fix sparse warnings in compat_audit.c 2014-05-18 19:01:34 -07:00
cpu.c sparc64: correctly recognise M6 and M7 cpu type 2014-09-09 15:24:10 -07:00
cpumap.c sparc64: support M6 and M7 for building CPU distribution map 2014-09-09 15:24:10 -07:00
cpumap.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
devices.c sparc32: drop tadpole specific code 2014-05-18 19:01:29 -07:00
dma.c
ds.c sparc64: Move request_irq() from ldc_bind() to ldc_alloc() 2014-09-16 18:31:31 -07:00
dtlb_miss.S
dtlb_prot.S sparc64: Fix corrupted thread fault code. 2014-10-18 23:03:09 -04:00
ebus.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
entry.h sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
entry.S sparc32: Fix exit flag passed from traced sys_sigreturn 2013-07-31 19:10:04 -07:00
etrap_32.S
etrap_64.S
fpu_traps.S
ftrace.c ftrace: Do not pass data to ftrace_dyn_arch_init 2014-03-07 10:06:14 -05:00
getsetcc.S
head_32.S
head_64.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
helpers.S
hvapi.c sparc64: T5 PMU 2014-09-16 18:26:40 -07:00
hvcalls.S sparc64: T5 PMU 2014-09-16 18:26:40 -07:00
hvtramp.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
idprom.c
iommu_common.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
iommu.c sparc64: fix sparse warning in pci.c 2014-05-18 19:01:31 -07:00
ioport.c sparc32: dma_alloc_coherent must honour gfp flags 2014-09-10 14:03:28 -07:00
irq_32.c sparc32: fix sparse warnings in irq_32.c 2014-04-29 01:12:25 -04:00
irq_64.c sparc64: sparse irq 2014-10-05 16:53:40 -07:00
irq.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
itlb_miss.S
ivec.S
jump_label.c
kernel.h sparc64: fix sparse warning in kgdb_64.c 2014-05-18 19:01:34 -07:00
kgdb_32.c
kgdb_64.c sparc64: fix sparse warning in kgdb_64.c 2014-05-18 19:01:34 -07:00
kprobes.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
kstack.h
ktlb.S sparc64: Adjust vmalloc region size based upon available virtual address bits. 2014-10-05 16:53:40 -07:00
ldc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2014-10-11 20:36:34 -04:00
led.c
leon_kernel.c sparc: leon: Fix race condition between leon_cycles_offset and timer_interrupt 2014-09-09 16:39:10 -07:00
leon_pci_grpci1.c sparc32: replace flip_dword() with swab32() 2014-05-02 01:30:21 -04:00
leon_pci_grpci2.c sparc32: replace flip_dword() with swab32() 2014-05-02 01:30:21 -04:00
leon_pci.c sparc32: introduce asm-generic/io.h 2014-05-02 01:30:21 -04:00
leon_pmc.c sparc32: fix sparse warnings in leon_pmc.c 2014-04-29 01:12:27 -04:00
leon_smp.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
Makefile sparc32: drop tadpole specific code 2014-05-18 19:01:29 -07:00
mdesc.c sparc: Add support for seek and shorter read to /dev/mdesc 2014-07-21 21:37:06 -07:00
misctrap.S
module.c mm/arch: use NUMA_NO_NODE 2013-11-13 12:09:05 +09:00
nmi.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
of_device_32.c
of_device_64.c
of_device_common.c sparc: fix sparse warnings in of_device_common.c 2014-04-29 01:12:27 -04:00
of_device_common.h
pci_common.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
pci_fire.c
pci_impl.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
pci_msi.c
pci_psycho.c
pci_sabre.c
pci_schizo.c
pci_sun4v_asm.S
pci_sun4v.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
pci_sun4v.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
pci.c sparc64: Properly claim resources as each PCI bus is probed. 2014-08-13 21:17:49 -07:00
pcic.c sparc32: fix sparse warnings in pcic.c 2014-05-18 19:01:27 -07:00
pcr.c sparc64: T5 PMU 2014-09-16 18:26:40 -07:00
perf_event.c Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
pmc.c
power.c
process_32.c sparc32: fix sparse warning in auxio_32.c 2014-05-18 19:01:27 -07:00
process_64.c sparc64: Fix pcr_ops initialization and usage bugs. 2014-08-11 20:45:12 -07:00
prom_32.c
prom_64.c sparc64: fix sparse warning in prom_64.c 2014-05-18 19:01:31 -07:00
prom_common.c of: Fix locking vs. interrupts 2013-06-13 22:12:14 +01:00
prom_irqtrans.c
prom.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
psycho_common.c
psycho_common.h sparc: drop use of extern for prototypes in arch/sparc/* 2014-05-18 19:01:29 -07:00
ptrace_32.c sparc32: fix sparse warning in ptrace_32.c 2014-04-29 01:12:26 -04:00
ptrace_64.c sparc64: Implement HAVE_CONTEXT_TRACKING 2013-11-14 14:57:21 -08:00
reboot.c
rtrap_32.S
rtrap_64.S Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-19 10:40:00 -08:00
sbus.c
setup_32.c sparc32: fix sparse warnings in setup_32.c 2014-04-29 01:12:25 -04:00
setup_64.c sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
signal32.c sparc64: clean up compat_sigset_t.seta handling 2014-05-18 19:01:32 -07:00
signal_32.c sparc32: fix sparse warnings in signal_32.c 2014-04-29 01:12:25 -04:00
signal_64.c sparc64: fix sparse "Should it be static?" warnings in signal32.c 2014-05-18 19:01:32 -07:00
sigutil_32.c
sigutil_64.c
sigutil.h
smp_32.c sparc: fix decimal printf format specifiers prefixed with 0x 2014-08-06 14:41:10 -07:00
smp_64.c Merge branch 'locking-arch-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-13 15:48:00 +02:00
sparc_ksyms_32.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
sparc_ksyms_64.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
spiterrs.S
sstate.c
stacktrace.c
starfire.c
sun4d_irq.c sparc32: fix sparse warnings in sun4d_irq.c 2014-04-29 01:12:25 -04:00
sun4d_smp.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
sun4m_irq.c sun4M: add include of slab.h for kzalloc 2014-02-12 16:10:45 -05:00
sun4m_smp.c sparc: delete __cpuinit/__CPUINIT usage from all users 2013-07-14 19:36:52 -04:00
sun4v_ivec.S
sun4v_tlb_miss.S sparc64: sun4v TLB error power off events 2014-09-16 17:46:44 -07:00
sys32.S sparc: Hook up renameat2 syscall. 2014-07-21 22:27:56 -07:00
sys_sparc32.c sparc64: fix sparse warnings in sys_sparc32.c 2014-05-18 19:01:31 -07:00
sys_sparc_32.c sparc32: fix sparse warnings in sys_sparc_32.c 2014-05-18 19:01:28 -07:00
sys_sparc_64.c sparc64: fix sparse warnings in sys_sparc_64.c + unaligned_64.c 2014-05-18 19:01:30 -07:00
syscalls.S sparc64: don't treat 64-bit syscall return codes as 32-bit 2014-03-17 15:54:52 -04:00
sysfs.c sparc64: fix format string mismatch in arch/sparc/kernel/sysfs.c 2014-05-21 12:54:42 -07:00
systbls_32.S sparc: Hook up memfd_create system call. 2014-08-13 22:00:09 -07:00
systbls_64.S sparc: Hook up memfd_create system call. 2014-08-13 22:00:09 -07:00
systbls.h sparc64: fix sparse warnings in sys_sparc32.c 2014-05-18 19:01:31 -07:00
time_32.c sparc32: fix sparse warnings in time_32.c 2014-05-18 19:01:27 -07:00
time_64.c sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
trampoline_32.S sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
trampoline_64.S sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
traps_32.c sparc: fix sparse warning in math_{32,64} 2014-05-18 19:01:28 -07:00
traps_64.c sparc64: sun4v TLB error power off events 2014-09-16 17:46:44 -07:00
tsb.S sparc64: Fix corrupted thread fault code. 2014-10-18 23:03:09 -04:00
ttable_32.S
ttable_64.S
una_asm_32.S
una_asm_64.S
unaligned_32.c sparc: use %s for unaligned panic 2014-07-21 21:37:06 -07:00
unaligned_64.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2014-06-19 07:50:07 -10:00
utrap.S
vio.c sparc64: Add vio_set_intr() to enable/disable Rx interrupts 2014-09-30 14:40:45 -07:00
viohs.c sparc: VIO protocol version 1.6 2014-09-30 14:17:08 -07:00
visemul.c
vmlinux.lds.S sparc64: Kill unnecessary tables and increase MAX_BANKS. 2014-10-05 16:53:40 -07:00
windows.c sparc32: fix sparse warnings in windows.c 2014-04-29 01:12:25 -04:00
winfixup.S
wof.S
wuf.S