diff options
Diffstat (limited to 'arch/i386/oprofile')
-rw-r--r-- | arch/i386/oprofile/nmi_int.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index a7c0783b269a..11b7a51566a8 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c | |||
@@ -154,7 +154,7 @@ static int allocate_msrs(void) | |||
154 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; | 154 | size_t counters_size = sizeof(struct op_msr) * model->num_counters; |
155 | 155 | ||
156 | int i; | 156 | int i; |
157 | for_each_online_cpu(i) { | 157 | for_each_possible_cpu(i) { |
158 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); | 158 | cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); |
159 | if (!cpu_msrs[i].counters) { | 159 | if (!cpu_msrs[i].counters) { |
160 | success = 0; | 160 | success = 0; |
@@ -211,8 +211,14 @@ static int nmi_setup(void) | |||
211 | /* Assume saved/restored counters are the same on all CPUs */ | 211 | /* Assume saved/restored counters are the same on all CPUs */ |
212 | model->fill_in_addresses(&cpu_msrs[0]); | 212 | model->fill_in_addresses(&cpu_msrs[0]); |
213 | for_each_possible_cpu (cpu) { | 213 | for_each_possible_cpu (cpu) { |
214 | if (cpu != 0) | 214 | if (cpu != 0) { |
215 | cpu_msrs[cpu] = cpu_msrs[0]; | 215 | memcpy(cpu_msrs[cpu].counters, cpu_msrs[0].counters, |
216 | sizeof(struct op_msr) * model->num_counters); | ||
217 | |||
218 | memcpy(cpu_msrs[cpu].controls, cpu_msrs[0].controls, | ||
219 | sizeof(struct op_msr) * model->num_controls); | ||
220 | } | ||
221 | |||
216 | } | 222 | } |
217 | on_each_cpu(nmi_save_registers, NULL, 0, 1); | 223 | on_each_cpu(nmi_save_registers, NULL, 0, 1); |
218 | on_each_cpu(nmi_cpu_setup, NULL, 0, 1); | 224 | on_each_cpu(nmi_cpu_setup, NULL, 0, 1); |