Skip to content

Commit ebd3ad6

Browse files
bp3tk0vIngo Molnar
authored andcommitted
x86/cpu: Use cpu_feature_enabled() when checking global pages support
X86_FEATURE_PGE determines whether the CPU has enabled global page translations support. Use the faster cpu_feature_enabled() check to shave off some more cycles when flushing all TLB entries, including the global ones. What this practically saves is: mov 0x82eb308(%rip),%rax # 0xffffffff8935bec8 <boot_cpu_data+40> test $0x20,%ah ... which test the bit. Not a lot, but TLB flushing is a timing-sensitive path, so anything to make it even faster. No functional changes. Signed-off-by: Borislav Petkov (AMD) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2241ab5 commit ebd3ad6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/mm/tlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ void __flush_tlb_all(void)
12051205
*/
12061206
VM_WARN_ON_ONCE(preemptible());
12071207

1208-
if (boot_cpu_has(X86_FEATURE_PGE)) {
1208+
if (cpu_feature_enabled(X86_FEATURE_PGE)) {
12091209
__flush_tlb_global();
12101210
} else {
12111211
/*

0 commit comments

Comments
 (0)