Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Jul 2009 11:12:22 +0200
From:      Michal Hajduk <mih@semihalf.com>
To:        tinguely@casselton.net
Cc:        freebsd-arm@freebsd.org
Subject:   pmap problem in FreeBSD current 
Message-ID:  <4A51BFF6.4090401@semihalf.com>

next in thread | raw e-mail | index | archive | help
Hello Mark,

While testing EHCI (FreeBSD 8-current with new USB-stack) on
ARM machine I have found some problem probably related to
svn commit *194459* 
http://svn.freebsd.org/viewvc/base?view=revision&revision=194459
With compiled USB-stack I had vm_fault:

ehci0: <Marvell Integrated USB 2.0 controller> at mem 
0xf1050000-0xf1050fff irq 48,19 on mbus0
lock order reversal: (sleepable after non-sleepable)
1st 0xc0f55a88 256 (UMA zone) @ 
/home/mih/git/marvell-current/sys/vm/uma_core.c:2036
2nd 0xc0bf2fbc user map (user map) @ 
/home/mih/git/marvell-current/sys/vm/vm_map.c:3520
KDB: stack backtrace:
db_trace_thread() at db_trace_thread+0x10
scp=0xc0b28458 rlv=0xc0916b78 ($a+0x34)
rsp=0xc0e46764 rfp=0xc0e46880
r10=0xc36236c0 r9=0x00000dc0
r8=0xc0d3504c r7=0xc3623930 r6=0xffffffff r5=0xc0b52180
r4=0xc0e4676c
$a() at $a+0x10
scp=0xc0916b54 rlv=0xc09f6ae0 (kdb_backtrace+0x3c)
rsp=0xc0e46884 rfp=0xc0e46894
r4=0xc0c05d60
kdb_backtrace() at kdb_backtrace+0x10
scp=0xc09f6ab4 rlv=0xc0a05e80 (_witness_debugger+0x5c)
rsp=0xc0e46898 rfp=0xc0e468ac
r4=0x00000001
_witness_debugger() at _witness_debugger+0x14
scp=0xc0a05e38 rlv=0xc0a069a8 (witness_checkorder+0x5f4)
rsp=0xc0e468b0 rfp=0xc0e468f8
r5=0xc0bf2fbc r4=0x00000000
witness_checkorder() at witness_checkorder+0x10
scp=0xc0a063c4 rlv=0xc09d5cdc (_sx_slock+0x30)
rsp=0xc0e468fc rfp=0xc0e46920
r10=0xc0e46b40 r9=0xc0e46a40
r8=0x00000000 r7=0x00000000 r6=0x00000dc0 r5=0xc0b89084
r4=0xc0bf2fbc
_sx_slock() at _sx_slock+0x10
scp=0xc09d5cbc rlv=0xc0b1171c (vm_map_lookup+0x3c)
rsp=0xc0e46924 rfp=0xc0e46964
r8=0x00000001 r7=0x00000001
r6=0xc0bf2f74 r5=0x00000000 r4=0xc0e46a68
vm_map_lookup() at vm_map_lookup+0x10
scp=0xc0b116f0 rlv=0xc0b0b61c (vm_fault+0x90)
rsp=0xc0e46968 rfp=0xc0e46a98
r10=0xc0e46b40 r9=0xc0e46ef8
r8=0x00000001 r7=0xc0bf2d40 r6=0x00000000 r5=0x00000000
r4=0xc0e46a68
vm_fault() at vm_fault+0x10
scp=0xc0b0b59c rlv=0xc0b37cf0 (data_abort_handler+0x1ec)
rsp=0xc0e46a9c rfp=0xc0e46b3c
r10=0xc0e46b40 r9=0xc0e46ef8
r8=0x00000001 r7=0xc0bf2d40 r6=0x00000000 r5=0x00000000
r4=0xc0bf2b00
data_abort_handler() at data_abort_handler+0x10
scp=0xc0b37b14 rlv=0xc0b29ee0 (exception_exit)
rsp=0xc0e46b40 rfp=0xc0e46bac
r10=0xc0f4a1a4 r9=0x0000001f
r8=0xc0f54c80 r7=0x00000000 r6=0xc0f54c80 r5=0xffff1004
r4=0xc0f55a80
$a() at $a+0x10
scp=0xc0b08b6c rlv=0xc0b08ef4 ($a+0x3c)
rsp=0xc0e46bb0 rfp=0xc0e46bc8
r7=0x0000000f r6=0xc0f54c80
r5=0x00000003 r4=0xc0f55a80
$a() at $a+0x10
scp=0xc0b08ec8 rlv=0xc0b0a13c (uma_zalloc_arg+0x32c)
rsp=0xc0e46bcc rfp=0xc0e46c10
r6=0xc3b5efa8 r5=0x0000000f
r4=0x0000000f
uma_zalloc_arg() at uma_zalloc_arg+0x10
scp=0xc0b09e20 rlv=0xc09bfefc (malloc+0x5c)
rsp=0xc0e46c14 rfp=0xc0e46c34
r10=0xc0e46c80 r9=0xc0bebeac
r8=0xc0bda080 r7=0x00000002 r6=0x00000100 r5=0xc0f54c80
r4=0x00000004
malloc() at malloc+0x14
scp=0xc09bfeb4 rlv=0xc0b26674 (bus_dmamem_alloc+0x258)
rsp=0xc0e46c38 rfp=0xc0e46c70
r8=0x00000004 r7=0x00000002
r6=0xc3621800 r5=0xc0d6a234 r4=0x00000080
bus_dmamem_alloc() at bus_dmamem_alloc+0x10
scp=0xc0b2642c rlv=0xc0966fc4 (usb_pc_alloc_mem+0xa4)
rsp=0xc0e46c74 rfp=0xc0e46cb0
r10=0xc3b4de28 r9=0xc0b64844
r8=0xc3b4d808 r7=0xc3b4ddfc r6=0x00000100 r5=0xc3b4bf20
r4=0x00000080
usb_pc_alloc_mem() at usb_pc_alloc_mem+0x10
scp=0xc0966f30 rlv=0xc0962748 ($a+0x2c)
rsp=0xc0e46cb4 rfp=0xc0e46cc4
r10=0x00000000 r9=0xc0b64844
r8=0xc095ac30 r7=0xc096271c r6=0xc3b4dc50 r5=0xc3b4a000
r4=0xc3b4dc50
$a() at $a+0x10
scp=0xc096272c rlv=0xc095ad00 (ehci_iterate_hw_softc+0xd0)
rsp=0xc0e46cc8 rfp=0xc0e46ce8
r4=0x00000078
ehci_iterate_hw_softc() at ehci_iterate_hw_softc+0x10
scp=0xc095ac40 rlv=0xc09626bc (usb_bus_mem_alloc_all+0xb8)
rsp=0xc0e46cec rfp=0xc0e46d18
r7=0xc3b4dc50 r6=0x00000000
r5=0xc3b4ddac r4=0x00000008
usb_bus_mem_alloc_all() at usb_bus_mem_alloc_all+0x10
scp=0xc0962614 rlv=0xc0b49494 ($a+0x60)
rsp=0xc0e46d1c rfp=0xc0e46d5c
r8=0xc3b4dc50 r7=0xc09f08fc
r6=0xc3620000 r5=0xc3b4a000 r4=0xc3620480
$a() at $a+0x10
scp=0xc0b49444 rlv=0xc09f1fc8 (device_attach+0x70)
rsp=0xc0e46d60 rfp=0xc0e46da0
r10=0x00000000 r9=0xc0b64844
r8=0xc3620000 r7=0xc09f08fc r6=0xc362004c r5=0xc36bd344
r4=0xc3620480
device_attach() at device_attach+0x10
scp=0xc09f1f68 rlv=0xc09f3060 (bus_generic_attach+0x20)
rsp=0xc0e46da4 rfp=0xc0e46db4
r10=0x00000000 r9=0xc0b64844
r8=0xc3620480 r7=0xc0bed508 r6=0xc0bed510 r5=0x00000001
r4=0xc3620000
bus_generic_attach() at bus_generic_attach+0x10
scp=0xc09f3050 rlv=0xc0b40864 ($a+0x1fc)
rsp=0xc0e46db8 rfp=0xc0e46de0
r4=0x00000020
$a() at $a+0x10
scp=0xc0b40678 rlv=0xc09f1fc8 (device_attach+0x70)
rsp=0xc0e46de4 rfp=0xc0e46e24
r8=0xc3620480 r7=0xc09f08fc
r6=0xc36204cc r5=0xc361b204 r4=0xc3620600
device_attach() at device_attach+0x10
scp=0xc09f1f68 rlv=0xc09f3060 (bus_generic_attach+0x20)
rsp=0xc0e46e28 rfp=0xc0e46e38
r10=0x00000000 r9=0xc0b64844
r8=0xc3620600 r7=0xc09f08fc r6=0xc362064c r5=0xc361b465
r4=0xc3620480
bus_generic_attach() at bus_generic_attach+0x10
scp=0xc09f3050 rlv=0xc0b2cdcc ($a+0x1c)
rsp=0xc0e46e3c rfp=0xc0e46e4c
r4=0xc3620600
$a() at $a+0x10
scp=0xc0b2cdc0 rlv=0xc09f1fc8 (device_attach+0x70)
rsp=0xc0e46e50 rfp=0xc0e46e90
r4=0x80000000
device_attach() at device_attach+0x10
scp=0xc09f1f68 rlv=0xc09f32a0 (bus_generic_new_pass+0x110)
rsp=0xc0e46e94 rfp=0xc0e46eb4
r10=0x00000000 r9=0x0100029c
r8=0xc0c05b68 r7=0xc3620a00 r6=0xc0bec458 r5=0xc0bd38d0
r4=0xc3620600
bus_generic_new_pass() at bus_generic_new_pass+0x10
scp=0xc09f31a0 rlv=0xc09efb28 (bus_set_pass+0x98)
rsp=0xc0e46eb8 rfp=0xc0e46ed4
r8=0x0103cc50 r7=0xc0c05b68
r6=0x7fffffff r5=0xc3620a00 r4=0xc361c820
bus_set_pass() at bus_set_pass+0x10
scp=0xc09efaa0 rlv=0xc0997a1c (mi_startup+0x8c)
rsp=0xc0e46ed8 rfp=0xc0e46ef4
r7=0xc0bf345c r6=0xc0bf3460
r5=0xc0bf3464 r4=0xc0b8f2f4
mi_startup() at mi_startup+0x10
scp=0xc09979a0 rlv=0xc09001e4 (virt_done+0x14)
rsp=0xc0e46ef8 rfp=0x00000000
r7=0x00900140 r6=0x0103e020
r5=0x0090014c r4=0x00900224

