Linux 4.4.138
Greg KH
maintainerI'm announcing the release of the 4.4.138 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/x86/crypto/chacha20_glue.c | 2 arch/x86/crypto/crc32c-intel_glue.c | 7 - arch/x86/include/asm/cmpxchg_32.h | 2 arch/x86/include/asm/cmpxchg_64.h | 2 arch/x86/include/asm/cpufeature.h | 39 ------ arch/x86/include/asm/fpu/internal.h | 6 arch/x86/include/asm/fpu/xstate.h | 2 arch/x86/include/asm/kvm_emulate.h | 6 arch/x86/include/asm/smp.h | 9 - arch/x86/include/asm/xor_32.h | 2 arch/x86/kernel/cpu/amd.c | 4 arch/x86/kernel/cpu/common.c | 4 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/fpu/core.c | 24 +++ arch/x86/kernel/fpu/init.c | 169 ++++++---------------------- arch/x86/kernel/fpu/xstate.c | 3 arch/x86/kernel/hw_breakpoint.c | 6 arch/x86/kernel/smpboot.c | 2 arch/x86/kernel/traps.c | 1 arch/x86/kernel/vm86_32.c | 4 arch/x86/kvm/emulate.c | 72 +++++------ arch/x86/kvm/vmx.c | 23 +-- arch/x86/kvm/x86.c | 51 ++++++-- arch/x86/kvm/x86.h | 4 arch/x86/mm/setup_nx.c | 4 drivers/char/hw_random/via-rng.c | 5 drivers/crypto/padlock-aes.c | 2 drivers/crypto/padlock-sha.c | 2 drivers/crypto/vmx/aes.c | 2 drivers/crypto/vmx/aes_cbc.c | 2 drivers/crypto/vmx/aes_ctr.c | 2 drivers/crypto/vmx/ghash.c | 2 drivers/gpio/gpiolib.c | 9 + drivers/input/mouse/elan_i2c_core.c | 1 drivers/input/touchscreen/goodix.c | 1 drivers/iommu/intel_irq_remapping.c | 2 drivers/misc/vmw_balloon.c | 23 +-- drivers/tty/serial/samsung.c | 7 - fs/btrfs/disk-io.c | 2 include/linux/fs.h | 4 net/key/af_key.c | 45 +++++-- 47 files changed, 258 insertions(+), 331 deletions(-)
Andy Lutomirski (6):
x86/fpu: Default eagerfpu=on on all CPUs
x86/fpu: Fix 'no387' regression
x86/fpu: Hard-disable lazy FPU mode
x86/fpu: Fix FNSAVE usage in eagerfpu mode
x86/fpu: Fix math emulation in eager fpu mode
x86/crypto, x86/fpu: Remove X86_FEATURE_EAGER_FPU #ifdef from the crc32c code
Borislav Petkov (2):
x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros x86/fpu: Fix eager-FPU handling on legacy FPU machines
Ethan Lee (1):
Input: goodix - add new ACPI id for GPD Win 2 touch screen
Gil Kupfer (1):
vmw_balloon: fixing double free when batching mode is off
Greg Kroah-Hartman (1):
Linux 4.4.138
Johannes Wienke (1):
Input: elan_i2c - add ELAN0612 (Lenovo v330 14IKB) ACPI ID
Juergen Gross (1):
x86: Remove unused function cpu_has_ht_siblings()
Kevin Easton (1):
af_key: Always verify length of provided sadb_key
Linus Torvalds (1):
Clarify (and fix) MAX_LFS_FILESIZE macros
Linus Walleij (1):
gpio: No NULL owner
Marek Szyprowski (1):
serial: samsung: fix maxburst parameter for DMA transactions
Michael Ellerman (1):
crypto: vmx - Remove overly verbose printk from AES init routines
Paolo Bonzini (3):
KVM: x86: introduce linear_{read,write}_system
KVM: x86: pass kvm_vcpu to kvm_read_guest_virt and kvm_write_guest_virt_system
kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access
Yu-cheng Yu (1):
x86/fpu: Revert ("x86/fpu: Disable AVX when eagerfpu is off")
yu-cheng yu (3):
x86/fpu: Fix early FPU command-line parsing
x86/fpu: Disable MPX when eagerfpu is off
x86/fpu: Disable AVX when eagerfpu is off
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 137 +SUBLEVEL = 138 EXTRAVERSION = NAME = Blurry Fish Butt
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 -6
@@ -58,16 +58,11 @@ asmlinkage unsigned int crc_pcl(const u8 *buffer, int len,unsigned int crc_init);static int crc32c_pcl_breakeven =CRC32C_PCL_BREAKEVEN_EAGERFPU ; -#if defined(X86_FEATURE_EAGER_FPU )#define set_pcl_breakeven_point () \ do { \ if (!use_eager_fpu()) \ crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_NOEAGERFPU; \ } while (0) -#else -#define set_pcl_breakeven_point () \ - (crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_NOEAGERFPU) -#endif #endif /* CONFIG_X86_64 */ static u32 crc32c_intel_le_hw_byte (u32 crc,unsigned char const *data,size_t length)
@@ -257,7 +252,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 +5 -34
@@ -104,7 +104,7 @@#define X86_FEATURE_EXTD_APICID ( 3*32+26)/* has extended APICID (8 bits) */ #define X86_FEATURE_AMD_DCM ( 3*32+27)/* multi-node processor */ #define X86_FEATURE_APERFMPERF ( 3*32+28)/* APERFMPERF */ -#define X86_FEATURE_EAGER_FPU ( 3*32+29)/* "eagerfpu" Non lazy FPU restore */ +/* free, was #define X86_FEATURE_EAGER_FPU ( 3*32+29) * "eagerfpu" Non lazy FPU restore */ #define X86_FEATURE_NONSTOP_TSC_S3 ( 3*32+30)/* TSC doesn't stop in S3 state */ /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
@@ -368,58 +368,29 @@ extern const char * const x86_bug_flags[NBUGINTS*32];#define setup_force_cpu_bug (bit) setup_force_cpu_cap(bit)#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU) -#define cpu_has_de boot_cpu_has(X86_FEATURE_DE)#define cpu_has_pse boot_cpu_has(X86_FEATURE_PSE)#define cpu_has_tsc boot_cpu_has(X86_FEATURE_TSC)#define cpu_has_pge boot_cpu_has(X86_FEATURE_PGE)#define cpu_has_apic boot_cpu_has(X86_FEATURE_APIC) -#define cpu_has_sep boot_cpu_has(X86_FEATURE_SEP) -#define cpu_has_mtrr boot_cpu_has(X86_FEATURE_MTRR) -#define cpu_has_mmx boot_cpu_has(X86_FEATURE_MMX)#define cpu_has_fxsr boot_cpu_has(X86_FEATURE_FXSR)#define cpu_has_xmm boot_cpu_has(X86_FEATURE_XMM)#define cpu_has_xmm2 boot_cpu_has(X86_FEATURE_XMM2) -#define cpu_has_xmm3 boot_cpu_has(X86_FEATURE_XMM3) -#define cpu_has_ssse3 boot_cpu_has(X86_FEATURE_SSSE3)#define cpu_has_aes boot_cpu_has(X86_FEATURE_AES)#define cpu_has_avx boot_cpu_has(X86_FEATURE_AVX)#define cpu_has_avx2 boot_cpu_has(X86_FEATURE_AVX2) -#define cpu_has_ht boot_cpu_has(X86_FEATURE_HT) -#define cpu_has_nx boot_cpu_has(X86_FEATURE_NX) -#define cpu_has_xstore boot_cpu_has(X86_FEATURE_XSTORE) -#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN) -#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT) -#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN) -#define cpu_has_ace2 boot_cpu_has(X86_FEATURE_ACE2) -#define cpu_has_ace2_enabled boot_cpu_has(X86_FEATURE_ACE2_EN) -#define cpu_has_phe boot_cpu_has(X86_FEATURE_PHE) -#define cpu_has_phe_enabled boot_cpu_has(X86_FEATURE_PHE_EN) -#define cpu_has_pmm boot_cpu_has(X86_FEATURE_PMM) -#define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN) -#define cpu_has_ds boot_cpu_has(X86_FEATURE_DS) -#define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS)#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLUSH) -#define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS)#define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES)#define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON)#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT) -#define cpu_has_xmm4_1 boot_cpu_has(X86_FEATURE_XMM4_1) -#define cpu_has_xmm4_2 boot_cpu_has(X86_FEATURE_XMM4_2)#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC)#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE) -#define cpu_has_xsaveopt boot_cpu_has(X86_FEATURE_XSAVEOPT)#define cpu_has_xsaves boot_cpu_has(X86_FEATURE_XSAVES)#define cpu_has_osxsave boot_cpu_has(X86_FEATURE_OSXSAVE)#define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR) -#define cpu_has_pclmulqdq boot_cpu_has(X86_FEATURE_PCLMULQDQ) -#define cpu_has_perfctr_core boot_cpu_has(X86_FEATURE_PERFCTR_CORE) -#define cpu_has_perfctr_nb boot_cpu_has(X86_FEATURE_PERFCTR_NB) -#define cpu_has_perfctr_l2 boot_cpu_has(X86_FEATURE_PERFCTR_L2) -#define cpu_has_cx8 boot_cpu_has(X86_FEATURE_CX8) -#define cpu_has_cx16 boot_cpu_has(X86_FEATURE_CX16) -#define cpu_has_eager_fpu boot_cpu_has(X86_FEATURE_EAGER_FPU) -#define cpu_has_topoext boot_cpu_has(X86_FEATURE_TOPOEXT) -#define cpu_has_bpext boot_cpu_has(X86_FEATURE_BPEXT) +/* +* Do not add any more of those clumsy macros - use static_cpu_has_safe() for +* fast paths and boot_cpu_has() otherwise! +*/ #if __GNUC__ >=4 extern void warn_pre_alternatives (void );
arch/x86/include/asm/fpu/internal.h +4 -2
@@ -42,6 +42,7 @@ extern void fpu__init_cpu_xstate(void);extern void fpu__init_system (struct cpuinfo_x86 *c);extern void fpu__init_check_bugs (void );extern void fpu__resume_cpu (void ); +extern u64 fpu__get_supported_xfeatures_mask (void );/* * Debugging facility:
@@ -57,7 +58,7 @@ extern void fpu__resume_cpu(void);*/ static __always_inline __pure bool use_eager_fpu(void) { -return static_cpu_has_safe (X86_FEATURE_EAGER_FPU ); +return true; } static __always_inline __pure bool use_xsaveopt(void)
@@ -595,7 +596,8 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)* If the task has used the math, pre-load the FPU on xsave processors * or if the past 5 consecutive context-switches used math. */ - fpu.preload = new_fpu->fpstate_active && + fpu.preload =static_cpu_has (X86_FEATURE_FPU ) && + new_fpu->fpstate_active && (use_eager_fpu () || new_fpu->counter >5 );if (old_fpu->fpregs_active) {
arch/x86/include/asm/fpu/xstate.h +1 -1
@@ -22,7 +22,7 @@#define XFEATURE_MASK_LAZY (XFEATURE_MASK_FP | \ XFEATURE_MASK_SSE | \ XFEATURE_MASK_YMM | \ - XFEATURE_MASK_OPMASK | \ + XFEATURE_MASK_OPMASK | \ XFEATURE_MASK_ZMM_Hi256 | \ XFEATURE_MASK_Hi16_ZMM)
arch/x86/include/asm/kvm_emulate.h +4 -2
@@ -105,11 +105,12 @@ struct x86_emulate_ops {* @addr: [IN ] Linear address from which to read. * @val: [OUT] Value read from memory, zero-extended to 'u_long'. * @bytes: [IN ] Number of bytes to read from memory. +* @system:[IN ] Whether the access is forced to be at CPL0. */ int (*read_std)(struct x86_emulate_ctxt *ctxt,unsigned long addr,void *val,unsigned int bytes, -struct x86_exception *fault); +struct x86_exception *fault,bool system);/* * read_phys: Read bytes of standard (non-emulated/special) memory.
@@ -127,10 +128,11 @@ struct x86_emulate_ops {* @addr: [IN ] Linear address to which to write. * @val: [OUT] Value write to memory, zero-extended to 'u_long'. * @bytes: [IN ] Number of bytes to write to memory. +* @system:[IN ] Whether the access is forced to be at CPL0. */ int (*write_std)(struct x86_emulate_ctxt *ctxt,unsigned long addr,void *val,unsigned int bytes, -struct x86_exception *fault); +struct x86_exception *fault,bool system);/* * fetch: Read bytes of standard (non-emulated/special) memory. * Used for instruction fetch.
arch/x86/include/asm/smp.h +0 -9
@@ -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: */
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);
@@ -954,7 +954,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/common.c +3 -1
@@ -1539,7 +1539,9 @@ void cpu_init(void)printk (KERN_INFO "Initializing CPU#%d\n" , cpu); -if (cpu_feature_enabled (X86_FEATURE_VME ) || cpu_has_tsc || cpu_has_de) +if (cpu_feature_enabled (X86_FEATURE_VME ) || + cpu_has_tsc || +boot_cpu_has (X86_FEATURE_DE ))cr4_clear_bits (X86_CR4_VME |X86_CR4_PVI |X86_CR4_TSD |X86_CR4_DE );load_current_idt ();
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 @@ fail_online:/* 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/fpu/core.c +19 -5
@@ -114,6 +114,10 @@ void __kernel_fpu_begin(void)kernel_fpu_disable ();if (fpu->fpregs_active) { +/* +* Ignore return value -- we don't care if reg state +* is clobbered. +*/ copy_fpregs_to_fpstate (fpu); }else {this_cpu_write (fpu_fpregs_owner_ctx,NULL );
@@ -189,8 +193,12 @@ void fpu__save(struct fpu *fpu)preempt_disable ();if (fpu->fpregs_active) { -if (!copy_fpregs_to_fpstate (fpu)) -fpregs_deactivate (fpu); +if (!copy_fpregs_to_fpstate (fpu)) { +if (use_eager_fpu ()) +copy_kernel_to_fpregs (&fpu->state); +else +fpregs_deactivate (fpu); + } }preempt_enable (); }
@@ -259,7 +267,11 @@ static void fpu_copy(struct fpu *dst_fpu, struct fpu *src_fpu)preempt_disable ();if (!copy_fpregs_to_fpstate (dst_fpu)) {memcpy (&src_fpu->state, &dst_fpu->state, xstate_size); -fpregs_deactivate (src_fpu); + +if (use_eager_fpu ()) +copy_kernel_to_fpregs (&src_fpu->state); +else +fpregs_deactivate (src_fpu); }preempt_enable (); }
@@ -409,8 +421,10 @@ static inline void copy_init_fpstate_to_fpregs(void) {if (use_xsave ())copy_kernel_to_xregs (&init_fpstate.xsave,-1 ); -else +else if (static_cpu_has (X86_FEATURE_FXSR ))copy_kernel_to_fxregs (&init_fpstate.fxsave); +else +copy_kernel_to_fregs (&init_fpstate.fsave); }/*
@@ -423,7 +437,7 @@ void fpu__clear(struct fpu *fpu) {WARN_ON_FPU (fpu != ¤t->thread.fpu);/* Almost certainly an anomaly */ -if (!use_eager_fpu ()) { +if (!use_eager_fpu () || !static_cpu_has (X86_FEATURE_FPU )) {/* FPU state will be reallocated lazily at the first use. */ fpu__drop (fpu); }else {
arch/x86/kernel/fpu/init.c +41 -128
225 lines not on this page · raw message
arch/x86/kernel/fpu/xstate.c +1 -2
@@ -632,8 +632,7 @@ void __init fpu__init_system_xstate(void)BUG (); } -/* Support only the state known to the OS: */ - xfeatures_mask = xfeatures_mask &XCNTXT_MASK ; + xfeatures_mask &=fpu__get_supported_xfeatures_mask ();/* Enable xstate instructions to be able to continue with initialization: */ fpu__init_cpu_xstate ();
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/smpboot.c +1 -1
@@ -295,7 +295,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 &&
arch/x86/kernel/traps.c +0 -1
@@ -751,7 +751,6 @@ dotraplinkage void do_device_not_available(struct pt_regs *regs, long error_code) {RCU_LOCKDEP_WARN (!rcu_is_watching (),"entry code didn't wake RCU" ); -BUG_ON (use_eager_fpu ());#ifdef CONFIG_MATH_EMULATION if (read_cr0 () &X86_CR0_EM ) {
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/kvm/emulate.c +36 -36
184 lines not on this page · raw message
arch/x86/kvm/vmx.c +10 -13
@@ -6692,8 +6692,7 @@ static int nested_vmx_check_vmptr(struct kvm_vcpu *vcpu, int exit_reason, vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))return 1 ; -if (kvm_read_guest_virt (&vcpu->arch.emulate_ctxt, gva, &vmptr, -sizeof (vmptr), &e)) { +if (kvm_read_guest_virt (vcpu, gva, &vmptr,sizeof (vmptr), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
@@ -7211,8 +7210,8 @@ static int handle_vmread(struct kvm_vcpu *vcpu) vmx_instruction_info, true, &gva))return 1 ;/* _system ok, as nested_vmx_check_permission verified cpl=0 */ -kvm_write_guest_virt_system (&vcpu->arch.emulate_ctxt, gva, - &field_value, (is_long_mode (vcpu) ?8 :4 ),NULL ); +kvm_write_guest_virt_system (vcpu, gva, &field_value, + (is_long_mode (vcpu) ?8 :4 ),NULL ); }nested_vmx_succeed (vcpu);
@@ -7247,8 +7246,8 @@ static int handle_vmwrite(struct kvm_vcpu *vcpu)if (get_vmx_mem_address (vcpu, exit_qualification, vmx_instruction_info, false, &gva))return 1 ; -if (kvm_read_guest_virt (&vcpu->arch.emulate_ctxt, gva, - &field_value, (is_64_bit_mode (vcpu) ?8 :4 ), &e)) { +if (kvm_read_guest_virt (vcpu, gva, &field_value, + (is_64_bit_mode (vcpu) ?8 :4 ), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
@@ -7338,9 +7337,9 @@ static int handle_vmptrst(struct kvm_vcpu *vcpu) vmx_instruction_info, true, &vmcs_gva))return 1 ;/* ok to use *_system, as nested_vmx_check_permission verified cpl=0 */ -if (kvm_write_guest_virt_system (&vcpu->arch.emulate_ctxt, vmcs_gva, - (void *)&to_vmx (vcpu)->nested.current_vmptr, -sizeof (u64), &e)) { +if (kvm_write_guest_virt_system (vcpu, vmcs_gva, + (void *)&to_vmx (vcpu)->nested.current_vmptr, +sizeof (u64), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
@@ -7394,8 +7393,7 @@ static int handle_invept(struct kvm_vcpu *vcpu)if (get_vmx_mem_address (vcpu,vmcs_readl (EXIT_QUALIFICATION ), vmx_instruction_info, false, &gva))return 1 ; -if (kvm_read_guest_virt (&vcpu->arch.emulate_ctxt, gva, &operand, -sizeof (operand), &e)) { +if (kvm_read_guest_virt (vcpu, gva, &operand,sizeof (operand), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
@@ -7454,8 +7452,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)if (get_vmx_mem_address (vcpu,vmcs_readl (EXIT_QUALIFICATION ), vmx_instruction_info, false, &gva))return 1 ; -if (kvm_read_guest_virt (&vcpu->arch.emulate_ctxt, gva, &vpid, -sizeof (u32), &e)) { +if (kvm_read_guest_virt (vcpu, gva, &vpid,sizeof (u32), &e)) {kvm_inject_page_fault (vcpu, &e);return 1 ; }
arch/x86/kvm/x86.c +37 -14
92 lines not on this page · raw message
arch/x86/kvm/x86.h +2 -2
@@ -164,11 +164,11 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);void kvm_write_tsc (struct kvm_vcpu *vcpu,struct msr_data *msr); -int kvm_read_guest_virt (struct x86_emulate_ctxt *ctxt, +int kvm_read_guest_virt (struct kvm_vcpu *vcpu,gva_t addr,void *val,unsigned int bytes,struct x86_exception *exception); -int kvm_write_guest_virt_system (struct x86_emulate_ctxt *ctxt, +int kvm_write_guest_virt_system (struct kvm_vcpu *vcpu,gva_t addr,void *val,unsigned int bytes,struct x86_exception *exception);
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 {
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/crypto/vmx/aes.c +0 -2
@@ -53,8 +53,6 @@ static int p8_aes_init(struct crypto_tfm *tfm) alg, PTR_ERR(fallback));return PTR_ERR (fallback); } -printk (KERN_INFO "Using '%s' as fallback implementation.\n" , -crypto_tfm_alg_driver_name ((struct crypto_tfm *) fallback)); crypto_cipher_set_flags(fallback, crypto_cipher_get_flags((struct
drivers/crypto/vmx/aes_cbc.c +0 -2
@@ -55,8 +55,6 @@ static int p8_aes_cbc_init(struct crypto_tfm *tfm) alg, PTR_ERR(fallback));return PTR_ERR (fallback); } -printk (KERN_INFO "Using '%s' as fallback implementation.\n" , -crypto_tfm_alg_driver_name ((struct crypto_tfm *) fallback)); crypto_blkcipher_set_flags( fallback,
drivers/crypto/vmx/aes_ctr.c +0 -2
@@ -53,8 +53,6 @@ static int p8_aes_ctr_init(struct crypto_tfm *tfm) alg, PTR_ERR(fallback));return PTR_ERR (fallback); } -printk (KERN_INFO "Using '%s' as fallback implementation.\n" , -crypto_tfm_alg_driver_name ((struct crypto_tfm *) fallback)); crypto_blkcipher_set_flags( fallback,
drivers/crypto/vmx/ghash.c +0 -2
@@ -64,8 +64,6 @@ static int p8_ghash_init_tfm(struct crypto_tfm *tfm) alg, PTR_ERR(fallback));return PTR_ERR (fallback); } -printk (KERN_INFO "Using '%s' as fallback implementation.\n" , -crypto_tfm_alg_driver_name (crypto_shash_tfm (fallback))); crypto_shash_set_flags(fallback, crypto_shash_get_flags((struct crypto_shash
drivers/gpio/gpiolib.c +7 -2
@@ -2117,6 +2117,8 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,struct gpio_desc *desc =NULL ;int status;enum gpio_lookup_flags lookupflags =0 ; +/* Maybe we have a device name, maybe not */ +const char *devname = dev ?dev_name (dev) :"?" ;dev_dbg (dev,"GPIO lookup for consumer %s\n" , con_id);
@@ -2145,8 +2147,11 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev,return desc; } -/* If a connection label was passed use that, else use the device name as label */ - status =gpiod_request (desc, con_id ? con_id :dev_name (dev)); +/* +* If a connection label was passed use that, else attempt to use +* the device name as label +*/ + status =gpiod_request (desc, con_id ? con_id : devname);if (status <0 )return ERR_PTR (status);
drivers/input/mouse/elan_i2c_core.c +1 -0
@@ -1249,6 +1249,7 @@ static const struct acpi_device_id elan_acpi_id[] = { { "ELAN060B", 0 }, { "ELAN060C", 0 }, { "ELAN0611", 0 }, + { "ELAN0612", 0 }, { "ELAN1000", 0 }, { } };
drivers/input/touchscreen/goodix.c +1 -0
@@ -425,6 +425,7 @@ MODULE_DEVICE_TABLE(i2c, goodix_ts_id);#ifdef CONFIG_ACPI static const struct acpi_device_id goodix_acpi_match[] = { {"GDIX1001" ,0 }, + {"GDIX1002" ,0 }, { } };MODULE_DEVICE_TABLE (acpi, goodix_acpi_match);
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)
drivers/misc/vmw_balloon.c +7 -16
@@ -576,15 +576,9 @@ static void vmballoon_pop(struct vmballoon *b) } } -if (b->batch_page) { -vunmap (b->batch_page); - b->batch_page =NULL ; - } - -if (b->page) { -__free_page (b->page); - b->page =NULL ; - } +/* Clearing the batch_page unconditionally has no adverse effect */ +free_page ((unsigned long )b->batch_page); + b->batch_page =NULL ; }/*
@@ -991,16 +985,13 @@ static const struct vmballoon_ops vmballoon_batched_ops = {static bool vmballoon_init_batching (struct vmballoon *b) { - b->page =alloc_page (VMW_PAGE_ALLOC_NOSLEEP ); -if (!b->page) -return false; +struct page *page; - b->batch_page =vmap (&b->page,1 ,VM_MAP ,PAGE_KERNEL ); -if (!b->batch_page) { -__free_page (b->page); + page =alloc_page (GFP_KERNEL | __GFP_ZERO); +if (!page)return false; - } + b->batch_page =page_address (page);return true; }
drivers/tty/serial/samsung.c +2 -5
@@ -860,15 +860,12 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) dma->rx_conf.direction =DMA_DEV_TO_MEM ; dma->rx_conf.src_addr_width =DMA_SLAVE_BUSWIDTH_1_BYTE ; dma->rx_conf.src_addr = p->port.mapbase +S3C2410_URXH ; - dma->rx_conf.src_maxburst =16 ; + dma->rx_conf.src_maxburst =1 ; dma->tx_conf.direction =DMA_MEM_TO_DEV ; dma->tx_conf.dst_addr_width =DMA_SLAVE_BUSWIDTH_1_BYTE ; dma->tx_conf.dst_addr = p->port.mapbase +S3C2410_UTXH ; -if (dma_get_cache_alignment () >=16 ) - dma->tx_conf.dst_maxburst =16 ; -else - dma->tx_conf.dst_maxburst =1 ; + dma->tx_conf.dst_maxburst =1 ;dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask);
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 ;
include/linux/fs.h +2 -2
@@ -926,9 +926,9 @@ static inline struct file *get_file(struct file *f)/* Page cache limit. The filesystems should put that into their s_maxbytes limits, otherwise bad things can happen in VM. */ #if BITS_PER_LONG ==32 -#define MAX_LFS_FILESIZE (((loff_t)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) +#define MAX_LFS_FILESIZE ((loff_t)ULONG_MAX << PAGE_SHIFT)#elif BITS_PER_LONG ==64 -#define MAX_LFS_FILESIZE ((loff_t)0x7fffffffffffffffLL) +#define MAX_LFS_FILESIZE ((loff_t)LLONG_MAX)#endif #define FL_POSIX 1
net/key/af_key.c +35 -10
71 lines not on this page · raw message