x86/cpu: Use cpu_feature_enabled() when checking global pages support
Borislav Petkov
maintainerPATCH 1/1 x86/cpu: Use cpu_feature_enabled() when checking global pages support
From: "Borislav Petkov (AMD)" <[email protected]>
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.
--- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
@@ -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 {/*
Signature · 1 line
2.35.1
The following commit has been merged into the x86/mm branch of tip:
The following commit has been merged into the x86/mm branch of tip:
Commit-ID: ebd3ad60a688131de7df1dd05fd2d7c57f542268 Gitweb: https://git.kernel.org/tip/ebd3ad60a688131de7df1dd05fd2d7c57f542268 Author: Borislav Petkov (AMD) <[email protected]> AuthorDate: Wed, 25 Jan 2023 08:50:13 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 25 Jan 2023 10:32:06 +01:00
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.
--- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
@@ -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 {/*