[Cbe-oss-dev] [PATCH 9:11] spufs: Fix access mechanism for problem state registers

Kazunori Asayama asayama at sm.sony.co.jp
Fri May 23 19:10:28 EST 2008


Luke Browning wrote:
> Fix access mechanism for problem state registers
> 
> The current mechanism for providing access to problem state registers
> is broken because it relies on the application to invoke spu_run for 
> the target context.  This is convenient and it works most of the time
> as the library is repeatedly driving spu_run to redrive the context
> after processing an spu exception or event.  But, it is wrong as it
> assumes that there will be another spu error or exception for the
> target context.  There may or may not be.  It is also not desirable
> from a performance perspective as it introduces delays into the 
> application.  This patch activates the context in spufs_ps_nopfn
> regardless of whether the target context is in kernel mode or user
> mode.
> 
> Signed-off-by: Luke Browning <lukebrowning at us.ibm.com>

I got the messages below from the kernel with this patch,
by running a libspe2 test 'test_multiple_context.elf' with many
SPE contexts:

  # cd libspe2/tests/libspe2.run
  # make test_multiple_context.elf TEST_SPES=30

I tried:

   - PS3 + latest public ps3-linux tree
   - QS20 + 2.6.26-rc3


* PS3 + latest ps3-linux.git

------------------------------------------------------------------------
Badness at kernel/mutex.c:134
NIP: c00000000036e650 LR: c00000000036e634 CTR: c000000000038d5c
REGS: c00000000659f540 TRAP: 0700   Not tainted  (2.6.26-rc3-22094-g959e5a4-dirty)
MSR: 8000000000028032 <EE,IR,DR>  CR: 22002422  XER: 00000000
TASK = c00000000c5f40c0[2518] 'test_multiple_c' THREAD: c00000000659c000 CPU: 1
GPR00: 0000000000000000 c00000000659f7c0 c00000000057e2d8 0000000000000001 
GPR04: 00000000000000d1 00000000000000d1 0000000000000000 0000000000000000 
GPR08: 00000000000d587e c000000000985038 0000000000000000 0000000000000001 
GPR12: 8000000000008032 c0000000005b1500 0000000010003eb8 0000000010003eb8 
GPR16: 0000000010010380 0000000010003e98 0000000010010380 0000000010003e98 
GPR20: 0000000010003e98 00000000f7fe98b0 00000000f7fe98b0 0000000010010380 
GPR24: 0000000000000000 c0000000000381d0 c00000000c5f40c0 0000000000000001 
GPR28: c00000000c7b0950 c00000000c7b0000 c0000000005339d0 c00000000659f7c0 
NIP [c00000000036e650] .mutex_lock_nested+0x114/0x3c8
LR [c00000000036e634] .mutex_lock_nested+0xf8/0x3c8
Call Trace:
[c00000000659f7c0] [c00000000036e5d4] .mutex_lock_nested+0x98/0x3c8 (unreliable)
[c00000000659f8a0] [c0000000000381d0] .spu_schedule+0x38/0x9c
[c00000000659f940] [c0000000000382bc] .__spu_deactivate+0x88/0xd8
[c00000000659f9f0] [c000000000038408] .spu_deactivate+0x40/0x60
[c00000000659fa80] [c000000000036114] .spu_forget+0x48/0x88
[c00000000659fb10] [c00000000002f8f0] .spufs_dir_close+0x94/0xd4
[c00000000659fbc0] [c0000000000cc530] .__fput+0x118/0x22c
[c00000000659fc70] [c0000000000cc9d0] .fput+0x3c/0x50
[c00000000659fcf0] [c0000000000c8660] .filp_close+0xb4/0xe0
[c00000000659fd90] [c0000000000ca348] .sys_close+0xb8/0x108
[c00000000659fe30] [c0000000000076dc] syscall_exit+0x0/0x40
Instruction dump:
4bffffc8 e81c0058 7fa0e000 41be0028 4be6a9d5 60000000 2fa30000 419e0018 
e93e8000 80090000 2f800000 409e0008 <0fe00000> 3bbf0070 7f83e378 7fa4eb78 
------------------------------------------------------------------------

