summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-08-02 07:53:01 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2016-08-03 07:43:16 +0200
commit2c0f99516f53911c3f2f81ab3815841e3408f11e (patch)
treef1524958025ff017635b04b87c2b152ab1e7c698 /arch/powerpc
parentpowerpc/ptrace: Enable support for Performance Monitor registers (diff)
downloadlinux-2c0f99516f53911c3f2f81ab3815841e3408f11e.tar.xz
linux-2c0f99516f53911c3f2f81ab3815841e3408f11e.zip
powerpc/32: Fix early access to cpu_spec relocation
Commit 9402c6846131 ("powerpc: Factor do_feature_fixup calls") introduced a subtle bug on 32-bit. When reading the cpu spec from the global, we not only need to do a pointer relocation on the global address but also on the pointer we read from it. This fixes crashes reported on MPC5200 based machines. Fixes: 9402c6846131 ("powerpc: Factor do_feature_fixup calls") Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/lib/feature-fixups.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 077fa0ce3382..74145f02ad41 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -161,7 +161,7 @@ static unsigned long __initdata saved_firmware_features;
void __init apply_feature_fixups(void)
{
- struct cpu_spec *spec = *PTRRELOC(&cur_cpu_spec);
+ struct cpu_spec *spec = PTRRELOC(*PTRRELOC(&cur_cpu_spec));
*PTRRELOC(&saved_cpu_features) = spec->cpu_features;
*PTRRELOC(&saved_mmu_features) = spec->mmu_features;