diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-10-25 02:58:07 +0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-01-09 03:35:07 +0300 |
commit | fc11fcfa557a296d0ecf27b038a71b46b92192d1 (patch) | |
tree | 66c49e686e795613d5205337e4acf5cbfc29e82f /arch/x86/mm/init.c | |
parent | 4d1069cf6e0c9d1cf9de48fff95c3d9f6d2d515e (diff) | |
download | linux-fc11fcfa557a296d0ecf27b038a71b46b92192d1.tar.xz |
x86: Clean up cr4 manipulation
commit 375074cc736ab1d89a708c0a8d7baa4a70d5d476 upstream.
CR4 manipulation was split, seemingly at random, between direct
(write_cr4) and using a helper (set/clear_in_cr4). Unfortunately,
the set_in_cr4 and clear_in_cr4 helpers also poke at the boot code,
which only a small subset of users actually wanted.
This patch replaces all cr4 access in functions that don't leave cr4
exactly the way they found it with new helpers cr4_set_bits,
cr4_clear_bits, and cr4_set_bits_and_update_boot.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Vince Weaver <vince@deater.net>
Cc: "hillf.zj" <hillf.zj@alibaba-inc.com>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/495a10bdc9e67016b8fd3945700d46cfd5c12c2f.1414190806.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/x86/mm/init.c')
-rw-r--r-- | arch/x86/mm/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 89c43a1ce82b..57cd37dc03b8 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -137,11 +137,11 @@ static void __init probe_page_size_mask(void) /* Enable PSE if available */ if (cpu_has_pse) - set_in_cr4(X86_CR4_PSE); + cr4_set_bits_and_update_boot(X86_CR4_PSE); /* Enable PGE if available */ if (cpu_has_pge) { - set_in_cr4(X86_CR4_PGE); + cr4_set_bits_and_update_boot(X86_CR4_PGE); __supported_pte_mask |= _PAGE_GLOBAL; } } |