aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/mtrr
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/mtrr')
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 307dfbbf4a8e..929739a653d1 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -293,14 +293,24 @@ set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type typ
293 293
294 /* 294 /*
295 * HACK! 295 * HACK!
296 * We use this same function to initialize the mtrrs on boot. 296 *
297 * The state of the boot cpu's mtrrs has been saved, and we want 297 * We use this same function to initialize the mtrrs during boot,
298 * to replicate across all the APs. 298 * resume, runtime cpu online and on an explicit request to set a
299 * If we're doing that @reg is set to something special... 299 * specific MTRR.
300 *
301 * During boot or suspend, the state of the boot cpu's mtrrs has been
302 * saved, and we want to replicate that across all the cpus that come
303 * online (either at the end of boot or resume or during a runtime cpu
304 * online). If we're doing that, @reg is set to something special and on
305 * this cpu we still do mtrr_if->set_all(). During boot/resume, this
306 * is unnecessary if at this point we are still on the cpu that started
307 * the boot/resume sequence. But there is no guarantee that we are still
308 * on the same cpu. So we do mtrr_if->set_all() on this cpu aswell to be
309 * sure that we are in sync with everyone else.
300 */ 310 */
301 if (reg != ~0U) 311 if (reg != ~0U)
302 mtrr_if->set(reg, base, size, type); 312 mtrr_if->set(reg, base, size, type);
303 else if (!mtrr_aps_delayed_init) 313 else
304 mtrr_if->set_all(); 314 mtrr_if->set_all();
305 315
306 /* Wait for the others */ 316 /* Wait for the others */