From 5b7edd76a97e43f6e6e0c386c4edbd138807e44b Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Sun, 22 Feb 2009 16:25:45 +0000 Subject: [PATCH] --- yaml --- r: 138519 b: refs/heads/master c: 2657dd4e301d4841ed67a4fac7d145ad8f3e1b28 h: refs/heads/master i: 138517: 8fd896ea242b0580acacc26661b036f61973c5ba 138515: 46ec398c1e1c26cf65975a651dc074574d19f9fd 138511: f1f52d1c39e6bc66c51f3f40b16ec166c121e1bf v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/cputable.c | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 0d520fa61629..6f0dadc63787 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 666435bbf31bfc2aec2afccb2fb54951e573c5c1 +refs/heads/master: 2657dd4e301d4841ed67a4fac7d145ad8f3e1b28 diff --git a/trunk/arch/powerpc/kernel/cputable.c b/trunk/arch/powerpc/kernel/cputable.c index 401f973a74a0..638838691b20 100644 --- a/trunk/arch/powerpc/kernel/cputable.c +++ b/trunk/arch/powerpc/kernel/cputable.c @@ -1788,22 +1788,27 @@ static struct cpu_spec the_cpu_spec; static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s) { struct cpu_spec *t = &the_cpu_spec; + struct cpu_spec old; + t = PTRRELOC(t); + old = *t; + + /* Copy everything, then do fixups */ + *t = *s; /* * If we are overriding a previous value derived from the real * PVR with a new value obtained using a logical PVR value, * don't modify the performance monitor fields. */ - if (t->num_pmcs && !s->num_pmcs) { - t->cpu_name = s->cpu_name; - t->cpu_features = s->cpu_features; - t->cpu_user_features = s->cpu_user_features; - t->icache_bsize = s->icache_bsize; - t->dcache_bsize = s->dcache_bsize; - t->cpu_setup = s->cpu_setup; - t->cpu_restore = s->cpu_restore; - t->platform = s->platform; + if (old.num_pmcs && !s->num_pmcs) { + t->num_pmcs = old.num_pmcs; + t->pmc_type = old.pmc_type; + t->oprofile_type = old.oprofile_type; + t->oprofile_mmcra_sihv = old.oprofile_mmcra_sihv; + t->oprofile_mmcra_sipr = old.oprofile_mmcra_sipr; + t->oprofile_mmcra_clear = old.oprofile_mmcra_clear; + /* * If we have passed through this logic once before and * have pulled the default case because the real PVR was @@ -1817,10 +1822,9 @@ static void __init setup_cpu_spec(unsigned long offset, struct cpu_spec *s) * and, in that case, keep the current value for * oprofile_cpu_type. */ - if (t->oprofile_cpu_type == NULL) + if (old.oprofile_cpu_type == NULL) t->oprofile_cpu_type = s->oprofile_cpu_type; - } else - *t = *s; + } *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;