diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-10 17:08:52 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-10 17:08:52 -0700 |
commit | 034fa8e8cf3ba07a8bea5d16afbded707d30e2ed (patch) | |
tree | a7d75ea521bda885ccf180dabe0b5ea18c1118c3 | |
parent | b1112ce7b98d9490b8ea049a08f0da2bc5d9cb62 (diff) | |
download | stable-queue-034fa8e8cf3ba07a8bea5d16afbded707d30e2ed.tar.gz |
3.0 patches
4 files changed, 175 insertions, 0 deletions
diff --git a/queue-3.0/powerpc-fix-device-tree-claim-code.patch b/queue-3.0/powerpc-fix-device-tree-claim-code.patch new file mode 100644 index 0000000000..8365f54a1f --- /dev/null +++ b/queue-3.0/powerpc-fix-device-tree-claim-code.patch @@ -0,0 +1,65 @@ +From 966728dd88b4026ec58fee169ccceaeaf56ef120 Mon Sep 17 00:00:00 2001 +From: Anton Blanchard <anton@samba.org> +Date: Mon, 25 Jul 2011 20:47:07 +0000 +Subject: powerpc: Fix device tree claim code + +From: Anton Blanchard <anton@samba.org> + +commit 966728dd88b4026ec58fee169ccceaeaf56ef120 upstream. + +I have a box that fails in OF during boot with: + +DEFAULT CATCH!, exception-handler=fff00400 +at %SRR0: 49424d2c4c6f6768 %SRR1: 800000004000b002 + +ie "IBM,Logh". OF got corrupted with a device tree string. + +Looking at make_room and alloc_up, we claim the first chunk (1 MB) +but we never claim any more. mem_end is always set to alloc_top +which is the top of our available address space, guaranteeing we will +never call alloc_up and claim more memory. + +Also alloc_up wasn't setting alloc_bottom to the bottom of the +available address space. + +This doesn't help the box to boot, but we at least fail with +an obvious error. We could relocate the device tree in a future +patch. + +Signed-off-by: Anton Blanchard <anton@samba.org> +Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/powerpc/kernel/prom_init.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/arch/powerpc/kernel/prom_init.c ++++ b/arch/powerpc/kernel/prom_init.c +@@ -1020,7 +1020,7 @@ static unsigned long __init alloc_up(uns + } + if (addr == 0) + return 0; +- RELOC(alloc_bottom) = addr; ++ RELOC(alloc_bottom) = addr + size; + + prom_debug(" -> %x\n", addr); + prom_debug(" alloc_bottom : %x\n", RELOC(alloc_bottom)); +@@ -1834,7 +1834,7 @@ static void __init *make_room(unsigned l + chunk = alloc_up(room, 0); + if (chunk == 0) + prom_panic("No memory for flatten_device_tree (claim failed)"); +- *mem_end = RELOC(alloc_top); ++ *mem_end = chunk + room; + } + + ret = (void *)*mem_start; +@@ -2053,7 +2053,7 @@ static void __init flatten_device_tree(v + mem_start = (unsigned long)alloc_up(room, PAGE_SIZE); + if (mem_start == 0) + prom_panic("Can't allocate initial device-tree chunk\n"); +- mem_end = RELOC(alloc_top); ++ mem_end = mem_start + room; + + /* Get root of tree */ + root = call_prom("peer", 1, 1, (phandle)0); diff --git a/queue-3.0/powerpc-pseries-fix-kexec-on-machines-with-more-than-4tb-of-ram.patch b/queue-3.0/powerpc-pseries-fix-kexec-on-machines-with-more-than-4tb-of-ram.patch new file mode 100644 index 0000000000..2041e42ecc --- /dev/null +++ b/queue-3.0/powerpc-pseries-fix-kexec-on-machines-with-more-than-4tb-of-ram.patch @@ -0,0 +1,33 @@ +From bed9a31527af8ff3dfbad62a1a42815cef4baab7 Mon Sep 17 00:00:00 2001 +From: Anton Blanchard <anton@samba.org> +Date: Tue, 26 Jul 2011 18:15:03 +0000 +Subject: powerpc: pseries: Fix kexec on machines with more than 4TB of RAM + +From: Anton Blanchard <anton@samba.org> + +commit bed9a31527af8ff3dfbad62a1a42815cef4baab7 upstream. + +On a box with 8TB of RAM the MMU hashtable is 64GB in size. That +means we have 4G PTEs. pSeries_lpar_hptab_clear was using a signed +int to store the index which will overflow at 2G. + +Signed-off-by: Anton Blanchard <anton@samba.org> +Acked-by: Michael Neuling <mikey@neuling.org> +Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/powerpc/platforms/pseries/lpar.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/platforms/pseries/lpar.c ++++ b/arch/powerpc/platforms/pseries/lpar.c +@@ -395,7 +395,7 @@ static void pSeries_lpar_hptab_clear(voi + unsigned long ptel; + } ptes[4]; + long lpar_rc; +- int i, j; ++ unsigned long i, j; + + /* Read in batches of 4, + * invalidate only valid entries not in the VRMA diff --git a/queue-3.0/powerpc-pseries-fix-kexec-on-recent-firmware-versions.patch b/queue-3.0/powerpc-pseries-fix-kexec-on-recent-firmware-versions.patch new file mode 100644 index 0000000000..99a226507d --- /dev/null +++ b/queue-3.0/powerpc-pseries-fix-kexec-on-recent-firmware-versions.patch @@ -0,0 +1,74 @@ +From b1301797f30370c430244979671978fc232f4533 Mon Sep 17 00:00:00 2001 +From: Anton Blanchard <anton@samba.org> +Date: Mon, 25 Jul 2011 01:46:32 +0000 +Subject: powerpc/pseries: Fix kexec on recent firmware versions + +From: Anton Blanchard <anton@samba.org> + +commit b1301797f30370c430244979671978fc232f4533 upstream. + +Recent versions of firmware will fail to unmap the virtual processor +area if we have a dispatch trace log registered. This causes kexec +to fail. + +If a trace log is registered this patch unregisters it before the +SLB shadow and virtual processor areas, fixing the problem. + +The address argument is ignored by firmware on unregister so we +may as well remove it. + +Signed-off-by: Anton Blanchard <anton@samba.org> +Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + arch/powerpc/platforms/pseries/dtl.c | 2 +- + arch/powerpc/platforms/pseries/kexec.c | 11 +++++++++++ + arch/powerpc/platforms/pseries/plpar_wrappers.h | 4 ++-- + 3 files changed, 14 insertions(+), 3 deletions(-) + +--- a/arch/powerpc/platforms/pseries/dtl.c ++++ b/arch/powerpc/platforms/pseries/dtl.c +@@ -181,7 +181,7 @@ static void dtl_stop(struct dtl *dtl) + + lppaca_of(dtl->cpu).dtl_enable_mask = 0x0; + +- unregister_dtl(hwcpu, __pa(dtl->buf)); ++ unregister_dtl(hwcpu); + } + + static u64 dtl_current_index(struct dtl *dtl) +--- a/arch/powerpc/platforms/pseries/kexec.c ++++ b/arch/powerpc/platforms/pseries/kexec.c +@@ -26,6 +26,17 @@ static void pseries_kexec_cpu_down(int c + /* Don't risk a hypervisor call if we're crashing */ + if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { + unsigned long addr; ++ int ret; ++ ++ if (get_lppaca()->dtl_enable_mask) { ++ ret = unregister_dtl(hard_smp_processor_id()); ++ if (ret) { ++ pr_err("WARNING: DTL deregistration for cpu " ++ "%d (hw %d) failed with %d\n", ++ smp_processor_id(), ++ hard_smp_processor_id(), ret); ++ } ++ } + + addr = __pa(get_slb_shadow()); + if (unregister_slb_shadow(hard_smp_processor_id(), addr)) +--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h ++++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h +@@ -73,9 +73,9 @@ static inline long register_slb_shadow(u + return vpa_call(0x3, cpu, vpa); + } + +-static inline long unregister_dtl(unsigned long cpu, unsigned long vpa) ++static inline long unregister_dtl(unsigned long cpu) + { +- return vpa_call(0x6, cpu, vpa); ++ return vpa_call(0x6, cpu, 0); + } + + static inline long register_dtl(unsigned long cpu, unsigned long vpa) diff --git a/queue-3.0/series b/queue-3.0/series index 7374fcb7bd..b8bc5b52af 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -76,3 +76,6 @@ sparc-size-mondo-queues-more-sanely.patch sparc-fix-build-with-debug_pagealloc-enabled.patch ecryptfs-add-mount-option-to-check-uid-of-device-being.patch ecryptfs-return-error-when-lower-file-pointer-is-null.patch +powerpc-pseries-fix-kexec-on-recent-firmware-versions.patch +powerpc-fix-device-tree-claim-code.patch +powerpc-pseries-fix-kexec-on-machines-with-more-than-4tb-of-ram.patch |