Skip to contentSkip to conversation

Fix fake return address

PATCH In review Jeremy Fitzhardinge 2 participants 2 messages Oct 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix fake return address

The fake return address was being set to __KERNEL_PDA, rather than 0. Push it earlier while %eax still equals 0.

arch/i386/kernel/head.S +0 -0
diff -r b8e58159855c arch/i386/kernel/head.S
@@ -316,12 +316,12 @@ 1:	movl $(__KERNEL_DS),%eax	# reload all

xorl %eax,%eax # Clear FS and LDT
movl %eax,%fs
lldt %ax
+ pushl %eax # fake return address

	movl $(__KERNEL_PDA),%eax
	mov  %eax,%gs

	cld			# gcc2 wants the direction flag cleared at all times

- pushl %eax # fake return address
#ifdef CONFIG_SMP
movb ready, %cl
movb $1, ready

#1 lore raw
Quoted 2 lines · Jeremy Fitzhardinge

The fake return address was being set to __KERNEL_PDA, rather than 0. Push it earlier while %eax still equals 0.

Oops. That might explain some of the unwind problems. Thanks.

-Andi

Quoted 26 lines

diff -r b8e58159855c arch/i386/kernel/head.S

arch/i386/kernel/head.S +1 -1
@@ -316,12 +316,12 @@ 1:	movl $(__KERNEL_DS),%eax	# reload all
 	xorl %eax,%eax			# Clear FS and LDT
 	movl %eax,%fs
 	lldt %ax
+	pushl %eax		# fake return address
 
 	movl $(__KERNEL_PDA),%eax
 	mov  %eax,%gs
 
 	cld			# gcc2 wants the direction flag cleared at 
 	all times
-	pushl %eax		# fake return address
 #ifdef CONFIG_SMP
 	movb ready, %cl

movb $1, ready