------------------------------------------------------------------------
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc0000000001dce5c
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=2 PS3
Modules linked in:
NIP: c0000000001dce5c LR: c00000000036e6ac CTR: 0000000000000000
REGS: c00000000c1e74c0 TRAP: 0300   Not tainted  (2.6.26-rc3-22094-g959e5a4-dirty)
MSR: 8000000000008032 <EE,IR,DR>  CR: 24002442  XER: 00000000
DAR: 0000000000000000, DSISR: 0000000040000000
TASK = c00000000caf02c0[2513] 'test_multiple_c' THREAD: c00000000c1e4000 CPU: 1
GPR00: c00000000036e6ac c00000000c1e7740 c00000000057e2d8 c00000000c1e7830 
GPR04: 0000000000000000 0000000000000000 c00000000c114988 0000000000000002 
GPR08: 0000000000000001 0000000000000000 0000000000000000 c0000000000381d0 
GPR12: 8000000000008032 c0000000005b1500 0000000010003eb8 0000000010003eb8 
GPR16: 0000000010010380 0000000010003e98 0000000010010380 0000000010003e98 
GPR20: 0000000010003e98 00000000f7fe98b0 00000000f7fe98b0 0000000010010380 
GPR24: 0000000000000000 c0000000000381d0 c00000000caf02c0 0000000000000001 
GPR28: c00000000c114950 c00000000c1e7830 c00000000053e868 c00000000c1e7740 
NIP [c0000000001dce5c] .__list_add+0x4c/0xa0
LR [c00000000036e6ac] .mutex_lock_nested+0x170/0x3c8
Call Trace:
[c00000000c1e7740] [0000000000000001] 0x1 (unreliable)
[c00000000c1e77c0] [c00000000036e6ac] .mutex_lock_nested+0x170/0x3c8
[c00000000c1e78a0] [c0000000000381d0] .spu_schedule+0x38/0x9c
[c00000000c1e7940] [c0000000000382bc] .__spu_deactivate+0x88/0xd8
[c00000000c1e79f0] [c000000000038408] .spu_deactivate+0x40/0x60
[c00000000c1e7a80] [c000000000036114] .spu_forget+0x48/0x88
[c00000000c1e7b10] [c00000000002f8f0] .spufs_dir_close+0x94/0xd4
[c00000000c1e7bc0] [c0000000000cc530] .__fput+0x118/0x22c
[c00000000c1e7c70] [c0000000000cc9d0] .fput+0x3c/0x50
[c00000000c1e7cf0] [c0000000000c8660] .filp_close+0xb4/0xe0
[c00000000c1e7d90] [c0000000000ca348] .sys_close+0xb8/0x108
[c00000000c1e7e30] [c0000000000076dc] syscall_exit+0x0/0x40
Instruction dump:
f821ff81 60000000 60000000 e8a50008 7c3f0b78 7fa52000 41be0018 e87e8010 
4be7a6cd 60000000 0fe00000 48000000 <e8040000> 7fa03000 41be0024 e87e8018 
------------------------------------------------------------------------


* QS20 + 2.6.26-rc3

------------------------------------------------------------------------
kernel BUG at arch/powerpc/platforms/cell/spufs/sched.c:416!
cpu 0x2: Vector: 700 (Program Check) at [c00000001c1837a0]
    pc: c000000000042868: .spu_unbind_context+0x54/0x28c
    lr: c000000000043414: .spu_activate+0x288/0x4c8
    sp: c00000001c183a20
   msr: 9000000000029032
  current = 0xc0
Messag0000001c161920
  paca    = 0xc000000000623880
    pid   = 2004, comm = test_multiple_c
kernel BUG at arch/powerpc/platforms/cell/spufs/sched.c:416!
enter ? for help
------------------------------------------------------------------------

(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list