Skip to contentSkip to conversation

Fix random memory corruption during suspend-to-RAM resume

PATCH Pavel Machek 3 participants 5 messages Feb 10, 2003 – Feb 12, 2003

lore
Share & tools
lore
#0 lore raw

Hi!

We really want to use wakeup_stack as stack, not as pointer to stack... Please apply,
Pavel

arch/i386/kernel/acpi_wakeup.S +1 -1
@@ -31,7 +31,7 @@
 	movw	%cs, %ax
 	movw	%ax, %ds					# Make ds:0 point to wakeup_start
 	movw	%ax, %ss
-	mov	wakeup_stack - wakeup_code, %sp			# Private stack is needed for ASUS board
+	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
 	movw	$0x0e00 + 'S', %fs:(0x12)
 
 	pushl	$0						# Kill any dangerous flags
Signature · 2 lines
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
#1 lore raw
Quoted 3 lines · Pavel Machek

We really want to use wakeup_stack as stack, not as pointer to stack... Please apply,

Hmm.. The stack grows downwards, are you sure you don't really mean

	mov $(wakeup_end-wakeup_code),%sp

(because wakeup_end is the end of the wakeup_stack area..)

Linus

#2 lore raw

Hi!

Quoted 8 lines
Quoted 2 lines

We really want to use wakeup_stack as stack, not as pointer to stack... Please apply,

Hmm.. The stack grows downwards, are you sure you don't really mean

	mov $(wakeup_end-wakeup_code),%sp

(because wakeup_end is the end of the wakeup_stack area..)

Yes, I'm sure:

        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
wakeup_stack:
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Okay, I might want to kill the second set of longs ;-).

I need to substract wakeup_code because code is being relocated in quite a strange way.

Pavel

Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
#3 lore raw
Quoted 8 lines · Pavel Machek
Quoted 6 lines

Hmm.. The stack grows downwards, are you sure you don't really mean

	mov $(wakeup_end-wakeup_code),%sp

(because wakeup_end is the end of the wakeup_stack area..)

Yes, I'm sure:

No. The code is crap. Please send a _fixed_ patch that clearly puts the stack pointer at the _end_ of the stack.

What you are sure of is that is _happens_ to work by pure luck.

I'd rather have known-broken code in the kernel than code that works by mistake. The former at least gets fixed.

Linus

#4 lore raw

Hi!

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

Hmm.. The stack grows downwards, are you sure you don't really mean

	mov $(wakeup_end-wakeup_code),%sp

(because wakeup_end is the end of the wakeup_stack area..)

Yes, I'm sure:

Quoted 7 lines

No. The code is crap. Please send a _fixed_ patch that clearly puts the stack pointer at the _end_ of the stack.

What you are sure of is that is _happens_ to work by pure luck.

I'd rather have known-broken code in the kernel than code that works by mistake. The former at least gets fixed.

It should be already in the queue (waiting on my home machine sorry), along with fix to make it all fit in one page.

Pavel

Signature · 2 lines
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.