* Fix stack handling in acpi_wakeup.S
@ 2003-02-11 18:44 Pavel Machek
2003-02-13 19:17 ` David Woodhouse
2003-02-15 12:15 ` Alfred E. Heggestad
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2003-02-11 18:44 UTC (permalink / raw)
To: torvalds, kernel list
Hi!
This fixes stack handling in acpi_wakeup.S, and makes stack smaller so
that wakeup code actually fits inside memory allocated for it. Plus
someone renamed .L1432 to something meaningfull. Please apply,
Pavel
--- clean/arch/i386/kernel/acpi_wakeup.S 2003-02-11 17:40:33.000000000 +0100
+++ linux/arch/i386/kernel/acpi_wakeup.S 2003-02-11 12:51:03.000000000 +0100
@@ -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
@@ -159,12 +159,14 @@
.code32
ALIGN
+.org 0x800
+wakeup_stack_begin: # Stack grows down
-.org 0x2000
+.org 0xff0 # Just below end of page
wakeup_stack:
-.org 0x3000
ENTRY(wakeup_end)
-.org 0x4000
+
+.org 0x1000
wakeup_pmode_return:
movl $__KERNEL_DS, %eax
@@ -274,7 +276,7 @@
ENTRY(do_suspend_lowlevel)
cmpl $0,4(%esp)
- jne .L1432
+ jne ret_point
call save_processor_state
movl %esp, saved_context_esp
@@ -287,7 +289,7 @@
movl %edi, saved_context_edi
pushfl ; popl saved_context_eflags
- movl $.L1432,saved_eip
+ movl $ret_point,saved_eip
movl %esp,saved_esp
movl %ebp,saved_ebp
movl %ebx,saved_ebx
@@ -299,7 +301,7 @@
addl $4,%esp
ret
.p2align 4,,7
-.L1432:
+ret_point:
movl $__KERNEL_DS,%eax
movw %ax, %ds
movl saved_context_esp, %esp
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fix stack handling in acpi_wakeup.S
2003-02-11 18:44 Fix stack handling in acpi_wakeup.S Pavel Machek
@ 2003-02-13 19:17 ` David Woodhouse
2003-02-15 12:15 ` Alfred E. Heggestad
1 sibling, 0 replies; 4+ messages in thread
From: David Woodhouse @ 2003-02-13 19:17 UTC (permalink / raw)
To: Pavel Machek; +Cc: torvalds, kernel list
On Tue, 2003-02-11 at 18:44, Pavel Machek wrote:
> Hi!
>
> This fixes stack handling in acpi_wakeup.S, and makes stack smaller so
> that wakeup code actually fits inside memory allocated for it. Plus
> someone renamed .L1432 to something meaningfull. Please apply,
I am confused. If I apply your patch, I get a failure to resume (precise
symptoms below) on both boards I've tried it on. Applying this obviously
broken patch 'fixes' it:
--- arch/i386/kernel/acpi.c.orig Thu Feb 13 19:07:34 2003
+++ arch/i386/kernel/acpi.c Thu Feb 13 19:07:36 2003
@@ -483,6 +483,7 @@
if (!acpi_wakeup_address)
return 1;
init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
+ memset((void *)acpi_wakeup_address, 0, 0x3000);
memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end
- &wakeup_start);
acpi_copy_wakeup_routine(acpi_wakeup_address);
If I reserve the whole three pages I scribble on in the above patch (and
which we used to scribble on), by calling alloc_bootmem_low(3*PAGE_SIZE)
in acpi_reserve_bootmem(), then the failure to resume returns. I _need_
to scribble on whatever's after us :)
Failure mode is as follows:
Upon resume, _all_ processes with a userspace VM will oops on being
rescheduled. In every case, %eip is zero and %esp is the very top of the
8KiB area allocated for the task structure and stack. For example:
portmap left refrigerator
Unable to handle kernel NULL pointer dereference at virtual address
00000000
printing eip:
00000000
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0060:[<00000000>] Not tainted
EFLAGS: 00010046
EIP is at 0x0
eax: 000000a8 ebx: 08054db0 ecx: 00000003 edx: ffffffff
esi: 08054db0 edi: 08054db0 ebp: bffffd3c esp: ce14e000
ds: 007b es: 007b ss: 0068
Process portmap (pid: 550, threadinfo=ce14c000 task=ce4f80a0)
Stack:
Call Trace:
Code: Bad EIP value.
--
dwmw2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fix stack handling in acpi_wakeup.S
2003-02-11 18:44 Fix stack handling in acpi_wakeup.S Pavel Machek
2003-02-13 19:17 ` David Woodhouse
@ 2003-02-15 12:15 ` Alfred E. Heggestad
2003-02-15 17:49 ` Pavel Machek
1 sibling, 1 reply; 4+ messages in thread
From: Alfred E. Heggestad @ 2003-02-15 12:15 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
Hi Pavel
I applied this patch to 2.5.60 and when doing the
software suspend it did manage to start the freezing
process (process X into refrigerator etc...) but crashed
once in ide.c - apologies I do not have any more details
and I cannot reproduce that one.
Doing software suspend now will freeze all procs and
hang on the last one:
# echo 4 > /proc/acpi/sleep
...
=<proc> entered refrigerator
=| entered refrigerator
-> hang
This happens both with 2.5.60 plus Pavel acpi_wakeup.S patch
and vanilla 2.5.61, also with or withour X running.
My machine is a Sony Vaio VX71P, details can be found here:
http://lamis.wyrdweb.com/~alfredh/vaio_vx71p/
/alfred
On Tue, 2003-02-11 at 19:44, Pavel Machek wrote:
> Hi!
>
> This fixes stack handling in acpi_wakeup.S, and makes stack smaller so
> that wakeup code actually fits inside memory allocated for it. Plus
> someone renamed .L1432 to something meaningfull. Please apply,
> Pavel
>
> --- clean/arch/i386/kernel/acpi_wakeup.S 2003-02-11 17:40:33.000000000 +0100
> +++ linux/arch/i386/kernel/acpi_wakeup.S 2003-02-11 12:51:03.000000000 +0100
> @@ -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
> @@ -159,12 +159,14 @@
> .code32
> ALIGN
>
> +.org 0x800
> +wakeup_stack_begin: # Stack grows down
>
> -.org 0x2000
> +.org 0xff0 # Just below end of page
> wakeup_stack:
> -.org 0x3000
> ENTRY(wakeup_end)
> -.org 0x4000
> +
> +.org 0x1000
>
> wakeup_pmode_return:
> movl $__KERNEL_DS, %eax
> @@ -274,7 +276,7 @@
>
> ENTRY(do_suspend_lowlevel)
> cmpl $0,4(%esp)
> - jne .L1432
> + jne ret_point
> call save_processor_state
>
> movl %esp, saved_context_esp
> @@ -287,7 +289,7 @@
> movl %edi, saved_context_edi
> pushfl ; popl saved_context_eflags
>
> - movl $.L1432,saved_eip
> + movl $ret_point,saved_eip
> movl %esp,saved_esp
> movl %ebp,saved_ebp
> movl %ebx,saved_ebx
> @@ -299,7 +301,7 @@
> addl $4,%esp
> ret
> .p2align 4,,7
> -.L1432:
> +ret_point:
> movl $__KERNEL_DS,%eax
> movw %ax, %ds
> movl saved_context_esp, %esp
--
Alfred E. Heggestad <linuxedmund@home.no>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fix stack handling in acpi_wakeup.S
2003-02-15 12:15 ` Alfred E. Heggestad
@ 2003-02-15 17:49 ` Pavel Machek
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2003-02-15 17:49 UTC (permalink / raw)
To: Alfred E. Heggestad; +Cc: Pavel Machek, kernel list
Hi!
> I applied this patch to 2.5.60 and when doing the
> software suspend it did manage to start the freezing
> process (process X into refrigerator etc...) but crashed
> once in ide.c - apologies I do not have any more details
> and I cannot reproduce that one.
this patch has nothing to do with swsusp. I do not know what goes
wrong in ide.c, but this patch is for orthogonal issue.
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-02-15 17:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 18:44 Fix stack handling in acpi_wakeup.S Pavel Machek
2003-02-13 19:17 ` David Woodhouse
2003-02-15 12:15 ` Alfred E. Heggestad
2003-02-15 17:49 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®