Linux 4.4.202
Greg KH
maintainerI'm announcing the release of the 4.4.202 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:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/ABI/testing/sysfs-devices-system-cpu | 2 Documentation/hw-vuln/tsx_async_abort.rst | 268 +++++++++++++++++++++ Documentation/kernel-parameters.txt | 62 ++++ Documentation/x86/tsx_async_abort.rst | 117 +++++++++ Makefile | 2 arch/mips/bcm63xx/reset.c | 2 arch/powerpc/Makefile | 31 +- arch/powerpc/boot/wrapper | 24 + arch/x86/Kconfig | 45 +++ arch/x86/include/asm/cpufeatures.h | 2 arch/x86/include/asm/kvm_host.h | 2 arch/x86/include/asm/msr-index.h | 16 + arch/x86/include/asm/nospec-branch.h | 4 arch/x86/include/asm/processor.h | 7 arch/x86/kernel/cpu/Makefile | 2 arch/x86/kernel/cpu/bugs.c | 143 ++++++++++- arch/x86/kernel/cpu/common.c | 93 ++++--- arch/x86/kernel/cpu/cpu.h | 18 + arch/x86/kernel/cpu/intel.c | 5 arch/x86/kernel/cpu/tsx.c | 140 ++++++++++ arch/x86/kvm/cpuid.c | 12 arch/x86/kvm/vmx.c | 15 - arch/x86/kvm/x86.c | 53 +++- drivers/base/cpu.c | 17 + include/linux/cpu.h | 5 25 files changed, 1018 insertions(+), 69 deletions(-)
Ben Hutchings (1):
KVM: Introduce kvm_get_arch_capabilities()
Greg Kroah-Hartman (1):
Linux 4.4.202
Jim Mattson (1):
kvm: x86: IA32_ARCH_CAPABILITIES is always supported
Jonas Gorski (1):
MIPS: BCM63XX: fix switch core reset on BCM6368
Josh Poimboeuf (1):
x86/speculation/taa: Fix printing of TAA_MSG_SMT on IBRS_ALL CPUs
Junaid Shahid (1):
kvm: mmu: Don't read PDPTEs when paging is not enabled
Michael Ellerman (1):
powerpc/Makefile: Use cflags-y/aflags-y for setting endian options
Michal Hocko (1):
x86/tsx: Add config options to set tsx=on|off|auto
Nicholas Piggin (2):
powerpc: Fix compiling a BE kernel with a powerpc64le toolchain powerpc/boot: Request no dynamic linker for boot wrapper
Paolo Bonzini (1):
KVM: x86: use Intel speculation bugs and features as derived in generic x86 code
Pawan Gupta (8):
x86/msr: Add the IA32_TSX_CTRL MSR
x86/cpu: Add a helper function x86_read_arch_cap_msr() x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default x86/speculation/taa: Add mitigation for TSX Async Abort x86/speculation/taa: Add sysfs reporting for TSX Async Abort kvm/x86: Export MDS_NO=0 to guests when TSX is enabled x86/tsx: Add "auto" option to the tsx= cmdline parameter x86/speculation/taa: Add documentation for TSX Async Abort
Sean Christopherson (1):
KVM: x86: Emulate MSR_IA32_ARCH_CAPABILITIES on AMD hosts
Vineela Tummalapalli (1):
x86/bugs: Add ITLB_MULTIHIT bug infrastructure
Greg KH
maintainerDocumentation/ABI/testing/sysfs-devices-system-cpu +2 -0
@@ -279,6 +279,8 @@ What: /sys/devices/system/cpu/vulnerabilities /sys/devices/system/cpu/vulnerabilities/spec_store_bypass /sys/devices/system/cpu/vulnerabilities/l1tf /sys/devices/system/cpu/vulnerabilities/mds + /sys/devices/system/cpu/vulnerabilities/tsx_async_abort + /sys/devices/system/cpu/vulnerabilities/itlb_multihit Date: January 2018 Contact: Linux kernel mailing list <[email protected]> Description: Information about CPU vulnerabilities
Documentation/hw-vuln/tsx_async_abort.rst new file +268 -0
268 lines not on this page · raw message
Documentation/kernel-parameters.txt +62 -0
74 lines not on this page · raw message
Documentation/x86/tsx_async_abort.rst new file +117 -0
117 lines not on this page · raw message
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 201 +SUBLEVEL = 202 EXTRAVERSION = NAME = Blurry Fish Butt
arch/mips/bcm63xx/reset.c +1 -1
@@ -119,7 +119,7 @@#define BCM6368_RESET_DSL 0#define BCM6368_RESET_SAR SOFTRESET_6368_SAR_MASK#define BCM6368_RESET_EPHY SOFTRESET_6368_EPHY_MASK -#define BCM6368_RESET_ENETSW 0 +#define BCM6368_RESET_ENETSW SOFTRESET_6368_ENETSW_MASK#define BCM6368_RESET_PCM SOFTRESET_6368_PCM_MASK#define BCM6368_RESET_MPI SOFTRESET_6368_MPI_MASK#define BCM6368_RESET_PCIE 0
arch/powerpc/Makefile +21 -10
@@ -66,29 +66,35 @@ endif UTS_MACHINE := $(OLDARCH) ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) -override CC += -mlittle-endian -ifneq ($(cc-name),clang) -override CC += -mno-strict-align -endif -override AS += -mlittle-endian override LD += -EL -override CROSS32CC += -mlittle-endian override CROSS32AS += -mlittle-endian LDEMULATION := lppc GNUTARGET := powerpcle MULTIPLEWORD := -mno-multiple KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) else -ifeq ($(call cc-option-yn,-mbig-endian),y) -override CC += -mbig-endian -override AS += -mbig-endian -endif override LD += -EB LDEMULATION := ppc GNUTARGET := powerpc MULTIPLEWORD := -mmultiple endif +ifdef CONFIG_PPC64 +cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) +cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mcall-aixdesc) +aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1) +aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2 +endif + +cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian +cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) +ifneq ($(cc-name),clang) + cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align +endif + +aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) +aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian + ifeq ($(HAS_BIARCH),y) override AS += -a$(CONFIG_WORD_SIZE) override LD += -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION)
@@ -121,7 +127,9 @@ ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc)) AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2) else +CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc) +AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1) endif CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc)) CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
@@ -212,6 +220,9 @@ cpu-as-$(CONFIG_E200) += -Wa,-me200 KBUILD_AFLAGS += $(cpu-as-y) KBUILD_CFLAGS += $(cpu-as-y) +KBUILD_AFLAGS += $(aflags-y) +KBUILD_CFLAGS += $(cflags-y) + head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
arch/powerpc/boot/wrapper +23 -1
@@ -161,6 +161,28 @@ case "$elfformat" in elf32-powerpc) format=elf32ppc ;; esac +ld_version() +{ + # Poached from scripts/ld-version.sh, but we don't want to call that because + # this script (wrapper) is distributed separately from the kernel source. + # Extract linker version number from stdin and turn into single number. + awk '{ + gsub(".*\\)", ""); + gsub(".*version ", ""); + gsub("-.*", ""); + split($1,a, "."); + print a[1]*100000000 + a[2]*1000000 + a[3]*10000; + exit + }' +} + +# Do not include PT_INTERP segment when linking pie. Non-pie linking +# just ignores this option. +LD_VERSION=$(${CROSS}ld --version | ld_version) +LD_NO_DL_MIN_VERSION=$(echo 2.26 | ld_version) +if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then + nodl="--no-dynamic-linker" +fi platformo=$object/"$platform".o lds=$object/zImage.lds
@@ -412,7 +434,7 @@ if [ "$platform" != "miboot" ]; then if [ -n "$link_address" ] ; then text_start="-Ttext $link_address" fi - ${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \ + ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" \ $platformo $tmp $object/wrapper.a rm $tmp fi
arch/x86/Kconfig +45 -0
51 lines not on this page · raw message
arch/x86/include/asm/cpufeatures.h +2 -0
@@ -340,5 +340,7 @@#define X86_BUG_MDS X86_BUG(19)/* CPU is affected by Microarchitectural data sampling */ #define X86_BUG_MSBDS_ONLY X86_BUG(20)/* CPU is only affected by the MSDBS variant of BUG_MDS */ #define X86_BUG_SWAPGS X86_BUG(21)/* CPU is affected by speculation through SWAPGS */ +#define X86_BUG_TAA X86_BUG(22)/* CPU is affected by TSX Async Abort(TAA) */ +#define X86_BUG_ITLB_MULTIHIT X86_BUG(23)/* CPU may incur MCE during certain page attribute changes */ #endif /* _ASM_X86_CPUFEATURES_H */
arch/x86/include/asm/kvm_host.h +2 -0
@@ -408,6 +408,7 @@ struct kvm_vcpu_arch {u64 smbase;bool tpr_access_reporting;u64 ia32_xss; +u64 arch_capabilities;/* * Paging state of the vcpu
@@ -1226,6 +1227,7 @@ void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu);void kvm_arch_mmu_notifier_invalidate_page (struct kvm *kvm,unsigned long address); +u64 kvm_get_arch_capabilities (void );void kvm_define_shared_msr (unsigned index,u32 msr);int kvm_set_shared_msr (unsigned index,u64 val,u64 mask);
arch/x86/include/asm/msr-index.h +16 -0
@@ -71,10 +71,26 @@* Microarchitectural Data * Sampling (MDS) vulnerabilities. */ +#define ARCH_CAP_PSCHANGE_MC_NO BIT(6)/* +* The processor is not susceptible to a +* machine check error due to modifying the +* code page size along with either the +* physical address or cache type +* without TLB invalidation. +*/ +#define ARCH_CAP_TSX_CTRL_MSR BIT(7)/* MSR for TSX control is available. */ +#define ARCH_CAP_TAA_NO BIT(8)/* +* Not susceptible to +* TSX Async Abort (TAA) vulnerabilities. +*/ #define MSR_IA32_BBL_CR_CTL 0x00000119#define MSR_IA32_BBL_CR_CTL3 0x0000011e +#define MSR_IA32_TSX_CTRL 0x00000122 +#define TSX_CTRL_RTM_DISABLE BIT(0)/* Disable RTM feature */ +#define TSX_CTRL_CPUID_CLEAR BIT(1)/* Disable TSX enumeration */ +#define MSR_IA32_SYSENTER_CS 0x00000174#define MSR_IA32_SYSENTER_ESP 0x00000175#define MSR_IA32_SYSENTER_EIP 0x00000176
arch/x86/include/asm/nospec-branch.h +2 -2
@@ -268,7 +268,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear);#include <asm/segment.h> /** -* mds_clear_cpu_buffers - Mitigation for MDS vulnerability +* mds_clear_cpu_buffers - Mitigation for MDS and TAA vulnerability * * This uses the otherwise unused and obsolete VERW instruction in * combination with microcode which triggers a CPU buffer flush when the
@@ -291,7 +291,7 @@ static inline void mds_clear_cpu_buffers(void) }/** -* mds_user_clear_cpu_buffers - Mitigation for MDS vulnerability +* mds_user_clear_cpu_buffers - Mitigation for MDS and TAA vulnerability * * Clear CPU buffers if the corresponding static key is enabled */
arch/x86/include/asm/processor.h +7 -0
@@ -852,4 +852,11 @@ enum mds_mitigations { MDS_MITIGATION_VMWERV, }; +enum taa_mitigations { +TAA_MITIGATION_OFF , +TAA_MITIGATION_UCODE_NEEDED , +TAA_MITIGATION_VERW , +TAA_MITIGATION_TSX_DISABLED , +}; +#endif /* _ASM_X86_PROCESSOR_H */
arch/x86/kernel/cpu/Makefile +1 -1
@@ -21,7 +21,7 @@ obj-y += bugs.o obj-$(CONFIG_PROC_FS) += proc.o obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o -obj-$(CONFIG_CPU_SUP_INTEL) += intel.o +obj-$(CONFIG_CPU_SUP_INTEL) += intel.o tsx.o obj-$(CONFIG_CPU_SUP_AMD) += amd.o obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o obj-$(CONFIG_CPU_SUP_CENTAUR) += centaur.o
arch/x86/kernel/cpu/bugs.c +139 -4
203 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +61 -32
144 lines not on this page · raw message
arch/x86/kernel/cpu/cpu.h +18 -0
@@ -44,9 +44,27 @@ struct _tlb_table {extern const struct cpu_dev *const __x86_cpu_dev_start[], *const __x86_cpu_dev_end[]; +#ifdef CONFIG_CPU_SUP_INTEL +enum tsx_ctrl_states { +TSX_CTRL_ENABLE , +TSX_CTRL_DISABLE , +TSX_CTRL_NOT_SUPPORTED , +}; + +extern enum tsx_ctrl_states tsx_ctrl_state; + +extern void __init tsx_init (void ); +extern void tsx_enable (void ); +extern void tsx_disable (void ); +#else +static inline void tsx_init (void ) { } +#endif /* CONFIG_CPU_SUP_INTEL */ +extern void get_cpu_cap (struct cpuinfo_x86 *c);extern void cpu_detect_cache_sizes (struct cpuinfo_x86 *c);extern void x86_spec_ctrl_setup_ap (void ); +extern u64 x86_read_arch_cap_msr (void ); +#endif /* ARCH_X86_CPU_H */
arch/x86/kernel/cpu/intel.c +5 -0
@@ -582,6 +582,11 @@ static void init_intel(struct cpuinfo_x86 *c)detect_vmx_virtcap (c);init_intel_energy_perf (c); + +if (tsx_ctrl_state ==TSX_CTRL_ENABLE ) +tsx_enable (); +if (tsx_ctrl_state ==TSX_CTRL_DISABLE ) +tsx_disable (); }#ifdef CONFIG_X86_32
arch/x86/kernel/cpu/tsx.c new file +140 -0
140 lines not on this page · raw message
arch/x86/kvm/cpuid.c +12 -0
@@ -447,6 +447,18 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, entry->ebx |=F (TSC_ADJUST ); entry->edx &= kvm_cpuid_7_0_edx_x86_features;cpuid_mask (&entry->edx,CPUID_7_EDX ); +if (boot_cpu_has (X86_FEATURE_IBPB ) && +boot_cpu_has (X86_FEATURE_IBRS )) + entry->edx |=F (SPEC_CTRL ); +if (boot_cpu_has (X86_FEATURE_STIBP )) + entry->edx |=F (INTEL_STIBP ); +if (boot_cpu_has (X86_FEATURE_SSBD )) + entry->edx |=F (SPEC_CTRL_SSBD ); +/* +* We emulate ARCH_CAPABILITIES in software even +* if the host doesn't support it. +*/ + entry->edx |=F (ARCH_CAPABILITIES ); }else { entry->ebx =0 ; entry->edx =0 ;
arch/x86/kvm/vmx.c +0 -15
@@ -546,7 +546,6 @@ struct vcpu_vmx {u64 msr_guest_kernel_gs_base;#endif -u64 arch_capabilities;u64 spec_ctrl;u32 vm_entry_controls_shadow;
@@ -2866,12 +2865,6 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) msr_info->data =to_vmx (vcpu)->spec_ctrl;break ; -case MSR_IA32_ARCH_CAPABILITIES : -if (!msr_info->host_initiated && - !guest_cpuid_has_arch_capabilities (vcpu)) -return 1 ; - msr_info->data =to_vmx (vcpu)->arch_capabilities; -break ;case MSR_IA32_SYSENTER_CS : msr_info->data =vmcs_read32 (GUEST_SYSENTER_CS );break ;
@@ -3028,11 +3021,6 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)vmx_disable_intercept_for_msr (vmx->vmcs01.msr_bitmap,MSR_IA32_PRED_CMD ,MSR_TYPE_W );break ; -case MSR_IA32_ARCH_CAPABILITIES : -if (!msr_info->host_initiated) -return 1 ; - vmx->arch_capabilities = data; -break ;case MSR_IA32_CR_PAT :if (vmcs_config.vmentry_ctrl &VM_ENTRY_LOAD_IA32_PAT ) {if (!kvm_mtrr_valid (vcpu,MSR_IA32_CR_PAT , data))
@@ -5079,9 +5067,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) ++vmx->nmsrs; } -if (boot_cpu_has (X86_FEATURE_ARCH_CAPABILITIES )) -rdmsrl (MSR_IA32_ARCH_CAPABILITIES , vmx->arch_capabilities); -vm_exit_controls_init (vmx, vmcs_config.vmexit_ctrl);/* 22.2.1, 20.8.1 */
arch/x86/kvm/x86.c +51 -2
89 lines not on this page · raw message
drivers/base/cpu.c +17 -0
@@ -536,12 +536,27 @@ ssize_t __weak cpu_show_mds(struct device *dev,return sprintf (buf,"Not affected\n" ); } +ssize_t __weak cpu_show_tsx_async_abort (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +return sprintf (buf,"Not affected\n" ); +} + +ssize_t __weak cpu_show_itlb_multihit (struct device *dev, +struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"Not affected\n" ); +} + static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL); static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL); static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL); static DEVICE_ATTR(spec_store_bypass, 0444, cpu_show_spec_store_bypass, NULL); static DEVICE_ATTR(l1tf, 0444, cpu_show_l1tf, NULL); static DEVICE_ATTR(mds, 0444, cpu_show_mds, NULL); +static DEVICE_ATTR(tsx_async_abort, 0444, cpu_show_tsx_async_abort, NULL); +static DEVICE_ATTR(itlb_multihit, 0444, cpu_show_itlb_multihit, NULL);static struct attribute *cpu_root_vulnerabilities_attrs[] = { &dev_attr_meltdown.attr,
@@ -550,6 +565,8 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = { &dev_attr_spec_store_bypass.attr, &dev_attr_l1tf.attr, &dev_attr_mds.attr, + &dev_attr_tsx_async_abort.attr, + &dev_attr_itlb_multihit.attr, NULL };
include/linux/cpu.h +5 -0
@@ -52,6 +52,11 @@ extern ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *buf);extern ssize_t cpu_show_mds (struct device *dev,struct device_attribute *attr,char *buf); +extern ssize_t cpu_show_tsx_async_abort (struct device *dev, +struct device_attribute *attr, +char *buf); +extern ssize_t cpu_show_itlb_multihit (struct device *dev, +struct device_attribute *attr,char *buf); extern __printf(4, 5) struct device *cpu_device_create(struct device *parent, void *drvdata,