diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-11-20 18:45:10 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 20:40:06 +1100 |
commit | c6730ed4c280ff9e55766796523c94a7d111da09 (patch) | |
tree | 6635d2a52f7e8021e4565edd0b66a752d4d699ad /arch/powerpc/platforms/cell/spufs/file.c | |
parent | 3960c260204bc33404a6e54e9dcd44f1f83bc701 (diff) | |
download | op-kernel-dev-c6730ed4c280ff9e55766796523c94a7d111da09.zip op-kernel-dev-c6730ed4c280ff9e55766796523c94a7d111da09.tar.gz |
[POWERPC] spufs: Load isolation kernel from spu_run
In order to fit with the "don't-run-spus-outside-of-spu_run" model, this
patch starts the isolated-mode loader in spu_run, rather than
spu_create. If spu_run is passed an isolated-mode context that isn't in
isolated mode state, it will run the loader.
This fixes potential races with the isolated SPE app doing a
stop-and-signal before the PPE has called spu_run: bugzilla #29111.
Also (in conjunction with a mambo patch), this addresses #28565, as we
always set the runcntrl register when entering spu_run.
It is up to libspe to ensure that isolated-mode apps are cleaned up
after running to completion - ie, put the app through the "ISOLATE EXIT"
state (see Ch11 of the CBEA).
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/file.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index e666753..50e0afc 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -1358,37 +1358,6 @@ static struct file_operations spufs_mfc_fops = { .mmap = spufs_mfc_mmap, }; - -static int spufs_recycle_open(struct inode *inode, struct file *file) -{ - file->private_data = SPUFS_I(inode)->i_ctx; - return nonseekable_open(inode, file); -} - -static ssize_t spufs_recycle_write(struct file *file, - const char __user *buffer, size_t size, loff_t *pos) -{ - struct spu_context *ctx = file->private_data; - int ret; - - if (!(ctx->flags & SPU_CREATE_ISOLATE)) - return -EINVAL; - - if (size < 1) - return -EINVAL; - - ret = spu_recycle_isolated(ctx); - - if (ret) - return ret; - return size; -} - -static struct file_operations spufs_recycle_fops = { - .open = spufs_recycle_open, - .write = spufs_recycle_write, -}; - static void spufs_npc_set(void *data, u64 val) { struct spu_context *ctx = data; @@ -1789,6 +1758,5 @@ struct tree_descr spufs_dir_nosched_contents[] = { { "psmap", &spufs_psmap_fops, 0666, }, { "phys-id", &spufs_id_ops, 0666, }, { "object-id", &spufs_object_id_ops, 0666, }, - { "recycle", &spufs_recycle_fops, 0222, }, {}, }; |