From: Greg Kroah-Hartman Date: Fri, 22 Feb 2013 19:07:35 +0000 (-0800) Subject: 3.8-stable patches X-Git-Tag: v3.7.10~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=716ff58f8df3aa45ed9535fc71dc9af934f544d5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.8-stable patches added patches: perf-hists-fix-period-symbol_conf.field_sep-display.patch perf-tools-fix-build-with-bison-2.3-and-older.patch x86-32-mm-remove-reference-to-alloc_remap.patch x86-32-mm-remove-reference-to-resume_map_numa_kva.patch x86-32-mm-rip-out-x86_32-numa-remapping-code.patch --- diff --git a/queue-3.8/perf-hists-fix-period-symbol_conf.field_sep-display.patch b/queue-3.8/perf-hists-fix-period-symbol_conf.field_sep-display.patch new file mode 100644 index 00000000000..5ee8912ccee --- /dev/null +++ b/queue-3.8/perf-hists-fix-period-symbol_conf.field_sep-display.patch @@ -0,0 +1,48 @@ +From c0d246b85fc7d42688d7a5d999ea671777caf65b Mon Sep 17 00:00:00 2001 +From: Jiri Olsa +Date: Sat, 20 Oct 2012 22:14:10 +0200 +Subject: perf hists: Fix period symbol_conf.field_sep display + +From: Jiri Olsa + +commit c0d246b85fc7d42688d7a5d999ea671777caf65b upstream. + +Currently we don't properly display hist data with symbol_conf.field_sep +separator. We need to display either space or separator. + +Signed-off-by: Jiri Olsa +Cc: Arnaldo Carvalho de Melo +Cc: Peter Zijlstra +Cc: Ingo Molnar +Cc: Paul Mackerras +Cc: Corey Ashford +Cc: Frederic Weisbecker +Cc: Namhyung Kim +Link: http://lkml.kernel.org/n/tip-cyggwys0bz5kqdowwvfd8h72@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Cc: Josh Boyer +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/ui/hist.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/tools/perf/ui/hist.c ++++ b/tools/perf/ui/hist.c +@@ -463,11 +463,15 @@ int hist_entry__period_snprintf(struct p + if (!perf_hpp__format[i].cond) + continue; + ++ /* ++ * If there's no field_sep, we still need ++ * to display initial ' '. ++ */ + if (!sep || !first) { + ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " "); + advance_hpp(hpp, ret); ++ } else + first = false; +- } + + if (color && perf_hpp__format[i].color) + ret = perf_hpp__format[i].color(hpp, he); diff --git a/queue-3.8/perf-tools-fix-build-with-bison-2.3-and-older.patch b/queue-3.8/perf-tools-fix-build-with-bison-2.3-and-older.patch new file mode 100644 index 00000000000..f7701094bc0 --- /dev/null +++ b/queue-3.8/perf-tools-fix-build-with-bison-2.3-and-older.patch @@ -0,0 +1,72 @@ +From 85df3b3769222894e9692b383c7af124b7721086 Mon Sep 17 00:00:00 2001 +From: Vinson Lee +Date: Wed, 13 Feb 2013 13:48:58 -0800 +Subject: perf tools: Fix build with bison 2.3 and older. + +From: Vinson Lee + +commit 85df3b3769222894e9692b383c7af124b7721086 upstream. + +The %name-prefix "prefix" syntax is not available on bison 2.3 and +older. Substitute with the -p "prefix" command-line option for +compatibility with older versions of bison. + +This patch fixes this build error with older versions of bison. + + CC util/sysfs.o + BISON util/pmu-bison.c +util/pmu.y:2.14-24: syntax error, unexpected string, expecting = +make: *** [util/pmu-bison.c] Error 1 + +Signed-off-by: Vinson Lee +Tested-by: Li Zefan +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Li Zefan +Cc: Namhyung Kim +Cc: Paul Mackerras +Cc: Pekka Enberg +Link: http://lkml.kernel.org/r/1360792138-29186-1-git-send-email-vlee@twitter.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/Makefile | 4 ++-- + tools/perf/util/parse-events.y | 1 - + tools/perf/util/pmu.y | 1 - + 3 files changed, 2 insertions(+), 4 deletions(-) + +--- a/tools/perf/Makefile ++++ b/tools/perf/Makefile +@@ -276,13 +276,13 @@ $(OUTPUT)util/parse-events-flex.c: util/ + $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c + + $(OUTPUT)util/parse-events-bison.c: util/parse-events.y +- $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c ++ $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -p parse_events_ + + $(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c + $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c + + $(OUTPUT)util/pmu-bison.c: util/pmu.y +- $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c ++ $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_ + + $(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c + $(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c +--- a/tools/perf/util/parse-events.y ++++ b/tools/perf/util/parse-events.y +@@ -1,5 +1,4 @@ + %pure-parser +-%name-prefix "parse_events_" + %parse-param {void *_data} + %parse-param {void *scanner} + %lex-param {void* scanner} +--- a/tools/perf/util/pmu.y ++++ b/tools/perf/util/pmu.y +@@ -1,5 +1,4 @@ + +-%name-prefix "perf_pmu_" + %parse-param {struct list_head *format} + %parse-param {char *name} + diff --git a/queue-3.8/series b/queue-3.8/series new file mode 100644 index 00000000000..4d057f77449 --- /dev/null +++ b/queue-3.8/series @@ -0,0 +1,5 @@ +x86-32-mm-rip-out-x86_32-numa-remapping-code.patch +x86-32-mm-remove-reference-to-resume_map_numa_kva.patch +x86-32-mm-remove-reference-to-alloc_remap.patch +perf-tools-fix-build-with-bison-2.3-and-older.patch +perf-hists-fix-period-symbol_conf.field_sep-display.patch diff --git a/queue-3.8/x86-32-mm-remove-reference-to-alloc_remap.patch b/queue-3.8/x86-32-mm-remove-reference-to-alloc_remap.patch new file mode 100644 index 00000000000..a377c6973a2 --- /dev/null +++ b/queue-3.8/x86-32-mm-remove-reference-to-alloc_remap.patch @@ -0,0 +1,72 @@ +From 07f4207a305c834f528d08428df4531744e25678 Mon Sep 17 00:00:00 2001 +From: "H. Peter Anvin" +Date: Thu, 31 Jan 2013 14:00:48 -0800 +Subject: x86-32, mm: Remove reference to alloc_remap() + +From: "H. Peter Anvin" + +commit 07f4207a305c834f528d08428df4531744e25678 upstream. + +We have removed the remap allocator for x86-32, and x86-64 never had +it (and doesn't need it). Remove residual reference to it. + +Reported-by: Yinghai Lu +Signed-off-by: H. Peter Anvin +Cc: Dave Hansen +Link: http://lkml.kernel.org/r/CAE9FiQVn6_QZi3fNQ-JHYiR-7jeDJ5hT0SyT_%2BzVvfOj=PzF3w@mail.gmail.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/mm/numa.c | 29 +++++++++++------------------ + 1 file changed, 11 insertions(+), 18 deletions(-) + +--- a/arch/x86/mm/numa.c ++++ b/arch/x86/mm/numa.c +@@ -193,7 +193,6 @@ int __init numa_add_memblk(int nid, u64 + static void __init setup_node_data(int nid, u64 start, u64 end) + { + const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE); +- bool remapped = false; + u64 nd_pa; + void *nd; + int tnid; +@@ -211,28 +210,22 @@ static void __init setup_node_data(int n + nid, start, end - 1); + + /* +- * Allocate node data. Try remap allocator first, node-local +- * memory and then any node. Never allocate in DMA zone. ++ * Allocate node data. Try node-local memory and then any node. ++ * Never allocate in DMA zone. + */ +- nd = alloc_remap(nid, nd_size); +- if (nd) { +- nd_pa = __pa(nd); +- remapped = true; +- } else { +- nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid); +- if (!nd_pa) { +- pr_err("Cannot find %zu bytes in node %d\n", +- nd_size, nid); +- return; +- } +- nd = __va(nd_pa); ++ nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid); ++ if (!nd_pa) { ++ pr_err("Cannot find %zu bytes in node %d\n", ++ nd_size, nid); ++ return; + } ++ nd = __va(nd_pa); + + /* report and initialize */ +- printk(KERN_INFO " NODE_DATA [mem %#010Lx-%#010Lx]%s\n", +- nd_pa, nd_pa + nd_size - 1, remapped ? " (remapped)" : ""); ++ printk(KERN_INFO " NODE_DATA [mem %#010Lx-%#010Lx]\n", ++ nd_pa, nd_pa + nd_size - 1); + tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); +- if (!remapped && tnid != nid) ++ if (tnid != nid) + printk(KERN_INFO " NODE_DATA(%d) on node %d\n", nid, tnid); + + node_data[nid] = nd; diff --git a/queue-3.8/x86-32-mm-remove-reference-to-resume_map_numa_kva.patch b/queue-3.8/x86-32-mm-remove-reference-to-resume_map_numa_kva.patch new file mode 100644 index 00000000000..28e9b7f7d8b --- /dev/null +++ b/queue-3.8/x86-32-mm-remove-reference-to-resume_map_numa_kva.patch @@ -0,0 +1,47 @@ +From bb112aec5ee41427e9b9726e3d57b896709598ed Mon Sep 17 00:00:00 2001 +From: "H. Peter Anvin" +Date: Thu, 31 Jan 2013 13:53:10 -0800 +Subject: x86-32, mm: Remove reference to resume_map_numa_kva() + +From: "H. Peter Anvin" + +commit bb112aec5ee41427e9b9726e3d57b896709598ed upstream. + +Remove reference to removed function resume_map_numa_kva(). + +Signed-off-by: H. Peter Anvin +Cc: Dave Hansen +Link: http://lkml.kernel.org/r/20130131005616.1C79F411@kernel.stglabs.ibm.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/mmzone_32.h | 6 ------ + arch/x86/power/hibernate_32.c | 2 -- + 2 files changed, 8 deletions(-) + +--- a/arch/x86/include/asm/mmzone_32.h ++++ b/arch/x86/include/asm/mmzone_32.h +@@ -14,12 +14,6 @@ extern struct pglist_data *node_data[]; + + #include + +-extern void resume_map_numa_kva(pgd_t *pgd); +- +-#else /* !CONFIG_NUMA */ +- +-static inline void resume_map_numa_kva(pgd_t *pgd) {} +- + #endif /* CONFIG_NUMA */ + + #ifdef CONFIG_DISCONTIGMEM +--- a/arch/x86/power/hibernate_32.c ++++ b/arch/x86/power/hibernate_32.c +@@ -129,8 +129,6 @@ static int resume_physical_mapping_init( + } + } + +- resume_map_numa_kva(pgd_base); +- + return 0; + } + diff --git a/queue-3.8/x86-32-mm-rip-out-x86_32-numa-remapping-code.patch b/queue-3.8/x86-32-mm-rip-out-x86_32-numa-remapping-code.patch new file mode 100644 index 00000000000..52cfe90d662 --- /dev/null +++ b/queue-3.8/x86-32-mm-rip-out-x86_32-numa-remapping-code.patch @@ -0,0 +1,265 @@ +From f03574f2d5b2d6229dcdf2d322848065f72953c7 Mon Sep 17 00:00:00 2001 +From: Dave Hansen +Date: Wed, 30 Jan 2013 16:56:16 -0800 +Subject: x86-32, mm: Rip out x86_32 NUMA remapping code + +From: Dave Hansen + +commit f03574f2d5b2d6229dcdf2d322848065f72953c7 upstream. + +This code was an optimization for 32-bit NUMA systems. + +It has probably been the cause of a number of subtle bugs over +the years, although the conditions to excite them would have +been hard to trigger. Essentially, we remap part of the kernel +linear mapping area, and then sometimes part of that area gets +freed back in to the bootmem allocator. If those pages get +used by kernel data structures (say mem_map[] or a dentry), +there's no big deal. But, if anyone ever tried to use the +linear mapping for these pages _and_ cared about their physical +address, bad things happen. + +For instance, say you passed __GFP_ZERO to the page allocator +and then happened to get handed one of these pages, it zero the +remapped page, but it would make a pte to the _old_ page. +There are probably a hundred other ways that it could screw +with things. + +We don't need to hang on to performance optimizations for +these old boxes any more. All my 32-bit NUMA systems are long +dead and buried, and I probably had access to more than most +people. + +This code is causing real things to break today: + + https://lkml.org/lkml/2013/1/9/376 + +I looked in to actually fixing this, but it requires surgery +to way too much brittle code, as well as stuff like +per_cpu_ptr_to_phys(). + +[ hpa: Cc: this for -stable, since it is a memory corruption issue. + However, an alternative is to simply mark NUMA as depends BROKEN + rather than EXPERIMENTAL in the X86_32 subclause... ] + +Link: http://lkml.kernel.org/r/20130131005616.1C79F411@kernel.stglabs.ibm.com +Signed-off-by: H. Peter Anvin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/Kconfig | 4 - + arch/x86/mm/numa.c | 3 + arch/x86/mm/numa_32.c | 161 -------------------------------------------- + arch/x86/mm/numa_internal.h | 6 - + 4 files changed, 174 deletions(-) + +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1253,10 +1253,6 @@ config NODES_SHIFT + Specify the maximum number of NUMA Nodes available on the target + system. Increases memory reserved to accommodate various tables. + +-config HAVE_ARCH_ALLOC_REMAP +- def_bool y +- depends on X86_32 && NUMA +- + config ARCH_HAVE_MEMORY_PRESENT + def_bool y + depends on X86_32 && DISCONTIGMEM +--- a/arch/x86/mm/numa.c ++++ b/arch/x86/mm/numa.c +@@ -205,9 +205,6 @@ static void __init setup_node_data(int n + if (end && (end - start) < NODE_MIN_SIZE) + return; + +- /* initialize remap allocator before aligning to ZONE_ALIGN */ +- init_alloc_remap(nid, start, end); +- + start = roundup(start, ZONE_ALIGN); + + printk(KERN_INFO "Initmem setup node %d [mem %#010Lx-%#010Lx]\n", +--- a/arch/x86/mm/numa_32.c ++++ b/arch/x86/mm/numa_32.c +@@ -73,167 +73,6 @@ unsigned long node_memmap_size_bytes(int + + extern unsigned long highend_pfn, highstart_pfn; + +-#define LARGE_PAGE_BYTES (PTRS_PER_PTE * PAGE_SIZE) +- +-static void *node_remap_start_vaddr[MAX_NUMNODES]; +-void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags); +- +-/* +- * Remap memory allocator +- */ +-static unsigned long node_remap_start_pfn[MAX_NUMNODES]; +-static void *node_remap_end_vaddr[MAX_NUMNODES]; +-static void *node_remap_alloc_vaddr[MAX_NUMNODES]; +- +-/** +- * alloc_remap - Allocate remapped memory +- * @nid: NUMA node to allocate memory from +- * @size: The size of allocation +- * +- * Allocate @size bytes from the remap area of NUMA node @nid. The +- * size of the remap area is predetermined by init_alloc_remap() and +- * only the callers considered there should call this function. For +- * more info, please read the comment on top of init_alloc_remap(). +- * +- * The caller must be ready to handle allocation failure from this +- * function and fall back to regular memory allocator in such cases. +- * +- * CONTEXT: +- * Single CPU early boot context. +- * +- * RETURNS: +- * Pointer to the allocated memory on success, %NULL on failure. +- */ +-void *alloc_remap(int nid, unsigned long size) +-{ +- void *allocation = node_remap_alloc_vaddr[nid]; +- +- size = ALIGN(size, L1_CACHE_BYTES); +- +- if (!allocation || (allocation + size) > node_remap_end_vaddr[nid]) +- return NULL; +- +- node_remap_alloc_vaddr[nid] += size; +- memset(allocation, 0, size); +- +- return allocation; +-} +- +-#ifdef CONFIG_HIBERNATION +-/** +- * resume_map_numa_kva - add KVA mapping to the temporary page tables created +- * during resume from hibernation +- * @pgd_base - temporary resume page directory +- */ +-void resume_map_numa_kva(pgd_t *pgd_base) +-{ +- int node; +- +- for_each_online_node(node) { +- unsigned long start_va, start_pfn, nr_pages, pfn; +- +- start_va = (unsigned long)node_remap_start_vaddr[node]; +- start_pfn = node_remap_start_pfn[node]; +- nr_pages = (node_remap_end_vaddr[node] - +- node_remap_start_vaddr[node]) >> PAGE_SHIFT; +- +- printk(KERN_DEBUG "%s: node %d\n", __func__, node); +- +- for (pfn = 0; pfn < nr_pages; pfn += PTRS_PER_PTE) { +- unsigned long vaddr = start_va + (pfn << PAGE_SHIFT); +- pgd_t *pgd = pgd_base + pgd_index(vaddr); +- pud_t *pud = pud_offset(pgd, vaddr); +- pmd_t *pmd = pmd_offset(pud, vaddr); +- +- set_pmd(pmd, pfn_pmd(start_pfn + pfn, +- PAGE_KERNEL_LARGE_EXEC)); +- +- printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n", +- __func__, vaddr, start_pfn + pfn); +- } +- } +-} +-#endif +- +-/** +- * init_alloc_remap - Initialize remap allocator for a NUMA node +- * @nid: NUMA node to initizlie remap allocator for +- * +- * NUMA nodes may end up without any lowmem. As allocating pgdat and +- * memmap on a different node with lowmem is inefficient, a special +- * remap allocator is implemented which can be used by alloc_remap(). +- * +- * For each node, the amount of memory which will be necessary for +- * pgdat and memmap is calculated and two memory areas of the size are +- * allocated - one in the node and the other in lowmem; then, the area +- * in the node is remapped to the lowmem area. +- * +- * As pgdat and memmap must be allocated in lowmem anyway, this +- * doesn't waste lowmem address space; however, the actual lowmem +- * which gets remapped over is wasted. The amount shouldn't be +- * problematic on machines this feature will be used. +- * +- * Initialization failure isn't fatal. alloc_remap() is used +- * opportunistically and the callers will fall back to other memory +- * allocation mechanisms on failure. +- */ +-void __init init_alloc_remap(int nid, u64 start, u64 end) +-{ +- unsigned long start_pfn = start >> PAGE_SHIFT; +- unsigned long end_pfn = end >> PAGE_SHIFT; +- unsigned long size, pfn; +- u64 node_pa, remap_pa; +- void *remap_va; +- +- /* +- * The acpi/srat node info can show hot-add memroy zones where +- * memory could be added but not currently present. +- */ +- printk(KERN_DEBUG "node %d pfn: [%lx - %lx]\n", +- nid, start_pfn, end_pfn); +- +- /* calculate the necessary space aligned to large page size */ +- size = node_memmap_size_bytes(nid, start_pfn, end_pfn); +- size += ALIGN(sizeof(pg_data_t), PAGE_SIZE); +- size = ALIGN(size, LARGE_PAGE_BYTES); +- +- /* allocate node memory and the lowmem remap area */ +- node_pa = memblock_find_in_range(start, end, size, LARGE_PAGE_BYTES); +- if (!node_pa) { +- pr_warning("remap_alloc: failed to allocate %lu bytes for node %d\n", +- size, nid); +- return; +- } +- memblock_reserve(node_pa, size); +- +- remap_pa = memblock_find_in_range(min_low_pfn << PAGE_SHIFT, +- max_low_pfn << PAGE_SHIFT, +- size, LARGE_PAGE_BYTES); +- if (!remap_pa) { +- pr_warning("remap_alloc: failed to allocate %lu bytes remap area for node %d\n", +- size, nid); +- memblock_free(node_pa, size); +- return; +- } +- memblock_reserve(remap_pa, size); +- remap_va = phys_to_virt(remap_pa); +- +- /* perform actual remap */ +- for (pfn = 0; pfn < size >> PAGE_SHIFT; pfn += PTRS_PER_PTE) +- set_pmd_pfn((unsigned long)remap_va + (pfn << PAGE_SHIFT), +- (node_pa >> PAGE_SHIFT) + pfn, +- PAGE_KERNEL_LARGE); +- +- /* initialize remap allocator parameters */ +- node_remap_start_pfn[nid] = node_pa >> PAGE_SHIFT; +- node_remap_start_vaddr[nid] = remap_va; +- node_remap_end_vaddr[nid] = remap_va + size; +- node_remap_alloc_vaddr[nid] = remap_va; +- +- printk(KERN_DEBUG "remap_alloc: node %d [%08llx-%08llx) -> [%p-%p)\n", +- nid, node_pa, node_pa + size, remap_va, remap_va + size); +-} +- + void __init initmem_init(void) + { + x86_numa_init(); +--- a/arch/x86/mm/numa_internal.h ++++ b/arch/x86/mm/numa_internal.h +@@ -21,12 +21,6 @@ void __init numa_reset_distance(void); + + void __init x86_numa_init(void); + +-#ifdef CONFIG_X86_64 +-static inline void init_alloc_remap(int nid, u64 start, u64 end) { } +-#else +-void __init init_alloc_remap(int nid, u64 start, u64 end); +-#endif +- + #ifdef CONFIG_NUMA_EMU + void __init numa_emulation(struct numa_meminfo *numa_meminfo, + int numa_dist_cnt);