aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pat.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r--arch/x86/mm/pat.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index b4663885308f..1cc1d37f1de7 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -40,11 +40,22 @@
40static bool boot_cpu_done; 40static bool boot_cpu_done;
41 41
42static int __read_mostly __pat_enabled = IS_ENABLED(CONFIG_X86_PAT); 42static int __read_mostly __pat_enabled = IS_ENABLED(CONFIG_X86_PAT);
43static void init_cache_modes(void);
43 44
44static inline void pat_disable(const char *reason) 45void pat_disable(const char *reason)
45{ 46{
47 if (!__pat_enabled)
48 return;
49
50 if (boot_cpu_done) {
51 WARN_ONCE(1, "x86/PAT: PAT cannot be disabled after initialization\n");
52 return;
53 }
54
46 __pat_enabled = 0; 55 __pat_enabled = 0;
47 pr_info("x86/PAT: %s\n", reason); 56 pr_info("x86/PAT: %s\n", reason);
57
58 init_cache_modes();
48} 59}
49 60
50static int __init nopat(char *str) 61static int __init nopat(char *str)