diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 93df76dd60f4..25da1e17815d 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -87,13 +87,6 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs) | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | static void nmi_save_registers(void *dummy) | ||
91 | { | ||
92 | int cpu = smp_processor_id(); | ||
93 | struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu); | ||
94 | nmi_cpu_save_registers(msrs); | ||
95 | } | ||
96 | |||
97 | static void free_msrs(void) | 90 | static void free_msrs(void) |
98 | { | 91 | { |
99 | int i; | 92 | int i; |
@@ -137,6 +130,7 @@ static void nmi_cpu_setup(void *dummy) | |||
137 | { | 130 | { |
138 | int cpu = smp_processor_id(); | 131 | int cpu = smp_processor_id(); |
139 | struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu); | 132 | struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu); |
133 | nmi_cpu_save_registers(msrs); | ||
140 | spin_lock(&oprofilefs_lock); | 134 | spin_lock(&oprofilefs_lock); |
141 | model->setup_ctrs(model, msrs); | 135 | model->setup_ctrs(model, msrs); |
142 | spin_unlock(&oprofilefs_lock); | 136 | spin_unlock(&oprofilefs_lock); |
@@ -182,13 +176,12 @@ static int nmi_setup(void) | |||
182 | } | 176 | } |
183 | 177 | ||
184 | } | 178 | } |
185 | on_each_cpu(nmi_save_registers, NULL, 1); | ||
186 | on_each_cpu(nmi_cpu_setup, NULL, 1); | 179 | on_each_cpu(nmi_cpu_setup, NULL, 1); |
187 | nmi_enabled = 1; | 180 | nmi_enabled = 1; |
188 | return 0; | 181 | return 0; |
189 | } | 182 | } |
190 | 183 | ||
191 | static void nmi_restore_registers(struct op_msrs *msrs) | 184 | static void nmi_cpu_restore_registers(struct op_msrs *msrs) |
192 | { | 185 | { |
193 | struct op_msr *counters = msrs->counters; | 186 | struct op_msr *counters = msrs->counters; |
194 | struct op_msr *controls = msrs->controls; | 187 | struct op_msr *controls = msrs->controls; |
@@ -220,7 +213,7 @@ static void nmi_cpu_shutdown(void *dummy) | |||
220 | apic_write(APIC_LVTERR, v | APIC_LVT_MASKED); | 213 | apic_write(APIC_LVTERR, v | APIC_LVT_MASKED); |
221 | apic_write(APIC_LVTPC, per_cpu(saved_lvtpc, cpu)); | 214 | apic_write(APIC_LVTPC, per_cpu(saved_lvtpc, cpu)); |
222 | apic_write(APIC_LVTERR, v); | 215 | apic_write(APIC_LVTERR, v); |
223 | nmi_restore_registers(msrs); | 216 | nmi_cpu_restore_registers(msrs); |
224 | } | 217 | } |
225 | 218 | ||
226 | static void nmi_shutdown(void) | 219 | static void nmi_shutdown(void) |