https://github.com/torvalds/linux
Revision 54a015104136974262afa4b8ddd943ea70dec8a2 authored by Roland McGrath on 10 April 2008, 22:37:38 UTC, committed by Linus Torvalds on 11 April 2008, 00:28:26 UTC
The prevent_tail_call() macro works around the problem of the compiler
clobbering argument words on the stack, which for asmlinkage functions
is the caller's (user's) struct pt_regs.  The tail/sibling-call
optimization is not the only way that the compiler can decide to use
stack argument words as scratch space, which we have to prevent.
Other optimizations can do it too.

Until we have new compiler support to make "asmlinkage" binding on the
compiler's own use of the stack argument frame, we have work around all
the manifestations of this issue that crop up.

More cases seem to be prevented by also keeping the incoming argument
variables live at the end of the function.  This makes their original
stack slots attractive places to leave those variables, so the compiler
tends not clobber them for something else.  It's still no guarantee, but
it handles some observed cases that prevent_tail_call() did not.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 783e391
History
Tip revision: 54a015104136974262afa4b8ddd943ea70dec8a2 authored by Roland McGrath on 10 April 2008, 22:37:38 UTC
asmlinkage_protect replaces prevent_tail_call
Tip revision: 54a0151
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
usr
virt
.gitignore -rw-r--r-- 644 bytes
.mailmap -rw-r--r-- 3.6 KB
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 90.4 KB
Kbuild -rw-r--r-- 1.6 KB
MAINTAINERS -rw-r--r-- 94.9 KB
Makefile -rw-r--r-- 52.8 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.1 KB

README

back to top