]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/tlb: Move cr4_set_bits_and_update_boot() to the usage site
authorThomas Gleixner <tglx@linutronix.de>
Tue, 21 Apr 2020 09:20:39 +0000 (11:20 +0200)
committerBorislav Petkov <bp@suse.de>
Sun, 26 Apr 2020 16:39:48 +0000 (18:39 +0200)
No point in having this exposed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200421092559.940978251@linutronix.de
arch/x86/include/asm/tlbflush.h
arch/x86/mm/init.c

index c22fc72c126ddf63791b0b49486386afa8344188..917deea058d50d1d542fec604596cff3ac3cf521 100644 (file)
@@ -322,23 +322,9 @@ static inline void cr4_clear_bits(unsigned long mask)
        local_irq_restore(flags);
 }
 
-/*
- * Save some of cr4 feature set we're using (e.g.  Pentium 4MB
- * enable and PPro Global page enable), so that any CPU's that boot
- * up after us can get the correct flags.  This should only be used
- * during boot on the boot cpu.
- */
 extern unsigned long mmu_cr4_features;
 extern u32 *trampoline_cr4_features;
 
-static inline void cr4_set_bits_and_update_boot(unsigned long mask)
-{
-       mmu_cr4_features |= mask;
-       if (trampoline_cr4_features)
-               *trampoline_cr4_features = mmu_cr4_features;
-       cr4_set_bits(mask);
-}
-
 extern void initialize_tlbstate_and_flush(void);
 
 #define TLB_FLUSH_ALL  -1UL
index 71720dd8f28ada6c3e5cd7f1628d727019ae6e59..d37e8164022e53fa9f6a6c99226eefdeead2d9fa 100644 (file)
@@ -194,6 +194,19 @@ struct map_range {
 
 static int page_size_mask;
 
+/*
+ * Save some of cr4 feature set we're using (e.g.  Pentium 4MB
+ * enable and PPro Global page enable), so that any CPU's that boot
+ * up after us can get the correct flags. Invoked on the boot CPU.
+ */
+static inline void cr4_set_bits_and_update_boot(unsigned long mask)
+{
+       mmu_cr4_features |= mask;
+       if (trampoline_cr4_features)
+               *trampoline_cr4_features = mmu_cr4_features;
+       cr4_set_bits(mask);
+}
+
 static void __init probe_page_size_mask(void)
 {
        /*