vm_fault(0xc0bf2f74, 0, 1, 0) -> 1
Fatal kernel mode data abort: 'Translation Fault (S)'
trapframe: 0xc0e46b40
FSR=00000005, FAR=00000004, spsr=600000d3
r0 =c0f55a80, r1 =c0f54c80, r2 =00000003, r3 =fffffffb
r4 =c0f55a80, r5 =00000003, r6 =c0f54c80, r7 =00000000
r8 =c0f54c80, r9 =0000001f, r10=c0f4a1a4, r11=c0e46bac
r12=c0e46bb0, ssp=c0e46b8c, slr=c0b08ef4, pc =c0b08c74

[thread pid 0 tid 100000 ]
Stopped at $a+0x118: ldr r2, [r7, #0x004]
db>

Without new-usb stack with booting from NFS I have a LOR on
the line which was added in svn commit *194459* 
<http://svn.freebsd.org/viewvc/base?view=revision&revision=194459>; :
mge0: link state changed to UP
NFS ROOT: 10.0.0.201:/nfsroot/rd6281/
lock order reversal:
1st 0xc36050b0 pmap (pmap) @ 
/home/mih/git/marvell-current/sys/arm/arm/pmap.c:971
2nd 0xc0d26038 vm object (uma object) @ 
/home/mih/git/marvell-current/sys/vm/uma_core.c:1011
KDB: stack backtrace:
db_trace_thread() at db_trace_thread+0x10
scp=0xc0af6ce8 rlv=0xc0907798 ($a+0x34)
rsp=0xcf404880 rfp=0xcf40499c
r10=0xc35c84b8 r9=0x000003f3
r8=0xc0cea35c r7=0xc35c8a00 r6=0xffffffff r5=0xc0b1e610
r4=0xcf404888
$a() at $a+0x10
scp=0xc0907774 rlv=0xc09c5370 (kdb_backtrace+0x3c)
rsp=0xcf4049a0 rfp=0xcf4049b0
r4=0xc0bbb1d0
kdb_backtrace() at kdb_backtrace+0x10
scp=0xc09c5344 rlv=0xc09d4710 (_witness_debugger+0x5c)
rsp=0xcf4049b4 rfp=0xcf4049c8
r4=0x00000001
_witness_debugger() at _witness_debugger+0x14
scp=0xc09d46c8 rlv=0xc09d5238 (witness_checkorder+0x5f4)
rsp=0xcf4049cc rfp=0xcf404a14
r5=0xc0d26038 r4=0x00000000
witness_checkorder() at witness_checkorder+0x10
scp=0xc09d4c54 rlv=0xc09912b4 (_mtx_lock_flags+0x34)
rsp=0xcf404a18 rfp=0xcf404a40
r10=0xc0d26b80 r9=0xc0ef86e0
r8=0x000003f3 r7=0xc0b46f74 r6=0x00000000 r5=0x00000000
r4=0xc0d26038
_mtx_lock_flags() at _mtx_lock_flags+0x10
scp=0xc0991290 rlv=0xc0ad56b0 ($a+0x3c)
rsp=0xcf404a44 rfp=0xcf404a80
r10=0x00001000 r8=0x00000101
r7=0x00000000 r6=0xc0ef86e0 r5=0xc0ef9600 r4=0xc0ef9600
$a() at $a+0x10
scp=0xc0ad5684 rlv=0xc0ad6f44 ($a+0x70)
rsp=0xcf404a84 rfp=0xcf404ac0
r10=0xc0ad5674 r9=0xc0ef86e0
r8=0x00000101 r7=0x00000000 r6=0xc0ef86e0 r5=0x00000001
r4=0xc0ef9600
$a() at $a+0x10
scp=0xc0ad6ee4 rlv=0xc0ad74c0 ($a+0xd4)
rsp=0xcf404ac4 rfp=0xcf404ae4
r10=0xc0ee4c48 r9=0x00000080
r8=0xc0ef86e0 r7=0x00000000 r6=0xc0ef86e0 r5=0x00000201
r4=0xc0ef9600
$a() at $a+0x10
scp=0xc0ad73fc rlv=0xc0ad7784 ($a+0x3c)
rsp=0xcf404ae8 rfp=0xcf404b00
r7=0x0000006f r6=0xc0ef86e0
r5=0x00000001 r4=0xc0ef9600
$a() at $a+0x10
scp=0xc0ad7758 rlv=0xc0ad89cc (uma_zalloc_arg+0x32c)
rsp=0xcf404b04 rfp=0xcf404b48
r6=0xc1888de8 r5=0x0000006f
r4=0x0000006f
uma_zalloc_arg() at uma_zalloc_arg+0x10
scp=0xc0ad86b0 rlv=0xc0b00ca4 ($a+0x870)
rsp=0xcf404b4c rfp=0xcf404bd0
r10=0x01f9a55e r9=0x0000003c
r8=0xc36050b0 r7=0x00000000 r6=0x00000000 r5=0x01f9a552
r4=0xc3cbe0b8
$a() at $a+0x10
scp=0xc0b00444 rlv=0xc0b0169c (pmap_enter+0x70)
rsp=0xcf404bd4 rfp=0xcf404c04
r10=0x00000007 r9=0xc0d1b948
r8=0xc0f951b8 r7=0x7ffff000 r6=0x00000000 r5=0xc36050b0
r4=0xc0b4a4bc
pmap_enter() at pmap_enter+0x10
scp=0xc0b0163c rlv=0xc0adaff0 ($a+0x17c)
rsp=0xcf404c08 rfp=0xcf404d38
r10=0xcf404de0 r9=0xcf404ef8
r8=0x00000002 r7=0x00000000 r6=0x00000000 r5=0x00000001
r4=0x00000000
vm_fault() at vm_fault+0x10
scp=0xc0ad9e2c rlv=0xc0b065f0 (data_abort_handler+0x1ec)
rsp=0xcf404d3c rfp=0xcf404ddc
r10=0xcf404de0 r9=0xcf404ef8
r8=0x00000002 r7=0xc3603000 r6=0x00000000 r5=0x7ffff000
r4=0xc3601088
data_abort_handler() at data_abort_handler+0x10
scp=0xc0b06414 rlv=0xc0af8770 (exception_exit)
rsp=0xcf404de0 rfp=0xcf404e80
r10=0xc0965f04 r9=0xc3601000
r8=0xc0b892c8 r7=0xc0b892d2 r6=0xcf404eac r5=0xffff1004
r4=0x7fffffff
$a() at $a+0x10
scp=0xc0965f14 rlv=0xc097c78c (fork_exit+0x64)
rsp=0xcf404e84 rfp=0xcf404ea8
r10=0xc0965f04 r9=0x00000000
r8=0x00000000 r7=0xc3601000 r6=0xcf404eac r5=0xc0d26b80
r4=0xc3603000
fork_exit() at fork_exit+0x10
scp=0xc097c738 rlv=0xc0b05c5c (fork_trampoline+0x14)
rsp=0xcf404eac rfp=0x00000000
r10=0x00000000 r8=0x00000000
r7=0xc0b29cb8 r6=0xcf45feac r5=0x00000000 r4=0xc0965f04
lock order reversal:
1st 0xc36050b0 pmap (pmap) @ 
/home/mih/git/marvell-current/sys/arm/arm/pmap.c:971
2nd 0xc0d1b948 vm page queue mutex (vm page queue mutex) @ 
/home/mih/git/marvell-current/sys/arm/arm/pmap.c:1696
KDB: stack backtrace:
db_trace_thread() at db_trace_thread+0x10
scp=0xc0af6ce8 rlv=0xc0907798 ($a+0x34)
rsp=0xcf4047e8 rfp=0xcf404904
r10=0xc35c84b8 r9=0x000006a0
r8=0xc0ce9ee4 r7=0xc35c8178 r6=0xffffffff r5=0xc0b1e610
r4=0xcf4047f0
$a() at $a+0x10
scp=0xc0907774 rlv=0xc09c5370 (kdb_backtrace+0x3c)
rsp=0xcf404908 rfp=0xcf404918
r4=0xc0bbb1d0
kdb_backtrace() at kdb_backtrace+0x10
scp=0xc09c5344 rlv=0xc09d4710 (_witness_debugger+0x5c)
rsp=0xcf40491c rfp=0xcf404930
r4=0x00000001
_witness_debugger() at _witness_debugger+0x14
scp=0xc09d46c8 rlv=0xc09d5238 (witness_checkorder+0x5f4)
rsp=0xcf404934 rfp=0xcf40497c
r5=0xc0d1b948 r4=0x00000000
witness_checkorder() at witness_checkorder+0x10
scp=0xc09d4c54 rlv=0xc09912b4 (_mtx_lock_flags+0x34)
rsp=0xcf404980 rfp=0xcf4049a8
r10=0xc0d26b80 r9=0x00000012
r8=0x000006a0 r7=0xc0b4a4bc r6=0x00000000 r5=0x00000000
r4=0xc0d1b948
_mtx_lock_flags() at _mtx_lock_flags+0x10
scp=0xc0991290 rlv=0xc0afc600 ($a+0x110)
rsp=0xcf4049ac rfp=0xcf4049d8
r10=0x00000000 r8=0xc0f95494
r7=0xc36054dc r6=0xc36050b0 r5=0xc0f95464 r4=0xc1889150
$a() at $a+0x10
scp=0xc0afc500 rlv=0xc0b00f90 ($a+0xb5c)
rsp=0xcf4049dc rfp=0xcf404a60
r10=0x01fa300e r9=0x00000000
r8=0xc36050b0 r7=0x00000000 r6=0x00000000 r5=0x01fa3002
r4=0xc3cbde90
$a() at $a+0x10
scp=0xc0b00444 rlv=0xc0b015c8 (pmap_enter_object+0x88)
rsp=0xcf404a64 rfp=0xcf404a98
r10=0x00000005 r9=0xc36050b0
r8=0xc0f95464 r7=0x00000000 r6=0x00000097 r5=0xc0f95464
r4=0x00000001
pmap_enter_object() at pmap_enter_object+0x10
scp=0xc0b01550 rlv=0xc0ade254 (vm_map_pmap_enter+0x294)
rsp=0xcf404a9c rfp=0xcf404af0
r10=0x00000000 r9=0x00000000
r8=0x00000000 r7=0x00000097 r6=0x00000000 r5=0x00000000
r4=0x0000000f
vm_map_pmap_enter() at vm_map_pmap_enter+0x14
scp=0xc0addfd4 rlv=0xc0adef74 (vm_map_insert+0x390)
rsp=0xcf404af4 rfp=0xcf404b44
r10=0x00008000 r9=0x00000000
r8=0x00000000 r7=0xc3cc1110 r6=0x00000000 r5=0x00000000
r4=0x00000000
vm_map_insert() at vm_map_insert+0x10
scp=0xc0adebf4 rlv=0xc0963f9c ($a+0x258)
rsp=0xcf404b48 rfp=0xcf404b8c
r10=0x0009f000 r9=0x00008000
r8=0xc3605000 r7=0x00000000 r6=0x00000000 r5=0x00000005
r4=0x00000000
$a() at $a+0x10
scp=0xc0963d54 rlv=0xc09640b0 ($a+0xe0)
rsp=0xcf404b90 rfp=0xcf404bd0
r10=0x00096208 r9=0x00008000
r8=0xc3cc1110 r7=0x00000000 r6=0x00096208 r5=0xfffff000
r4=0x0009f000
$a() at $a+0x10
scp=0xc0963fe0 rlv=0xc0965300 ($a+0x448)
rsp=0xcf404bd4 rfp=0xcf404c64
r10=0x00000000 r9=0xc0ba7eb4
r8=0xc0ba19a4 r7=0xcf404d58 r6=0xcf408000 r5=0x00000000
r4=0xcf408034
$a() at $a+0x10
scp=0xc0964ec8 rlv=0xc09799d0 (kern_execve+0x258)
rsp=0xcf404c68 rfp=0xcf404de4
r10=0x00000000 r9=0xc3603000
r8=0xcf404d58 r7=0xffffffff r6=0xc0ba8bb4 r5=0x00000000
r4=0x00000002
kern_execve() at kern_execve+0x10
scp=0xc0979788 rlv=0xc097a58c (execve+0x48)
rsp=0xcf404de8 rfp=0xcf404e28
r10=0x7ffffffd r9=0xc3601000
r8=0xc0b892c8 r7=0xc0b892d2 r6=0x7ffffff2 r5=0xcf404df0
r4=0xc3603000
execve() at execve+0x10
scp=0xc097a554 rlv=0xc09660f0 ($a+0x1ec)
rsp=0xcf404e2c rfp=0xcf404e80
r5=0x7fffffe4 r4=0x7fffffe8
$a() at $a+0x10
scp=0xc0965f14 rlv=0xc097c78c (fork_exit+0x64)
rsp=0xcf404e84 rfp=0xcf404ea8
r10=0xc0965f04 r9=0x00000000
r8=0x00000000 r7=0xc3601000 r6=0xcf404eac r5=0xc0d26b80
r4=0xc3603000
fork_exit() at fork_exit+0x10
scp=0xc097c738 rlv=0xc0b05c5c (fork_trampoline+0x14)
rsp=0xcf404eac rfp=0x00000000
r10=0x00000000 r8=0x00000000
r7=0xc0b29cb8 r6=0xcf45feac r5=0x00000000 r4=0xc0965f04

When I reverted changes in pmap from this svn commit I didn't have LORs 
nor panics.
I will be grateful for any help or advice.

Best regards,
MichaƂ Hajduk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A51BFF6.4090401>