linux/arch/m68k
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
..
68000 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
68360 m68k: Use vsprintf %pM extension 2015-06-16 16:45:38 +10:00
amiga genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
apollo m68k/apollo: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
atari m68k/atari, m68k/sun3: Fix SCSI platform device registration when driver is modular 2016-01-10 13:56:40 +01:00
bvme6000 m68k/UAPI: Use proper types (endianness/size) in <asm/bootinfo*.h> 2013-11-26 11:09:21 +01:00
coldfire m68k: coldfire/gpio: Be sure to clamp return value 2016-01-04 13:25:12 +10:00
configs m68k/defconfig: Update defconfigs for v4.4-rc1 2015-12-14 10:14:29 +01:00
emu block: change ->make_request_fn() and users to return a queue cookie 2015-11-07 10:40:46 -07:00
fpsp040 Fix common misspellings 2011-03-31 11:26:23 -03:00
hp300 m68k/hp300: Convert printk to pr_foo() 2014-05-28 10:11:55 +02:00
ifpsp060 Fix common misspellings 2011-03-31 11:26:23 -03:00
include dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
kernel m68k: Use conventional function parameters for do_sigreturn 2016-02-29 09:51:43 +01:00
lib m68k: Remove FSF address 2015-03-15 10:23:30 +01:00
mac m68k/mac: Kill psc_present 2015-11-23 09:58:30 +01:00
math-emu m68k/math-emu: unsigned issue, 'unsigned long' will never be less than zero 2013-06-24 19:44:19 +02:00
mm m68k/mm: motorola - Add missing initialization of max_pfn 2015-11-22 11:35:24 +01:00
mvme16x m68k/mvme16x: rtc - Don't use module_init in non-modular code 2015-01-11 11:38:41 +01:00
mvme147 m68k/mvme147: config.c - Remove unused functions 2015-01-11 11:38:45 +01:00
q40 m68k: Mark functions only called from setup_arch() __init 2013-11-26 11:08:54 +01:00
sun3 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2016-01-12 10:33:51 -08:00
sun3x m68k: Remove superfluous inclusions of <asm/bootinfo.h> 2013-11-26 11:09:22 +01:00
tools/amiga
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kconfig dma-mapping: always provide the dma_map_ops based implementation 2016-01-20 17:09:18 -08:00
Kconfig.bus m68k/atari: ROM port ISA adapter support 2013-04-16 21:08:11 +02:00
Kconfig.cpu m68knommu: make ColdFire SoC selection a choice 2015-07-13 09:34:39 +10:00
Kconfig.debug m68k: Multi-platform EARLY_PRINTK 2014-05-28 10:10:04 +02:00
Kconfig.devices Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2014-10-08 05:40:17 -04:00
Kconfig.machine m68k: remove 16 unused boards in Kconfig.machine 2013-08-26 16:51:14 +10:00
Makefile m68k: move non-mmu 68360 platform code 2014-09-29 09:18:35 +10:00