Re: Fix stack handling in acpi_wakeup.S

From: David Woodhouse (dwmw2@infradead.org)
Date: Thu Feb 13 2003 - 14:17:13 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:48 EST