Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/mm: Convert some slow-path static_cpu_has() callers to boot_cpu_has()

Using static_cpu_has() is pointless on those paths, convert them to the
boot_cpu_has() variant.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20190330112022.28888-5-bp@alien8.de

+5 -5
+2 -2
arch/x86/mm/dump_pagetables.c
··· 577 577 void ptdump_walk_pgd_level_debugfs(struct seq_file *m, pgd_t *pgd, bool user) 578 578 { 579 579 #ifdef CONFIG_PAGE_TABLE_ISOLATION 580 - if (user && static_cpu_has(X86_FEATURE_PTI)) 580 + if (user && boot_cpu_has(X86_FEATURE_PTI)) 581 581 pgd = kernel_to_user_pgdp(pgd); 582 582 #endif 583 583 ptdump_walk_pgd_level_core(m, pgd, false, false); ··· 590 590 pgd_t *pgd = INIT_PGD; 591 591 592 592 if (!(__supported_pte_mask & _PAGE_NX) || 593 - !static_cpu_has(X86_FEATURE_PTI)) 593 + !boot_cpu_has(X86_FEATURE_PTI)) 594 594 return; 595 595 596 596 pr_info("x86/mm: Checking user space page tables\n");
+2 -2
arch/x86/mm/pgtable.c
··· 190 190 * when PTI is enabled. We need them to map the per-process LDT into the 191 191 * user-space page-table. 192 192 */ 193 - #define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \ 193 + #define PREALLOCATED_USER_PMDS (boot_cpu_has(X86_FEATURE_PTI) ? \ 194 194 KERNEL_PGD_PTRS : 0) 195 195 #define MAX_PREALLOCATED_USER_PMDS KERNEL_PGD_PTRS 196 196 ··· 292 292 293 293 #ifdef CONFIG_PAGE_TABLE_ISOLATION 294 294 295 - if (!static_cpu_has(X86_FEATURE_PTI)) 295 + if (!boot_cpu_has(X86_FEATURE_PTI)) 296 296 return; 297 297 298 298 pgdp = kernel_to_user_pgdp(pgdp);
+1 -1
arch/x86/mm/pti.c
··· 626 626 */ 627 627 void __init pti_init(void) 628 628 { 629 - if (!static_cpu_has(X86_FEATURE_PTI)) 629 + if (!boot_cpu_has(X86_FEATURE_PTI)) 630 630 return; 631 631 632 632 pr_info("enabled\n");