kernel stacks [eas: Re: G5 Bridge-mode MMU]

Marcel Moolenaar xcllnt at mac.com
Wed Apr 16 05:54:56 UTC 2008


On Apr 15, 2008, at 5:52 PM, Peter Grehan wrote:
> Hi Marcel,
>
>>> Are you sure it isn't a genuine stack overflow ?
>> Positive. The panic happens after 4KB of stack has been used.
>>> You may be able to tell by bumping the size of tmpstk on a non- 
>>> kstack0 boot and see how far up it's been used.
>> The backtrace also shows that. From inner-most to out-most function  
>> in
>> the backtrace the stack pointers are roughly 4KB apart.
>
> Can you send the code snippet that you're using to set up the  
> stack ? I can desk-check that, and then use it for my testing so we  
> have the exact same setup.

Diff attached.

This is the problem I'm running into:

Kernel entry at 0x100100 ...
GDB: debug ports: uartGDB: current port: uart
KDB: debugger backends: ddb gdb
KDB: current backend: ddb
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-CURRENT #8: Tue Apr 15 22:44:23 PDT 2008
     marcel at xserve.xcllnt.net:/nfs/freebsd/8.x/src/sys/powerpc/compile/ 
XSERVE
WARNING: WITNESS option enabled, expect reduced performance.
cpu0: Motorola PowerPC 7455 revision 2.1, 1000.00 MHz
cpu0: HID0 8450c0bc<EMCP,TBEN,NAP,DPM,ICE,DCE,SGE,BTIC,LRSTK,FOLD,BHT>
real memory  = 527314944 (502 MB)
avail memory = 510078976 (486 MB)
nexus0: <Open Firmware Nexus device>
unin0: <Apple UniNorth System Controller> on nexus0
unin0: Version 36
pcib0: <Apple UniNorth Host-PCI bridge> on nexus0
pci0: <PCI bus> on pcib0
bge0: <Apple BCM5701 B5, ASIC rev. 0x105> mem 0xa0000000-0xa000ffff  
irq 48 at device 16.0 on pci0
miibus0: <MII bus> on bge0
brgphy0: <BCM5701 10/100/1000baseTX PHY> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT,  
1000baseT-FDX, auto
bge0: Ethernet address: 00:03:93:c0:54:18
bge0: [ITHREAD]
pcib1: <Apple UniNorth Host-PCI bridge> on nexus0
pci1: <PCI bus> on pcib1
pcib2: <Open Firmware PCI-PCI bridge> at device 13.0 on pci1
pci2: <PCI bus> on pcib2
macio0: <KeyLargo I/O Controller> mem 0x80000000-0x8007ffff at device  
7.0 on pci2
openpic0: <OpenPIC Interrupt Controller> mem 0x40000-0x7ffff on macio0
scc0: <Zilog Z8530 dual channel SCC> mem 0x13000-0x13fff,0x8400-0x84ff, 
0x8500-0x85ff,0x8600-0x86ff,0x8700-0x87ff irq 22,23 on macio0
scc0: [FILTER]
scc0: [FILTER]
uart0: <z8530, channel A> on scc0
uart0: [FILTER]
uart0: console (57600,n,8,1)
uart1: <z8530, channel B> on scc0
uart1: [FILTER]
ata0 mem 0x1f000-0x1ffff,0x8a00-0x8aff irq 19 on macio0
ata0: [ITHREAD]
ohci0: <Apple KeyLargo USB controller> mem 0x80081000-0x80081fff irq  
27 at device 8.0 on pci2
ohci0: [GIANT-LOCKED]
ohci0: [ITHREAD]
usb0: OHCI version 1.0
usb0: <Apple KeyLargo USB controller> on ohci0
usb0: USB revision 1.0
[thread pid 0 tid 100000 ]
Stopped at      0x3e9cc0:       stwux   r0, r1, r9,
db> bt
Tracing pid 0 tid 100000 td 0x4cb340
0xd00040f0: at usbd_transfer+0xb0
0xd0004110: at usbd_sync_transfer+0x20
0xd0004120: at usbd_do_request_flags_pipe+0xa4
0xd0004170: at usbd_do_request_flags+0x40
0xd0004190: at usbd_get_string_desc+0x78
0xd00041c0: at usbd_get_string+0x94
0xd00042f0: at usbd_devinfo_vp+0x64
0xd0004310: at usbd_devinfo+0x48
0xd0004440: at usbd_new_device+0x5ac
0xd00048b0: at usb_attach+0x130
0xd0004a60: at device_attach+0x338
0xd0004a90: at device_probe_and_attach+0x134
0xd0004ab0: at ohci_pci_attach+0x6a8
0xd0004af0: at device_attach+0x338
0xd0004b20: at device_probe_and_attach+0x134
0xd0004b40: at bus_generic_attach+0x28
0xd0004b50: at pci_attach+0x118
0xd0004b80: at device_attach+0x338
0xd0004bb0: at device_probe_and_attach+0x134
0xd0004bd0: at bus_generic_attach+0x28
0xd0004be0: at ofw_pcib_pci_attach+0x78
0xd0004c10: at device_attach+0x338
0xd0004c40: at device_probe_and_attach+0x134
0xd0004c60: at bus_generic_attach+0x28
0xd0004c70: at pci_attach+0x118
0xd0004ca0: at device_attach+0x338
0xd0004cd0: at device_probe_and_attach+0x134
0xd0004cf0: at bus_generic_attach+0x28
0xd0004d00: at uninorth_attach+0x3e8
0xd0004d70: at device_attach+0x338
0xd0004da0: at device_probe_and_attach+0x134
0xd0004dc0: at bus_generic_attach+0x28
0xd0004dd0: at device_attach+0x338
0xd0004e00: at device_probe_and_attach+0x134
0xd0004e20: at root_bus_configure+0x30
0xd0004e30: at configure+0x14
0xd0004e40: at mi_startup+0x11c
0xd0004e70: at __start+0x98
db> show reg
r0          0xd00040f0
r1          0xd00040b0
r2                   0
r3            0xca76c0
r4                   0
r5          0xd00041c8
r6                 0x2
r7            0x1b998c  usbd_start_transfer
r8                   0
r9          0xfffffee0
r10              0x200  dsisize+0x15c
r11         0xd00040f0
r12              0x8c0  dsisize+0x81c
r13                  0
r14                  0
r15                  0
r16           0xcadd80
r17              0x100  dsisize+0x5c
r18                  0
r19           0xcae100
r20                  0
r21           0xca7594
r22           0xcae080
r23                0x5  vectrapsize+0x1
r24           0xcade00
r25         0xd00041a0
r26                0x4  vectrapsize
r27           0x1b998c  usbd_start_transfer
r28           0xc25600
r29         0xd00040b0
r30           0xc25600
r31         0xd00040b0
srr0          0x3e9cc0  bus_dmamap_load+0x4c
srr1            0x3032  dsisize+0x2f8e
lr            0x1ba190  usbd_transfer+0xb4
ctr                  0
cr          0x24000082
xer                  0
dar         0xd0003f90
dsisr                0
0x3e9cc0:       stwux   r0, r1, r9,
db>

As the backtrace shows, about 4K has been used, which means we're
running into the second page. The reason we're hitting the debugger
without a panic is because we're tripping over the stack overflow
logic. In other words: we have a DSI trap.

-- 
Marcel Moolenaar
xcllnt at mac.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc.diff
Type: application/octet-stream
Size: 5570 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ppc/attachments/20080416/7c19f2cf/ppc.obj
-------------- next part --------------



More information about the freebsd-ppc mailing list