summaryrefslogtreecommitdiff
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorBorislav Petkov (AMD) <bp@alien8.de>2023-01-25 10:50:13 +0300
committerIngo Molnar <mingo@kernel.org>2023-01-25 12:32:06 +0300
commitebd3ad60a688131de7df1dd05fd2d7c57f542268 (patch)
treed8bf8866cd972dac8a3a8aa5654b171de8ba7010 /arch/x86/mm
parent2241ab53cbb5cdb08a6b2d4688feb13971058f65 (diff)
downloadlinux-ebd3ad60a688131de7df1dd05fd2d7c57f542268.tar.xz
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) <bp@alien8.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230125075013.9292-1-bp@alien8.de
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/tlb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index c1e31e9a85d7..92d73ccede70 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -1205,7 +1205,7 @@ void __flush_tlb_all(void)
*/
VM_WARN_ON_ONCE(preemptible());
- if (boot_cpu_has(X86_FEATURE_PGE)) {
+ if (cpu_feature_enabled(X86_FEATURE_PGE)) {
__flush_tlb_global();
} else {
/*