Commit:     18789fb1c3311dd8c25acb6eb5ccab05771843f2
Parent:     90608a2928a86b9464a8698275a1138e82e3a010
Author:     Andre Detsch <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 20 16:39:59 2007 +0900
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Dec 21 19:46:21 2007 +1100

    [POWERPC] spufs: DMA Restart after SIGSEGV
    This fixes the behavior of spufs when a spu tries a DMA operation
    based on a wrong / unavailable address.
    Instead of just generating a SIGBUS signal, spufs now
    generates a SIGSEGV signal and restarts the problematic DMA operation
    after the execution of the application's signal handler.  This allows
    applications to employ user-level paging systems.
    Although the restart_dma function is called before the application's
    signal handler, the operation is not actually performed at this time,
    since the spu context is already stopped.  The operation only takes
    place when spu_run is restarted (which happens automatically).
    Signed-off-by: Andre Detsch <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
 arch/powerpc/platforms/cell/spufs/backing_ops.c |    2 +-
 arch/powerpc/platforms/cell/spufs/fault.c       |    5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c 
index d449553..50d98a1 100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
@@ -373,7 +373,7 @@ static int spu_backing_send_mfc_command(struct spu_context 
 static void spu_backing_restart_dma(struct spu_context *ctx)
-       /* nothing to do here */
+       ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_RESTART_DMA_COMMAND;
 struct spu_context_ops spu_backing_ops = {
diff --git a/arch/powerpc/platforms/cell/spufs/fault.c 
index 825001c..eff4d29 100644
--- a/arch/powerpc/platforms/cell/spufs/fault.c
+++ b/arch/powerpc/platforms/cell/spufs/fault.c
@@ -53,9 +53,10 @@ static void spufs_handle_event(struct spu_context *ctx,
                info.si_code = BUS_OBJERR;
-               info.si_signo = SIGBUS;
+               info.si_signo = SIGSEGV;
                info.si_addr = (void __user *)ea;
-               info.si_code = BUS_ADRERR;
+               info.si_code = SEGV_ACCERR;
+               ctx->ops->restart_dma(ctx);
                info.si_signo = SIGBUS;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to