Subject: port-i386/37434: kernel trap when trying to power down via apm
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <martin@duskware.de>
List: netbsd-bugs
Date: 11/26/2007 09:50:00
>Number:         37434
>Category:       port-i386
>Synopsis:       kernel trap when trying to power down via apm
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 26 09:50:00 +0000 2007
>Originator:     Martin Husemann
>Release:        NetBSD 4.99.36
>Organization:
>Environment:
System: NetBSD night-porter.duskware.de 4.99.29 NetBSD 4.99.29 (PORTER) #12: Tue Aug 21 23:01:52 CEST 2007 martin@night-porter.duskware.de:/usr/src/sys/arch/i386/compile/PORTER i386
Architecture: i386
Machine: i386
>Description:

I have an older i386 machine w/o ACPI bios, so I use apm. With -current as of
today this machine can not power down (see below)

Rebooting (like: shutdown -r) works fine.

>How-To-Repeat:

apm0 at mainbus0: Advanced Power Management BIOS: Power Management spec V1.2
[..]
Enter pathname of shell or RETURN for /bin/sh: 
# halt -p
Nov 26 11:36:46 halt: halted by root

syncing disks... done
unmounting file systems... done
APM set power state <2ff,3>: unrecognized device ID (0x907)
uvm_fault(0xc9b51d04, 0x8000, 1) -> 0xe
kernel: supervisor trap page fault, code=0
Stopped in pid 3.1 (halt) at    netbsd:trap+0x6e7:      movb    0(%edx),%al
db> bt
trap() at netbsd:trap+0x6e7
--- trap (number 4) ---
0x8726:
db> sh r
ds          0x10
es          0x10
fs          0x30
gs          0x10
edi         0xc9b4c9d8
esi         0
ebp         0xcabbea52
ebx         0xcabbecd0
edx         0x8726
ecx         0xcabbea5e
eax         0xcabbea5e
eip         0xc0226897  trap+0x6e7
cs          0x8
eflags      0x10046
esp         0xcabbe9ea
ss          0x10
netbsd:trap+0x6e7:      movb    0(%edx),%al
db> ps
 PID           PPID     PGRP        UID S   FLAGS LWPS          COMMAND    WAIT
>3                1        3          0 4  0x4000    1             halt
 1                0        1          0 4  0x4000    1             init   pause
 0               -1        0          0 2 0x20002   14           system       *
db>


0xc027e63f is in trap (../../../../arch/i386/i386/trap.c:393).
388                      * a fast interrupt.  This should not be possible.  It can be
389                      * fixed by rearranging the trap frame so that the stack format
390                      * at this point is the same as on exit from a `slow'
391                      * interrupt.
392                      */
393                     switch (*(u_char *)frame->tf_eip) {
394                     case 0xcf:      /* iret */
395                             vframe = (void *)((int)&frame->tf_esp -
396                                 offsetof(struct trapframe, tf_eip));
397                             resume = (int)resume_iret;


>Fix:
n/a