linux/arch/m68k/kernel
Greg Ungerer a95517992a m68k: Use conventional function parameters for do_sigreturn
Create conventional stack parameters for the calls to do_sigreturn and
do_rt_sigreturn. The current C code for do_sigreturn and do_rt_sigreturn
dig into the stack to create local pointers to the saved switch stack
and the pt_regs structs.

The motivation for this change is a problem with non-MMU targets that
have broken signal return paths on newer versions of gcc. It appears as
though gcc has determined that the pointers into the saved stack structs,
and the saved structs themselves, are function parameters and updates to
them will be lost on function return, so they are optimized away. This
results in large parts of restore_sigcontext() and mangle_kernel_stack()
functions being removed. Of course this results in non-functional code
causing kernel oops. This problem has been observed with gcc version
5.2 and 5.3, and probably exists in earlier versions as well.

Using conventional stack parameter pointers passed to these functions has
the advantage of the code here not needing to know the exact details of
how the underlying entry handler layed these structs out on the stack.
So the rather ugly pointer setup casting and arg referencing can be
removed.

The resulting code after this change is a few bytes larger (due to the
overhead of creating the stack args and their tear down). Not being hot
paths I don't think this is too much of a problem here.

An alternative solution is to put a barrier() in the do_sigreturn() code,
but this doesn't feel quite as clean as this solution.

This change has been compile tested on all defconfigs, and run tested on
Atari (through aranym), ColdFire with MMU (M5407EVB) and ColdFire with
no-MMU (QEMU and M5208EVB).

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2016-02-29 09:51:43 +01:00
..
.gitignore
asm-offsets.c m68k: Add kexec support 2013-12-08 11:01:47 +01:00
bootinfo_proc.c m68k/bootinfo: Use kmemdup rather than duplicating its implementation 2015-08-10 10:26:33 +02:00
dma.c m68k: convert to dma_map_ops 2016-01-20 17:09:18 -08:00
early_printk.c m68k/mvme16x: Adopt common boot console 2014-05-28 10:11:53 +02:00
entry.S m68k: Use conventional function parameters for do_sigreturn 2016-02-29 09:51:43 +01:00
head.S m68k: Fix boot regression on machines with RAM at non-zero 2014-07-10 09:58:26 +02:00
ints.c m68k: Do not rely on magic indirect includes 2014-03-05 13:28:32 +01:00
irq.c
m68k_ksyms.c
machine_kexec.c m68k: Add kexec support 2013-12-08 11:01:47 +01:00
Makefile m68k: Multi-platform EARLY_PRINTK 2014-05-28 10:10:04 +02:00
module.c
module.lds
pcibios.c m68k/pci: Remove a superflous KERN_ERR 2015-03-15 10:24:50 +01:00
process.c
ptrace.c
relocate_kernel.S m68k: Add kexec support 2013-12-08 11:01:47 +01:00
setup_mm.c m68k: Add support to export bootinfo in procfs 2013-12-08 11:01:48 +01:00
setup_no.c m68knommu: Add missing initialization of max_pfn and {min,max}_low_pfn 2015-11-22 11:35:25 +01:00
setup.c
signal.c m68k: Use conventional function parameters for do_sigreturn 2016-02-29 09:51:43 +01:00
sun3-head.S
sys_m68k.c m68k: call find_vma with the mmap_sem held in sys_cacheflush() 2014-10-09 22:26:02 -04:00
syscalltable.S m68k: Wire up mlock2 2015-11-22 11:35:26 +01:00
time.c m68k: Export mach_random_get_entropy to modules 2014-07-11 10:37:53 +02:00
traps.c m68k: Convert arch/m68k/kernel/traps.c to pr_*() 2013-12-30 21:01:11 +01:00
vectors.c
vmlinux-nommu.lds
vmlinux-std.lds
vmlinux-sun3.lds
vmlinux.lds.S