}
__setup("debugpat", pat_debug_setup);
+/*
+ * FIXME This is a hack to force PAT. Currently always enabled.
+ */
+static int __read_mostly __force_pat = 1;
+
#ifdef CONFIG_X86_PAT
/*
* X86 PAT uses page flags arch_1 and uncached together to keep track of
{
u64 tmp_pat;
+ if (__force_pat)
+ goto force_pat;
+
if (!cpu_has_pat) {
pat_disable("PAT not supported by CPU.");
return;
return;
}
+force_pat:
wrmsrl(MSR_IA32_CR_PAT, pat);
done:
static void pat_ap_init(u64 pat)
{
+ if (__force_pat)
+ goto force_pat;
+
if (!pat_enabled())
return;
panic("x86/PAT: PAT enabled, but not supported by secondary CPU\n");
}
+force_pat:
wrmsrl(MSR_IA32_CR_PAT, pat);
}
u64 pat;
struct cpuinfo_x86 *c = &boot_cpu_data;
+ if (__force_pat) {
+ pr_warn("Force x86 PAT\n");
+ setup_force_cpu_cap(X86_FEATURE_PAT);
+ goto force_pat;
+ }
+
if (!pat_enabled()) {
/*
* No PAT. Emulate the PAT table that corresponds to the two
pat = PAT(0, WB) | PAT(1, WC) | PAT(2, UC_MINUS) | PAT(3, UC) |
PAT(4, WB) | PAT(5, WC) | PAT(6, UC_MINUS) | PAT(7, UC);
} else {
+force_pat:
/*
* Full PAT support. We put WT in slot 7 to improve
* robustness in the presence of errata that might cause