Skip to content

Commit 96f59fe

Browse files
KAGA-KOKOsuryasaimadhu
authored andcommitted
x86/tlb: Move cr4_set_bits_and_update_boot() to the usage site
No point in having this exposed. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 69de6c1 commit 96f59fe

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

arch/x86/include/asm/tlbflush.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -322,23 +322,9 @@ static inline void cr4_clear_bits(unsigned long mask)
322322
local_irq_restore(flags);
323323
}
324324

325-
/*
326-
* Save some of cr4 feature set we're using (e.g. Pentium 4MB
327-
* enable and PPro Global page enable), so that any CPU's that boot
328-
* up after us can get the correct flags. This should only be used
329-
* during boot on the boot cpu.
330-
*/
331325
extern unsigned long mmu_cr4_features;
332326
extern u32 *trampoline_cr4_features;
333327

334-
static inline void cr4_set_bits_and_update_boot(unsigned long mask)
335-
{
336-
mmu_cr4_features |= mask;
337-
if (trampoline_cr4_features)
338-
*trampoline_cr4_features = mmu_cr4_features;
339-
cr4_set_bits(mask);
340-
}
341-
342328
extern void initialize_tlbstate_and_flush(void);
343329

344330
#define TLB_FLUSH_ALL -1UL

arch/x86/mm/init.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,19 @@ struct map_range {
194194

195195
static int page_size_mask;
196196

197+
/*
198+
* Save some of cr4 feature set we're using (e.g. Pentium 4MB
199+
* enable and PPro Global page enable), so that any CPU's that boot
200+
* up after us can get the correct flags. Invoked on the boot CPU.
201+
*/
202+
static inline void cr4_set_bits_and_update_boot(unsigned long mask)
203+
{
204+
mmu_cr4_features |= mask;
205+
if (trampoline_cr4_features)
206+
*trampoline_cr4_features = mmu_cr4_features;
207+
cr4_set_bits(mask);
208+
}
209+
197210
static void __init probe_page_size_mask(void)
198211
{
199212
/*

0 commit comments

Comments
 (0)