--- zzzz-none-000/linux-2.6.19.2/mm/slab.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/mm/slab.c 2008-04-10 12:21:44.000000000 +0000 @@ -652,14 +652,33 @@ static struct cache_names __initdata cache_names[] = { #define CACHE(x) { .name = "size-" #x, .name_dma = "size-" #x "(DMA)" }, #include - {NULL,} + {NULL, NULL} #undef CACHE }; -static struct arraycache_init initarray_cache __initdata = - { {0, BOOT_CPUCACHE_ENTRIES, 1, 0} }; -static struct arraycache_init initarray_generic = - { {0, BOOT_CPUCACHE_ENTRIES, 1, 0} }; +static struct arraycache_init initarray_cache __initdata = { + { + .avail = 0, + .limit = BOOT_CPUCACHE_ENTRIES, + .batchcount = 1, + .touched = 0 + }, + { + 0 + } +}; + +static struct arraycache_init initarray_generic = { + { + .avail = 0, + .limit = BOOT_CPUCACHE_ENTRIES, + .batchcount = 1, + .touched = 0 + }, + { + 0 + } +}; /* internal cache of cache description objs */ static struct kmem_cache cache_cache = { @@ -861,6 +880,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep, char *msg) { + restore_printk(); printk(KERN_ERR "slab error in %s(): cache `%s': %s\n", function, cachep->name, msg); dump_stack(); @@ -883,7 +903,7 @@ if (node == MAX_NUMNODES) node = first_node(node_online_map); - per_cpu(reap_node, cpu) = node; + __get_cpu_var(reap_node) = node; } static void next_reap_node(void) @@ -1661,6 +1681,11 @@ while (!kstack_end(sptr)) { svalue = *sptr++; + +#ifdef CONFIG_PAX_KERNEXEC + svalue += __KERNEL_TEXT_OFFSET; +#endif + if (kernel_text_address(svalue)) { *addr++ = svalue; size -= sizeof(unsigned long); @@ -1764,6 +1789,7 @@ /* Mismatch ! */ /* Print header */ if (lines == 0) { + restore_printk(); printk(KERN_ERR "Slab corruption: start=%p, len=%d\n", realobj, size); @@ -2092,6 +2118,7 @@ */ if (!name || in_interrupt() || (size < BYTES_PER_WORD) || (size > (1 << MAX_OBJ_ORDER) * PAGE_SIZE) || (dtor && !ctor)) { + restore_printk(); printk(KERN_ERR "%s: Early error in slab %s\n", __FUNCTION__, name); BUG(); @@ -2116,7 +2143,7 @@ * area of the module. Print a warning. */ set_fs(KERNEL_DS); - res = __get_user(tmp, pc->name); + res = __get_user(tmp, (char __user *)pc->name); set_fs(old_fs); if (res) { printk("SLAB: cache with size %d has lost its name\n", @@ -2125,6 +2152,7 @@ } if (!strcmp(pc->name, name)) { + restore_printk(); printk("kmem_cache_create: duplicate cache %s\n", name); dump_stack(); goto oops; @@ -2263,6 +2291,7 @@ left_over = calculate_slab_order(cachep, size, align, flags); if (!cachep->num) { + restore_printk(); printk("kmem_cache_create: couldn't create cache %s.\n", name); kmem_cache_free(&cache_cache, cachep); cachep = NULL; @@ -2651,6 +2680,7 @@ WARN_ON(slabp->nodeid != nodeid); if (slab_bufctl(slabp)[objnr] + 1 <= SLAB_LIMIT + 1) { + restore_printk(); printk(KERN_ERR "slab: double free detected in cache " "'%s', objp %p\n", cachep->name, objp); BUG(); @@ -2790,12 +2820,14 @@ struct page *page; if (!virt_addr_valid(objp)) { + restore_printk(); printk(KERN_ERR "kfree_debugcheck: out of range ptr %lxh.\n", (unsigned long)objp); BUG(); } page = virt_to_page(objp); if (!PageSlab(page)) { + restore_printk(); printk(KERN_ERR "kfree_debugcheck: bad ptr %lxh.\n", (unsigned long)objp); BUG(); @@ -2897,6 +2929,7 @@ } if (entries != cachep->num - slabp->inuse) { bad: + restore_printk(); printk(KERN_ERR "slab: Internal list corruption detected in " "cache '%s'(%d), slabp %p(%d). Hexdump:\n", cachep->name, cachep->num, slabp, slabp->inuse);