[Cbe-oss-dev] kernel exception on ps3

Martin Schreiber martin.schreiber at in.tum.de
Thu Apr 12 06:12:50 EST 2007


On Tue, 2007-04-10 at 13:23 +1000, Jeremy Kerr wrote:
> Martin,
> 
> > Badness at arch/powerpc/platforms/cell/spufs/inode.c:371
> 
> This backtrace shows a warning in inode.c, but it isn't fatal, and is 
> only reported when your application exits before destroying the SPE 
> contexts. It's a known bug (we're working on it), but is safe to ignore 
> for now.
> 
> Are you having any other problems with your app? If so, could you also 
> include:

i have another problem but i dont know if this is the right place to
describe the problem:

> * the source of send_to_spu(), and how it determines the address to
>   send the message to


struct spu_control_area_t
{
        uint32_t pad0;
        uint32_t spu_out_mbox;  // outbound mailbox register
        uint32_t pad1;
        uint32_t spu_in_mbox;   // inbound mailbox register
        uint32_t pad2;
        uint32_t spu_mbox_stat; // status
        uint32_t pad3;
        uint32_t spu_run_ctrl;
//............
};

// send a message from spu to another spu
// there must not exist any message in the queue of the destination spu
inline void send_to_spu(int spe_id, uint32_t msg)
{
        static struct spu_control_area_t ca __attribute__((aligned(16)));
        ca.spu_in_mbox = msg;
/*
        while(1)	// wait until we can send a message to the other spu (read status)
        {
                dma_read(       &ca.pad1,       // value to write - must have the same alignment within qword as the destination block
                                spe_control_block[spe_id].control_area+16+4,
                                sizeof(ca.pad1),
                                2);
                dma_finish_all(2);

                if (ca.pad1 > 0)
                        break;
        }
*/
        dma_write(      &ca.spu_in_mbox,        // value to write - must have the same alignment within qword as the destination block
                        spe_control_block[spe_id].control_area+12,
                        sizeof(ca.spu_in_mbox),
                        2);
        dma_finish_all(2);
}


---
i think that the error happens, if 2 spus want to write to the same memory area of another spu. the resulting message is sometimes just 0.

i also tried the communication with the commented part but it also doesnt work all the time.

is there a possibility to create an atomic access to a special memory area?
the steps will be:
* lock an memory area
* read the status register via memory and loop this operation until the status register says that we can send the message to the other spu
* write to the inbox memory mapped register of the other spu
* unlock the memory area

> * whether your kernel is built with CONFIG_PPC_64K_PAGES

CONFIG_PPC64=y
CONFIG_64BIT=y
# CONFIG_PPC_64K_PAGES is not set

> * the version of libspe that you're using

i use libspe2.1

thanx,
  martin

> 
> Cheers,
> 
> 
> Jeremy
> > Apr  9 07:40:46 ps3 
> > kernel: Call Trace:
> > Apr  9 07:40:46 ps3 kernel: [C0006C006124B350] [C00000000000F27C]
> > .show_stack+0x68/0x1b0 (unreliable) Apr  9 07:40:46 ps3 kernel:
> > [C0006C006124B3F0] [C00000000017D670] .report_bug+0x94/0xe8 Apr  9
> > 07:40:46 ps3 kernel: [C0006C006124B480] [C00000000001EF24]
> > .program_check_exception+0x138/0x570 Apr  9 07:40:46 ps3 kernel:
> > [C0006C006124B550] [C0000000000044FC] program_check_common+0xfc/0x100
> > Apr  9 07:40:46 ps3 kernel: --- Exception: 700 at
> > .spufs_gang_close+0x2c/0x58 Apr  9 07:40:46 ps3 kernel:     LR =
> > .spufs_gang_close+0x2c/0x58 Apr  9 07:40:46 ps3 kernel:
> > [C0006C006124B8D0] [C0000000000A05E0] .__fput+0x114/0x204 Apr  9
> > 07:40:46 ps3 kernel: [C0006C006124B980] [C00000000009CEC4]
> > .filp_close+0xac/0xd4 Apr  9 07:40:46 ps3 kernel: [C0006C006124BA10]
> > [C0000000000471F8] .put_files_struct+0xb4/0x13c Apr  9 07:40:46 ps3
> > kernel: [C0006C006124BAB0] [C000000000048BC4] .do_exit+0x274/0x8b4
> > Apr  9 07:40:46 ps3 kernel: [C0006C006124BB70] [C0000000000492B8]
> > .sys_exit_group+0x0/0x8 Apr  9 07:40:46 ps3 kernel:
> > [C0006C006124BC00] [C0000000000544A8]
> > .get_signal_to_deliver+0x3dc/0x42c Apr  9 07:40:46 ps3 kernel:
> > [C0006C006124BCB0] [C000000000016948] .do_signal+0xa4/0x88c Apr  9
> > 07:40:46 ps3 kernel: [C0006C006124BE30] [C000000000008BF0]
> > do_work+0x28/0x2c
> >
> >
> >
> >
> > Martin Schreiber
> > Im Muehltal 48
> > 91171 Greding
> > - Germany -
> >
> > http://www.martin-schreiber.net
> > SchreiberX at Altmuehlnet.de
> >
> >
> >
> >  --
> >  --
> >
> >
> > -----BEGIN GEEK CODE BLOCK-----
> > Version: 3.12
> > GCS d s+: a-- C++ UL++ P+ L+++ E-- W+++ N o K- w---
> > O- M- V- PS+++ PE+ Y PGP++ t 5+ X R+ tv++ b+ DI- D++
> > G e h-- r-- y+
> > ------END GEEK CODE BLOCK------
> > Martin Schreiber
> > Enzianstrasse 3 00/06
> > D-85748 Garching
> >
> > HTTP: www.martin-schreiber.net
> > MAIL: schreibm at in.tum.de
> >
> >
> >
> > _______________________________________________
> > cbe-oss-dev mailing list
> > cbe-oss-dev at ozlabs.org
> > https://ozlabs.org/mailman/listinfo/cbe-oss-dev
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev
> 
Martin Schreiber
Enzianstrasse 3 00/06
D-85748 Garching

HTTP: www.martin-schreiber.net
MAIL: schreibm at in.tum.de






More information about the cbe-oss-dev mailing list