x86/cleanups changes for v4.5
Subsystems (10)
Linus,
Please pull the latest x86-cleanups-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-cleanups-for-linus
# HEAD: 0105c8d8334fc941e0297ca6708fa57854114c0e arch/x86/kernel/ptrace.c: Remove unused arg_offs_table
The main changes in this cycle were:
- code patching and cpu_has cleanups (Borislav Petkov)
- paravirt cleanups (Juergen Gross)
- TSC cleanup (Thomas Gleixner)
- ptrace cleanup (Chen Gang)
out-of-topic modifications in x86-cleanups-for-linus:
-------------------------------------------------------
drivers/char/hw_random/via-rng.c # 362f924b64ba: x86/cpufeature: Remove unuse drivers/crypto/padlock-aes.c # 362f924b64ba: x86/cpufeature: Remove unuse drivers/crypto/padlock-sha.c # 362f924b64ba: x86/cpufeature: Remove unuse
drivers/iommu/intel_irq_remapping.c# 362f924b64ba: x86/cpufeature: Remove unuse
fs/btrfs/disk-io.c # 362f924b64ba: x86/cpufeature: Remove unuse
Thanks,
Ingo
------------------>
Borislav Petkov (6):
x86/paravirt: Kill some unused patching functions x86/cpufeature: Move some of the scattered feature bits to x86_capability x86/cpufeature: Cleanup get_cpu_cap()
x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros x86/cpu: Provide a config option to disable static_cpu_has x86/mm: Align macro defines
Juergen Gross (3):
x86: Remove unused function cpu_has_ht_siblings() x86/paravirt: Remove unused pv_apic_ops structure x86/paravirt: Remove paravirt ops pmd_update[_defer] and pte_update_defer
Thomas Gleixner (1):
x86/tsc: Remove unused tsc_pre_init() hook
[email protected] (1):
arch/x86/kernel/ptrace.c: Remove unused arg_offs_table
arch/x86/Kconfig | 11 +++ arch/x86/crypto/chacha20_glue.c | 2 +- arch/x86/crypto/crc32c-intel_glue.c | 2 +- arch/x86/include/asm/cmpxchg_32.h | 2 +- arch/x86/include/asm/cmpxchg_64.h | 2 +- arch/x86/include/asm/cpufeature.h | 115 ++++++++++++++-------------- arch/x86/include/asm/page_types.h | 6 +- arch/x86/include/asm/paravirt.h | 26 ------- arch/x86/include/asm/paravirt_types.h | 18 ----- arch/x86/include/asm/pgtable.h | 15 +--- arch/x86/include/asm/smp.h | 12 --- arch/x86/include/asm/x86_init.h | 2 - arch/x86/include/asm/xor_32.h | 2 +- arch/x86/kernel/cpu/amd.c | 4 +- arch/x86/kernel/cpu/centaur.c | 2 +- arch/x86/kernel/cpu/common.c | 52 +++++++------ arch/x86/kernel/cpu/intel.c | 3 +- arch/x86/kernel/cpu/intel_cacheinfo.c | 6 +- arch/x86/kernel/cpu/mtrr/generic.c | 2 +- arch/x86/kernel/cpu/mtrr/main.c | 2 +- arch/x86/kernel/cpu/perf_event_amd.c | 4 +- arch/x86/kernel/cpu/perf_event_amd_uncore.c | 11 +-- arch/x86/kernel/cpu/scattered.c | 20 ----- arch/x86/kernel/cpu/transmeta.c | 4 +- arch/x86/kernel/fpu/init.c | 4 +- arch/x86/kernel/hw_breakpoint.c | 6 +- arch/x86/kernel/paravirt.c | 24 +----- arch/x86/kernel/ptrace.c | 15 ---- arch/x86/kernel/smpboot.c | 9 +-- arch/x86/kernel/tsc.c | 2 - arch/x86/kernel/vm86_32.c | 4 +- arch/x86/kernel/x86_init.c | 1 - arch/x86/lguest/boot.c | 1 - arch/x86/mm/pgtable.c | 7 +- arch/x86/mm/setup_nx.c | 4 +- arch/x86/xen/enlighten.c | 7 -- arch/x86/xen/mmu.c | 1 - drivers/char/hw_random/via-rng.c | 5 +- drivers/crypto/padlock-aes.c | 2 +- drivers/crypto/padlock-sha.c | 2 +- drivers/iommu/intel_irq_remapping.c | 2 +- fs/btrfs/disk-io.c | 2 +- 42 files changed, 148 insertions(+), 275 deletions(-)
arch/x86/Kconfig +11 -0
@@ -349,6 +349,17 @@ config X86_FEATURE_NAMES If in doubt, say Y. +config X86_FAST_FEATURE_TESTS + bool "Fast CPU feature tests" if EMBEDDED + default y + ---help--- + Some fast-paths in the kernel depend on the capabilities of the CPU. + Say Y here for the kernel to patch in the appropriate code at runtime + based on the capabilities of the CPU. The infrastructure for patching + code at runtime takes up some additional space; space-constrained + embedded systems may wish to say N here to produce smaller, slightly + slower code. + config X86_X2APIC bool "Support x2apic" depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST)
arch/x86/crypto/chacha20_glue.c +1 -1
@@ -125,7 +125,7 @@ static struct crypto_alg alg = {static int __init chacha20_simd_mod_init (void ) { -if (!cpu_has_ssse3) +if (!boot_cpu_has (X86_FEATURE_SSSE3 ))return -ENODEV ;#ifdef CONFIG_AS_AVX2
arch/x86/crypto/crc32c-intel_glue.c +1 -1
@@ -257,7 +257,7 @@ static int __init crc32c_intel_mod_init(void)if (!x86_match_cpu (crc32c_cpu_id))return -ENODEV ;#ifdef CONFIG_X86_64 -if (cpu_has_pclmulqdq) { +if (boot_cpu_has (X86_FEATURE_PCLMULQDQ )) { alg.update = crc32c_pcl_intel_update; alg.finup = crc32c_pcl_intel_finup; alg.digest = crc32c_pcl_intel_digest;
arch/x86/include/asm/cmpxchg_32.h +1 -1
@@ -109,6 +109,6 @@ static inline u64 __cmpxchg64_local(volatile u64 *ptr, u64 old, u64 new)#endif -#define system_has_cmpxchg_double () cpu_has_cx8 +#define system_has_cmpxchg_double () boot_cpu_has(X86_FEATURE_CX8)#endif /* _ASM_X86_CMPXCHG_32_H */
arch/x86/include/asm/cmpxchg_64.h +1 -1
@@ -18,6 +18,6 @@ static inline void set_64bit(volatile u64 *ptr, u64 val)cmpxchg_local ((ptr), (o), (n)); \ }) -#define system_has_cmpxchg_double () cpu_has_cx16 +#define system_has_cmpxchg_double () boot_cpu_has(X86_FEATURE_CX16)#endif /* _ASM_X86_CMPXCHG_64_H */
arch/x86/include/asm/cpufeature.h +58 -57
175 lines not on this page · raw message
arch/x86/include/asm/page_types.h +3 -3
@@ -5,9 +5,9 @@#include <linux/types.h> /* PAGE_SHIFT determines the page size */ -#define PAGE_SHIFT 12 -#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) +#define PAGE_SHIFT 12 +#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE-1))#define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)#define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
arch/x86/include/asm/paravirt.h +0 -26
@@ -285,15 +285,6 @@ static inline void slow_down_io(void)#endif } -#ifdef CONFIG_SMP -static inline void startup_ipi_hook (int phys_apicid,unsigned long start_eip, -unsigned long start_esp) -{ -PVOP_VCALL3 (pv_apic_ops.startup_ipi_hook, - phys_apicid, start_eip, start_esp); -} -#endif -static inline void paravirt_activate_mm (struct mm_struct *prev,struct mm_struct *next) {
@@ -375,23 +366,6 @@ static inline void pte_update(struct mm_struct *mm, unsigned long addr, {PVOP_VCALL3 (pv_mmu_ops.pte_update, mm, addr, ptep); } -static inline void pmd_update (struct mm_struct *mm,unsigned long addr, -pmd_t *pmdp) -{ -PVOP_VCALL3 (pv_mmu_ops.pmd_update, mm, addr, pmdp); -} - -static inline void pte_update_defer (struct mm_struct *mm,unsigned long addr, -pte_t *ptep) -{ -PVOP_VCALL3 (pv_mmu_ops.pte_update_defer, mm, addr, ptep); -} - -static inline void pmd_update_defer (struct mm_struct *mm,unsigned long addr, -pmd_t *pmdp) -{ -PVOP_VCALL3 (pv_mmu_ops.pmd_update_defer, mm, addr, pmdp); -}static inline pte_t __pte (pteval_t val) {
arch/x86/include/asm/paravirt_types.h +0 -18
@@ -215,14 +215,6 @@ struct pv_irq_ops {#endif }; -struct pv_apic_ops { -#ifdef CONFIG_X86_LOCAL_APIC -void (*startup_ipi_hook)(int phys_apicid, -unsigned long start_eip, -unsigned long start_esp); -#endif -}; -struct pv_mmu_ops {unsigned long (*read_cr2)(void );void (*write_cr2)(unsigned long );
@@ -274,12 +266,6 @@ struct pv_mmu_ops { pmd_t *pmdp, pmd_t pmdval);void (*pte_update)(struct mm_struct *mm,unsigned long addr,pte_t *ptep); -void (*pte_update_defer)(struct mm_struct *mm, -unsigned long addr,pte_t *ptep); -void (*pmd_update)(struct mm_struct *mm,unsigned long addr, -pmd_t *pmdp); -void (*pmd_update_defer)(struct mm_struct *mm, -unsigned long addr,pmd_t *pmdp);pte_t (*ptep_modify_prot_start)(struct mm_struct *mm,unsigned long addr,pte_t *ptep);
@@ -354,7 +340,6 @@ struct paravirt_patch_template {struct pv_time_ops pv_time_ops;struct pv_cpu_ops pv_cpu_ops;struct pv_irq_ops pv_irq_ops; -struct pv_apic_ops pv_apic_ops;struct pv_mmu_ops pv_mmu_ops;struct pv_lock_ops pv_lock_ops; };
@@ -364,7 +349,6 @@ extern struct pv_init_ops pv_init_ops;extern struct pv_time_ops pv_time_ops;extern struct pv_cpu_ops pv_cpu_ops;extern struct pv_irq_ops pv_irq_ops; -extern struct pv_apic_ops pv_apic_ops;extern struct pv_mmu_ops pv_mmu_ops;extern struct pv_lock_ops pv_lock_ops;
@@ -402,10 +386,8 @@ extern struct pv_lock_ops pv_lock_ops; __visible extern const char start_##ops##_##name[], end_##ops##_##name[]; \ asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name)) -unsigned paravirt_patch_nop (void );unsigned paravirt_patch_ident_32 (void *insnbuf,unsigned len);unsigned paravirt_patch_ident_64 (void *insnbuf,unsigned len); -unsigned paravirt_patch_ignore (unsigned len); unsigned paravirt_patch_call(void *insnbuf, const void *target, u16 tgt_clobbers, unsigned long addr, u16 site_clobbers,
arch/x86/include/asm/pgtable.h +2 -13
@@ -69,9 +69,6 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);#define pmd_clear (pmd) native_pmd_clear(pmd)#define pte_update (mm, addr, ptep) do { } while (0) -#define pte_update_defer (mm, addr, ptep) do { } while (0) -#define pmd_update (mm, addr, ptep) do { } while (0) -#define pmd_update_defer (mm, addr, ptep) do { } while (0)#define pgd_val (x) native_pgd_val(x)#define __pgd (x) native_make_pgd(x)
@@ -731,14 +728,9 @@ static inline void native_set_pmd_at(struct mm_struct *mm, unsigned long addr,* updates should either be sets, clears, or set_pte_atomic for P->P * transitions, which means this hook should only be called for user PTEs. * This hook implies a P->P protection or access change has taken place, which -* requires a subsequent TLB flush. The notification can optionally be delayed -* until the TLB flush event by using the pte_update_defer form of the -* interface, but care must be taken to assure that the flush happens while -* still holding the same page table lock so that the shadow and primary pages -* do not become out of sync on SMP. +* requires a subsequent TLB flush. */ #define pte_update (mm, addr, ptep) do { } while (0) -#define pte_update_defer (mm, addr, ptep) do { } while (0)#endif /*
@@ -830,9 +822,7 @@ static inline int pmd_write(pmd_t pmd)static inline pmd_t pmdp_huge_get_and_clear (struct mm_struct *mm,unsigned long addr,pmd_t *pmdp) { -pmd_t pmd =native_pmdp_get_and_clear (pmdp); -pmd_update (mm, addr, pmdp); -return pmd; +return native_pmdp_get_and_clear (pmdp); }#define __HAVE_ARCH_PMDP_SET_WRPROTECT
@@ -840,7 +830,6 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp) { clear_bit(_PAGE_BIT_RW, (unsigned long *)pmdp); -pmd_update (mm, addr, pmdp); }/*
arch/x86/include/asm/smp.h +0 -12
@@ -21,15 +21,6 @@extern int smp_num_siblings;extern unsigned int num_processors; -static inline bool cpu_has_ht_siblings (void ) -{ -bool has_siblings = false; -#ifdef CONFIG_SMP - has_siblings = cpu_has_ht && smp_num_siblings >1 ; -#endif -return has_siblings; -} -DECLARE_PER_CPU_READ_MOSTLY (cpumask_var_t, cpu_sibling_map);DECLARE_PER_CPU_READ_MOSTLY (cpumask_var_t, cpu_core_map);/* cpus sharing the last level cache: */
@@ -74,9 +65,6 @@ struct smp_ops {extern void set_cpu_sibling_map (int cpu);#ifdef CONFIG_SMP -#ifndef CONFIG_PARAVIRT -#define startup_ipi_hook (phys_apicid, start_eip, start_esp) do { } while (0) -#endif extern struct smp_ops smp_ops;static inline void smp_send_stop (void )
arch/x86/include/asm/x86_init.h +0 -2
@@ -82,13 +82,11 @@ struct x86_init_paging {* struct x86_init_timers - platform specific timer setup * @setup_perpcu_clockev: set up the per cpu clock event device for the * boot cpu -* @tsc_pre_init: platform function called before TSC init * @timer_init: initialize the platform timer (default PIT/HPET) * @wallclock_init: init the wallclock device */ struct x86_init_timers {void (*setup_percpu_clockev)(void ); -void (*tsc_pre_init)(void );void (*timer_init)(void );void (*wallclock_init)(void ); };
arch/x86/include/asm/xor_32.h +1 -1
@@ -553,7 +553,7 @@ do { \if (cpu_has_xmm) { \xor_speed (&xor_block_pIII_sse); \xor_speed (&xor_block_sse_pf64); \ - }else if (cpu_has_mmx) { \ + }else if (boot_cpu_has (X86_FEATURE_MMX )) { \xor_speed (&xor_block_pII_mmx); \xor_speed (&xor_block_p5_mmx); \ }else { \
arch/x86/kernel/cpu/amd.c +2 -2
@@ -304,7 +304,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)int cpu =smp_processor_id ();/* get information required for multi-node processors */ -if (cpu_has_topoext) { +if (boot_cpu_has (X86_FEATURE_TOPOEXT )) {u32 eax, ebx, ecx, edx;cpuid (0x8000001e , &eax, &ebx, &ecx, &edx);
@@ -922,7 +922,7 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)void set_dr_addr_mask (unsigned long mask,int dr) { -if (!cpu_has_bpext) +if (!boot_cpu_has (X86_FEATURE_BPEXT ))return ;switch (dr) {
arch/x86/kernel/cpu/centaur.c +1 -1
@@ -43,7 +43,7 @@ static void init_c3(struct cpuinfo_x86 *c)/* store Centaur Extended Feature Flags as * word 5 of the CPU capability bit array */ - c->x86_capability[5 ] =cpuid_edx (0xC0000001 ); + c->x86_capability[CPUID_C000_0001_EDX ] =cpuid_edx (0xC0000001 ); }#ifdef CONFIG_X86_32 /* Cyrix III family needs CX8 & PGE explicitly enabled. */
arch/x86/kernel/cpu/common.c +28 -24
113 lines not on this page · raw message
arch/x86/kernel/cpu/intel.c +2 -1
@@ -445,7 +445,8 @@ static void init_intel(struct cpuinfo_x86 *c)if (cpu_has_xmm2)set_cpu_cap (c,X86_FEATURE_LFENCE_RDTSC ); -if (cpu_has_ds) { + +if (boot_cpu_has (X86_FEATURE_DS )) {unsigned int l1;rdmsr (MSR_IA32_MISC_ENABLE , l1, l2);if (!(l1 & (1 <<11 )))
arch/x86/kernel/cpu/intel_cacheinfo.c +3 -3
@@ -591,7 +591,7 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf)unsigned edx;if (boot_cpu_data.x86_vendor ==X86_VENDOR_AMD ) { -if (cpu_has_topoext) +if (boot_cpu_has (X86_FEATURE_TOPOEXT ))cpuid_count (0x8000001d , index, &eax.full, &ebx.full, &ecx.full, &edx);else
@@ -637,7 +637,7 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c)void init_amd_cacheinfo (struct cpuinfo_x86 *c) { -if (cpu_has_topoext) { +if (boot_cpu_has (X86_FEATURE_TOPOEXT )) { num_cache_leaves =find_num_cache_leaves (c); }else if (c->extended_cpuid_level >=0x80000006 ) {if (cpuid_edx (0x80000006 ) &0xf000 )
@@ -809,7 +809,7 @@ static int __cache_amd_cpumap_setup(unsigned int cpu, int index,struct cacheinfo *this_leaf;int i, sibling; -if (cpu_has_topoext) { +if (boot_cpu_has (X86_FEATURE_TOPOEXT )) {unsigned int apicid, nshared, first, last; this_leaf = this_cpu_ci->info_list + index;
arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -349,7 +349,7 @@ static void get_fixed_ranges(mtrr_type *frs)void mtrr_save_fixed_ranges (void *info) { -if (cpu_has_mtrr) +if (boot_cpu_has (X86_FEATURE_MTRR ))get_fixed_ranges (mtrr_state.fixed_ranges); }
arch/x86/kernel/cpu/mtrr/main.c +1 -1
@@ -682,7 +682,7 @@ void __init mtrr_bp_init(void) phys_addr =32 ; -if (cpu_has_mtrr) { +if (boot_cpu_has (X86_FEATURE_MTRR )) { mtrr_if = &generic_mtrr_ops; size_or_mask =SIZE_OR_MASK_BITS (36 ); size_and_mask =0x00f00000 ;
arch/x86/kernel/cpu/perf_event_amd.c +2 -2
@@ -160,7 +160,7 @@ static inline int amd_pmu_addr_offset(int index, bool eventsel)if (offset)return offset; -if (!cpu_has_perfctr_core) +if (!boot_cpu_has (X86_FEATURE_PERFCTR_CORE )) offset = index;else offset = index <<1 ;
@@ -652,7 +652,7 @@ static __initconst const struct x86_pmu amd_pmu = {static int __init amd_core_pmu_init (void ) { -if (!cpu_has_perfctr_core) +if (!boot_cpu_has (X86_FEATURE_PERFCTR_CORE ))return 0 ;switch (boot_cpu_data.x86) {
arch/x86/kernel/cpu/perf_event_amd_uncore.c +6 -5
@@ -523,10 +523,10 @@ static int __init amd_uncore_init(void)if (boot_cpu_data.x86_vendor !=X86_VENDOR_AMD ) goto fail_nodev; -if (!cpu_has_topoext) +if (!boot_cpu_has (X86_FEATURE_TOPOEXT )) goto fail_nodev; -if (cpu_has_perfctr_nb) { +if (boot_cpu_has (X86_FEATURE_PERFCTR_NB )) { amd_uncore_nb = alloc_percpu(struct amd_uncore *);if (!amd_uncore_nb) { ret = -ENOMEM ;
@@ -540,7 +540,7 @@ static int __init amd_uncore_init(void) ret =0 ; } -if (cpu_has_perfctr_l2) { +if (boot_cpu_has (X86_FEATURE_PERFCTR_L2 )) { amd_uncore_l2 = alloc_percpu(struct amd_uncore *);if (!amd_uncore_l2) { ret = -ENOMEM ;
@@ -583,10 +583,11 @@ static int __init amd_uncore_init(void)/* amd_uncore_nb/l2 should have been freed by cleanup_cpu_online */ amd_uncore_nb = amd_uncore_l2 =NULL ; -if (cpu_has_perfctr_l2) + +if (boot_cpu_has (X86_FEATURE_PERFCTR_L2 ))perf_pmu_unregister (&amd_l2_pmu); fail_l2: -if (cpu_has_perfctr_nb) +if (boot_cpu_has (X86_FEATURE_PERFCTR_NB ))perf_pmu_unregister (&amd_nb_pmu);if (amd_uncore_l2)free_percpu (amd_uncore_l2);
arch/x86/kernel/cpu/scattered.c +0 -20
@@ -31,32 +31,12 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c)const struct cpuid_bit *cb;static const struct cpuid_bit cpuid_bits[] = { - {X86_FEATURE_DTHERM ,CR_EAX ,0 ,0x00000006 ,0 }, - {X86_FEATURE_IDA ,CR_EAX ,1 ,0x00000006 ,0 }, - {X86_FEATURE_ARAT ,CR_EAX ,2 ,0x00000006 ,0 }, - {X86_FEATURE_PLN ,CR_EAX ,4 ,0x00000006 ,0 }, - {X86_FEATURE_PTS ,CR_EAX ,6 ,0x00000006 ,0 }, - {X86_FEATURE_HWP ,CR_EAX ,7 ,0x00000006 ,0 }, - {X86_FEATURE_HWP_NOTIFY ,CR_EAX ,8 ,0x00000006 ,0 }, - {X86_FEATURE_HWP_ACT_WINDOW ,CR_EAX ,9 ,0x00000006 ,0 }, - {X86_FEATURE_HWP_EPP ,CR_EAX ,10 ,0x00000006 ,0 }, - {X86_FEATURE_HWP_PKG_REQ ,CR_EAX ,11 ,0x00000006 ,0 }, {X86_FEATURE_INTEL_PT ,CR_EBX ,25 ,0x00000007 ,0 }, {X86_FEATURE_APERFMPERF ,CR_ECX ,0 ,0x00000006 ,0 }, {X86_FEATURE_EPB ,CR_ECX ,3 ,0x00000006 ,0 }, {X86_FEATURE_HW_PSTATE ,CR_EDX ,7 ,0x80000007 ,0 }, {X86_FEATURE_CPB ,CR_EDX ,9 ,0x80000007 ,0 }, {X86_FEATURE_PROC_FEEDBACK ,CR_EDX ,11 ,0x80000007 ,0 }, - {X86_FEATURE_NPT ,CR_EDX ,0 ,0x8000000a ,0 }, - {X86_FEATURE_LBRV ,CR_EDX ,1 ,0x8000000a ,0 }, - {X86_FEATURE_SVML ,CR_EDX ,2 ,0x8000000a ,0 }, - {X86_FEATURE_NRIPS ,CR_EDX ,3 ,0x8000000a ,0 }, - {X86_FEATURE_TSCRATEMSR ,CR_EDX ,4 ,0x8000000a ,0 }, - {X86_FEATURE_VMCBCLEAN ,CR_EDX ,5 ,0x8000000a ,0 }, - {X86_FEATURE_FLUSHBYASID ,CR_EDX ,6 ,0x8000000a ,0 }, - {X86_FEATURE_DECODEASSISTS ,CR_EDX ,7 ,0x8000000a ,0 }, - {X86_FEATURE_PAUSEFILTER ,CR_EDX ,10 ,0x8000000a ,0 }, - {X86_FEATURE_PFTHRESHOLD ,CR_EDX ,12 ,0x8000000a ,0 }, {0 ,0 ,0 ,0 ,0 } };
arch/x86/kernel/cpu/transmeta.c +2 -2
@@ -12,7 +12,7 @@ static void early_init_transmeta(struct cpuinfo_x86 *c) xlvl =cpuid_eax (0x80860000 );if ((xlvl &0xffff0000 ) ==0x80860000 ) {if (xlvl >=0x80860001 ) - c->x86_capability[2 ] =cpuid_edx (0x80860001 ); + c->x86_capability[CPUID_8086_0001_EDX ] =cpuid_edx (0x80860001 ); } }
@@ -82,7 +82,7 @@ static void init_transmeta(struct cpuinfo_x86 *c)/* Unhide possibly hidden capability flags */ rdmsr (0x80860004 , cap_mask, uk);wrmsr (0x80860004 , ~0 , uk); - c->x86_capability[0 ] =cpuid_edx (0x00000001 ); + c->x86_capability[CPUID_1_EDX ] =cpuid_edx (0x00000001 );wrmsr (0x80860004 , cap_mask, uk);/* All Transmeta CPUs have a constant TSC */
arch/x86/kernel/fpu/init.c +2 -2
@@ -12,7 +12,7 @@*/ static void fpu__init_cpu_ctx_switch (void ) { -if (!cpu_has_eager_fpu) +if (!boot_cpu_has (X86_FEATURE_EAGER_FPU ))stts ();else clts ();
@@ -287,7 +287,7 @@ static void __init fpu__init_system_ctx_switch(void)current_thread_info ()->status =0 ;/* Auto enable eagerfpu for xsaveopt */ -if (cpu_has_xsaveopt && eagerfpu !=DISABLE ) +if (boot_cpu_has (X86_FEATURE_XSAVEOPT ) && eagerfpu !=DISABLE ) eagerfpu =ENABLE ;if (xfeatures_mask &XFEATURE_MASK_EAGER ) {
arch/x86/kernel/hw_breakpoint.c +4 -2
@@ -300,6 +300,10 @@ static int arch_build_bp_info(struct perf_event *bp)return -EINVAL ;if (bp->attr.bp_addr & (bp->attr.bp_len -1 ))return -EINVAL ; + +if (!boot_cpu_has (X86_FEATURE_BPEXT )) +return -EOPNOTSUPP ; +/* * It's impossible to use a range breakpoint to fake out * user vs kernel detection because bp_len - 1 can't
@@ -307,8 +311,6 @@ static int arch_build_bp_info(struct perf_event *bp)* breakpoints, then we'll have to check for kprobe-blacklisted * addresses anywhere in the range. */ -if (!cpu_has_bpext) -return -EOPNOTSUPP ; info->mask = bp->attr.bp_len -1 ; info->len =X86_BREAKPOINT_LEN_1 ; }
arch/x86/kernel/paravirt.c +1 -23
@@ -74,16 +74,6 @@ void __init default_banner(void)/* Undefined instruction for dealing with missing ops pointers. */ static const unsigned char ud2a[] = {0x0f ,0x0b }; -unsigned paravirt_patch_nop (void ) -{ -return 0 ; -} - -unsigned paravirt_patch_ignore (unsigned len) -{ -return len; -} -struct branch {unsigned char opcode;u32 delta;
@@ -133,7 +123,6 @@ static void *get_call_destination(u8 type) .pv_time_ops = pv_time_ops, .pv_cpu_ops = pv_cpu_ops, .pv_irq_ops = pv_irq_ops, - .pv_apic_ops = pv_apic_ops, .pv_mmu_ops = pv_mmu_ops, #ifdef CONFIG_PARAVIRT_SPINLOCKS .pv_lock_ops = pv_lock_ops,
@@ -152,8 +141,7 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,/* If there's no function, patch it with a ud2a (BUG) */ ret =paravirt_patch_insns (insnbuf, len, ud2a, ud2a+sizeof (ud2a)); else if (opfunc == _paravirt_nop) -/* If the operation is a nop, then nop the callsite */ - ret =paravirt_patch_nop (); + ret =0 ;/* identity functions just return their single argument */ else if (opfunc == _paravirt_ident_32)
@@ -403,12 +391,6 @@ NOKPROBE_SYMBOL(native_get_debugreg);NOKPROBE_SYMBOL (native_set_debugreg);NOKPROBE_SYMBOL (native_load_idt); -struct pv_apic_ops pv_apic_ops = { -#ifdef CONFIG_X86_LOCAL_APIC - .startup_ipi_hook = paravirt_nop, -#endif -}; -#if defined(CONFIG_X86_32 ) && !defined(CONFIG_X86_PAE )/* 32-bit pagetable entries */ #define PTE_IDENT __PV_IS_CALLEE_SAVE(_paravirt_ident_32)
@@ -444,9 +426,6 @@ struct pv_mmu_ops pv_mmu_ops = { .set_pmd = native_set_pmd, .set_pmd_at = native_set_pmd_at, .pte_update = paravirt_nop, - .pte_update_defer = paravirt_nop, - .pmd_update = paravirt_nop, - .pmd_update_defer = paravirt_nop, .ptep_modify_prot_start = __ptep_modify_prot_start, .ptep_modify_prot_commit = __ptep_modify_prot_commit,
@@ -492,6 +471,5 @@ struct pv_mmu_ops pv_mmu_ops = {EXPORT_SYMBOL_GPL (pv_time_ops);EXPORT_SYMBOL (pv_cpu_ops);EXPORT_SYMBOL (pv_mmu_ops); -EXPORT_SYMBOL_GPL (pv_apic_ops);EXPORT_SYMBOL_GPL (pv_info);EXPORT_SYMBOL (pv_irq_ops);
arch/x86/kernel/ptrace.c +0 -15
@@ -124,21 +124,6 @@ const char *regs_query_register_name(unsigned int offset)return NULL ; } -static const int arg_offs_table[] = { -#ifdef CONFIG_X86_32 - [0 ] = offsetof(struct pt_regs , ax), - [1 ] = offsetof(struct pt_regs , dx), - [2 ] = offsetof(struct pt_regs , cx) -#else /* CONFIG_X86_64 */ - [0 ] = offsetof(struct pt_regs , di), - [1 ] = offsetof(struct pt_regs , si), - [2 ] = offsetof(struct pt_regs , dx), - [3 ] = offsetof(struct pt_regs , cx), - [4 ] = offsetof(struct pt_regs , r8), - [5 ] = offsetof(struct pt_regs , r9) -#endif -}; -/* * does not yet catch signals sent when the child dies. * in exit.c or in signal.c.
arch/x86/kernel/smpboot.c +1 -8
@@ -304,7 +304,7 @@ do { \static bool match_smt (struct cpuinfo_x86 *c,struct cpuinfo_x86 *o) { -if (cpu_has_topoext) { +if (boot_cpu_has (X86_FEATURE_TOPOEXT )) {int cpu1 = c->cpu_index, cpu2 = o->cpu_index; if (c->phys_proc_id == o->phys_proc_id &&
@@ -630,13 +630,6 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) num_starts =0 ;/* -* Paravirt / VMI wants a startup IPI hook here to set up the -* target processor state. -*/ -startup_ipi_hook (phys_apicid, (unsigned long ) start_secondary, - stack_start); - -/* * Run STARTUP IPI loop. */ pr_debug ("#startup loops: %d\n" , num_starts);
arch/x86/kernel/tsc.c +0 -2
@@ -1185,8 +1185,6 @@ void __init tsc_init(void)u64 lpj;int cpu; - x86_init.timers.tsc_pre_init (); -if (!cpu_has_tsc) {setup_clear_cpu_cap (X86_FEATURE_TSC_DEADLINE_TIMER );return ;
arch/x86/kernel/vm86_32.c +3 -1
@@ -357,8 +357,10 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus) tss = &per_cpu (cpu_tss,get_cpu ());/* make room for real-mode segments */ tsk->thread.sp0 +=16 ; -if (cpu_has_sep) + +if (static_cpu_has_safe (X86_FEATURE_SEP )) tsk->thread.sysenter_cs =0 ; +load_sp0 (tss, &tsk->thread);put_cpu ();
arch/x86/kernel/x86_init.c +0 -1
@@ -68,7 +68,6 @@ struct x86_init_ops x86_init __initdata = { .timers = { .setup_percpu_clockev = setup_boot_APIC_clock, - .tsc_pre_init = x86_init_noop, .timer_init = hpet_time_init, .wallclock_init = x86_init_noop, },
arch/x86/lguest/boot.c +0 -1
@@ -1472,7 +1472,6 @@ __init void lguest_init(void) pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode; pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu; pv_mmu_ops.pte_update = lguest_pte_update; - pv_mmu_ops.pte_update_defer = lguest_pte_update;#ifdef CONFIG_X86_LOCAL_APIC /* APIC read/write intercepts */
arch/x86/mm/pgtable.c +1 -6
@@ -414,7 +414,7 @@ int ptep_set_access_flags(struct vm_area_struct *vma,if (changed && dirty) { *ptep = entry; -pte_update_defer (vma->vm_mm, address, ptep); +pte_update (vma->vm_mm, address, ptep); }return changed;
@@ -431,7 +431,6 @@ int pmdp_set_access_flags(struct vm_area_struct *vma,if (changed && dirty) { *pmdp = entry; -pmd_update_defer (vma->vm_mm, address, pmdp);/* * We had a write-protection fault here and changed the pmd * to to more permissive. No need to flush the TLB for that,
@@ -469,9 +468,6 @@ int pmdp_test_and_clear_young(struct vm_area_struct *vma, ret =test_and_clear_bit (_PAGE_BIT_ACCESSED, (unsigned long *)pmdp); -if (ret) -pmd_update (vma->vm_mm, addr, pmdp); - return ret; }#endif
@@ -518,7 +514,6 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, set = !test_and_set_bit (_PAGE_BIT_SPLITTING, (unsigned long *)pmdp);if (set) { -pmd_update (vma->vm_mm, address, pmdp);/* need tlb flush only to serialize against gup-fast */ flush_tlb_range (vma, address, address +HPAGE_PMD_SIZE ); }
arch/x86/mm/setup_nx.c +2 -2
@@ -31,7 +31,7 @@ early_param("noexec", noexec_setup);void x86_configure_nx (void ) { -if (cpu_has_nx && !disable_nx) +if (boot_cpu_has (X86_FEATURE_NX ) && !disable_nx) __supported_pte_mask |= _PAGE_NX;else __supported_pte_mask &= ~_PAGE_NX;
@@ -39,7 +39,7 @@ void x86_configure_nx(void)void __init x86_report_nx (void ) { -if (!cpu_has_nx) { +if (!boot_cpu_has (X86_FEATURE_NX )) {printk (KERN_NOTICE "Notice: NX (Execute Disable) protection " "missing in CPU!\n" ); }else {
arch/x86/xen/enlighten.c +0 -7
@@ -1265,12 +1265,6 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { .end_context_switch = xen_end_context_switch, }; -static const struct pv_apic_ops xen_apic_ops__initconst = { -#ifdef CONFIG_X86_LOCAL_APIC - .startup_ipi_hook = paravirt_nop, -#endif -}; -static void xen_reboot (int reason) {struct sched_shutdown r = { .reason = reason };
@@ -1536,7 +1530,6 @@ asmlinkage __visible void __init xen_start_kernel(void)/* Install Xen paravirt ops */ pv_info = xen_info; pv_init_ops = xen_init_ops; - pv_apic_ops = xen_apic_ops;if (!xen_pvh_domain ()) { pv_cpu_ops = xen_cpu_ops;
arch/x86/xen/mmu.c +0 -1
@@ -2436,7 +2436,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { .flush_tlb_others = xen_flush_tlb_others, .pte_update = paravirt_nop, - .pte_update_defer = paravirt_nop, .pgd_alloc = xen_pgd_alloc, .pgd_free = xen_pgd_free,
drivers/char/hw_random/via-rng.c +3 -2
@@ -140,7 +140,7 @@ static int via_rng_init(struct hwrng *rng)* RNG configuration like it used to be the case in this * register */ if ((c->x86 ==6 ) && (c->x86_model >=0x0f )) { -if (!cpu_has_xstore_enabled) { +if (!boot_cpu_has (X86_FEATURE_XSTORE_EN )) {pr_err (PFX "can't enable hardware RNG " "if XSTORE is not enabled\n" );return -ENODEV ;
@@ -200,8 +200,9 @@ static int __init mod_init(void) {int err; -if (!cpu_has_xstore) +if (!boot_cpu_has (X86_FEATURE_XSTORE ))return -ENODEV ; +pr_info ("VIA RNG detected\n" ); err =hwrng_register (&via_rng);if (err) {
drivers/crypto/padlock-aes.c +1 -1
@@ -515,7 +515,7 @@ static int __init padlock_init(void)if (!x86_match_cpu (padlock_cpu_id))return -ENODEV ; -if (!cpu_has_xcrypt_enabled) { +if (!boot_cpu_has (X86_FEATURE_XCRYPT_EN )) { printk(KERN_NOTICE PFX "VIA PadLock detected, but not enabled. Hmm, strange...\n");return -ENODEV ; }
drivers/crypto/padlock-sha.c +1 -1
@@ -540,7 +540,7 @@ static int __init padlock_init(void)struct shash_alg *sha1;struct shash_alg *sha256; -if (!x86_match_cpu (padlock_sha_ids) || !cpu_has_phe_enabled) +if (!x86_match_cpu (padlock_sha_ids) || !boot_cpu_has (X86_FEATURE_PHE_EN ))return -ENODEV ;/* Register the newly added algorithm module if on *
drivers/iommu/intel_irq_remapping.c +1 -1
@@ -753,7 +753,7 @@ static inline void set_irq_posting_cap(void)* should have X86_FEATURE_CX16 support, this has been confirmed * with Intel hardware guys. */ -if ( cpu_has_cx16 ) +if (boot_cpu_has (X86_FEATURE_CX16 )) intel_irq_remap_ops.capability |=1 <<IRQ_POSTING_CAP ;for_each_iommu (iommu, drhd)
fs/btrfs/disk-io.c +1 -1
@@ -923,7 +923,7 @@ static int check_async_write(struct inode *inode, unsigned long bio_flags)if (bio_flags &EXTENT_BIO_TREE_LOG )return 0 ;#ifdef CONFIG_X86 -if (cpu_has_xmm4_2) +if (static_cpu_has_safe (X86_FEATURE_XMM4_2 ))return 0 ;#endif return 1 ;