2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 03:33:59 +08:00
linux-next/arch/tile
Chris Metcalf 81711cee93 arch/tile: handle rt_sigreturn() more cleanly
The current tile rt_sigreturn() syscall pattern uses the common idiom
of loading up pt_regs with all the saved registers from the time of
the signal, then anticipating the fact that we will clobber the ABI
"return value" register (r0) as we return from the syscall by setting
the rt_sigreturn return value to whatever random value was in the pt_regs
for r0.

However, this breaks in our 64-bit kernel when running "compat" tasks,
since we always sign-extend the "return value" register to properly
handle returned pointers that are in the upper 2GB of the 32-bit compat
address space.  Doing this to the sigreturn path then causes occasional
random corruption of the 64-bit r0 register.

Instead, we stop doing the crazy "load the return-value register"
hack in sigreturn.  We already have some sigreturn-specific assembly
code that we use to pass the pt_regs pointer to C code.  We extend that
code to also set the link register to point to a spot a few instructions
after the usual syscall return address so we don't clobber the saved r0.
Now it no longer matters what the rt_sigreturn syscall returns, and the
pt_regs structure can be cleanly and completely reloaded.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
2010-12-17 16:59:29 -05:00
..
configs defconfig reduction 2010-08-14 22:26:53 +02:00
include arch/tile: handle rt_sigreturn() more cleanly 2010-12-17 16:59:29 -05:00
kernel arch/tile: handle rt_sigreturn() more cleanly 2010-12-17 16:59:29 -05:00
kvm arch/tile: parameterize system PLs to support KVM port 2010-10-15 15:38:09 -04:00
lib arch/tile: fix memchr() not to dereference memory for zero length 2010-11-24 13:57:42 -05:00
mm drivers/net/tile/: on-chip network drivers for the tile architecture 2010-11-24 13:11:18 -05:00
Kbuild arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
Kconfig pci root complex: support for tile architecture 2010-11-24 13:13:49 -05:00
Kconfig.debug arch/tile: core support for Tilera 32-bit chips. 2010-06-04 17:11:18 -04:00
Makefile arch/tile: parameterize system PLs to support KVM port 2010-10-15 15:38:09 -04:00