Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b0d3121a0b2cf91768ecef635e241b6abc3f1da
Commit:     8b0d3121a0b2cf91768ecef635e241b6abc3f1da
Parent:     6232a74f25f45a98d8cf64c5d4208f4795eb693d
Author:     Sebastian Siewior <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 19 14:38:12 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Sep 19 15:12:16 2007 +1000

    [POWERPC] spufs: Make isolated loader properly aligned
    
    According to the comment in spufs_init_isolated_loader(), the isolated
    loader should be aligned on a 16 byte boundary.
    ARCH_{KMALLOC,SLAB}_MINALIGN is not defined so only 8 byte alignment is
    guaranteed.
    
    This enforces alignment via __get_free_pages.
    
    Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/inode.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c 
b/arch/powerpc/platforms/cell/spufs/inode.c
index b3d0dd1..e210a4b 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -43,6 +43,7 @@
 
 static struct kmem_cache *spufs_inode_cache;
 char *isolated_loader;
+static int isolated_loader_size;
 
 static struct inode *
 spufs_alloc_inode(struct super_block *sb)
@@ -667,7 +668,8 @@ spufs_parse_options(char *options, struct inode *root)
 
 static void spufs_exit_isolated_loader(void)
 {
-       kfree(isolated_loader);
+       free_pages((unsigned long) isolated_loader,
+                       get_order(isolated_loader_size));
 }
 
 static void
@@ -685,11 +687,12 @@ spufs_init_isolated_loader(void)
        if (!loader)
                return;
 
-       /* kmalloc should align on a 16 byte boundary..* */
-       isolated_loader = kmalloc(size, GFP_KERNEL);
+       /* the loader must be align on a 16 byte boundary */
+       isolated_loader = (char *)__get_free_pages(GFP_KERNEL, get_order(size));
        if (!isolated_loader)
                return;
 
+       isolated_loader_size = size;
        memcpy(isolated_loader, loader, size);
        printk(KERN_INFO "spufs: SPU isolation mode enabled\n");
 }
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to