diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-10 22:07:44 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 22:20:47 +0100 |
commit | 73165b88ffd29813bf73b331eaf90d3521443236 (patch) | |
tree | 224b510df182c5cba7b64fea6202ed9dd414835e /include/asm-i386 | |
parent | [PATCH] remove unnecessary asm/mutex.h from kernel/mutex-debug.c (diff) | |
download | linux-73165b88ffd29813bf73b331eaf90d3521443236.tar.xz linux-73165b88ffd29813bf73b331eaf90d3521443236.zip |
[PATCH] fix i386 mutex fastpath on FRAME_POINTER && !DEBUG_MUTEXES
Call the mutex slowpath more conservatively - e.g. FRAME_POINTERS can
change the calling convention, in which case a direct branch to the
slowpath becomes illegal. Bug found by Hugh Dickins.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/mutex.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/asm-i386/mutex.h b/include/asm-i386/mutex.h index 4e5e3de1b9a6..c657d4b09f0a 100644 --- a/include/asm-i386/mutex.h +++ b/include/asm-i386/mutex.h @@ -28,7 +28,13 @@ do { \ \ __asm__ __volatile__( \ LOCK " decl (%%eax) \n" \ - " js "#fail_fn" \n" \ + " js 2f \n" \ + "1: \n" \ + \ + LOCK_SECTION_START("") \ + "2: call "#fail_fn" \n" \ + " jmp 1b \n" \ + LOCK_SECTION_END \ \ :"=a" (dummy) \ : "a" (count) \ @@ -78,7 +84,13 @@ do { \ \ __asm__ __volatile__( \ LOCK " incl (%%eax) \n" \ - " jle "#fail_fn" \n" \ + " jle 2f \n" \ + "1: \n" \ + \ + LOCK_SECTION_START("") \ + "2: call "#fail_fn" \n" \ + " jmp 1b \n" \ + LOCK_SECTION_END \ \ :"=a" (dummy) \ : "a" (count) \ |