Merge 4.14.151 into android-4.14-q
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 30 Oct 2019 08:10:54 +0000 (09:10 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 30 Oct 2019 08:10:54 +0000 (09:10 +0100)
Changes in 4.14.151
scsi: ufs: skip shutdown if hba is not powered
scsi: megaraid: disable device when probe failed after enabled device
scsi: qla2xxx: Fix unbound sleep in fcport delete path.
ARM: OMAP2+: Fix missing reset done flag for am3 and am43
ieee802154: ca8210: prevent memory leak
ARM: dts: am4372: Set memory bandwidth limit for DISPC
net: dsa: qca8k: Use up to 7 ports for all operations
MIPS: dts: ar9331: fix interrupt-controller size
xen/efi: Set nonblocking callbacks
nl80211: fix null pointer dereference
mac80211: fix txq null pointer dereference
mips: Loongson: Fix the link time qualifier of 'serial_exit()'
net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()
r8152: Set macpassthru in reset_resume callback
namespace: fix namespace.pl script to support relative paths
md/raid0: fix warning message for parameter default_layout
Revert "drm/radeon: Fix EEH during kexec"
ocfs2: fix panic due to ocfs2_wq is null
ipv4: Return -ENETUNREACH if we can't create route but saddr is valid
net: bcmgenet: Fix RGMII_MODE_EN value for GENET v1/2/3
net: bcmgenet: Set phydev->dev_flags only for internal PHYs
net: i82596: fix dma_alloc_attr for sni_82596
net: stmmac: disable/enable ptp_ref_clk in suspend/resume flow
sctp: change sctp_prot .no_autobind with true
net: avoid potential infinite loop in tc_ctl_action()
loop: Add LOOP_SET_DIRECT_IO to compat ioctl
memfd: Fix locking when tagging pins
USB: legousbtower: fix memleak on disconnect
ALSA: hda/realtek - Add support for ALC711
usb: udc: lpc32xx: fix bad bit shift operation
USB: serial: ti_usb_3410_5052: fix port-close races
USB: ldusb: fix memleak on disconnect
USB: usblp: fix use-after-free on disconnect
USB: ldusb: fix read info leaks
arm64: sysreg: Move to use definitions for all the SCTLR bits
arm64: Expose support for optional ARMv8-A features
arm64: Fix the feature type for ID register fields
arm64: v8.4: Support for new floating point multiplication instructions
arm64: Documentation: cpu-feature-registers: Remove RES0 fields
arm64: Expose Arm v8.4 features
arm64: move SCTLR_EL{1,2} assertions to <asm/sysreg.h>
arm64: add PSR_AA32_* definitions
arm64: Introduce sysreg_clear_set()
arm64: capabilities: Update prototype for enable call back
arm64: capabilities: Move errata work around check on boot CPU
arm64: capabilities: Move errata processing code
arm64: capabilities: Prepare for fine grained capabilities
arm64: capabilities: Add flags to handle the conflicts on late CPU
arm64: capabilities: Unify the verification
arm64: capabilities: Filter the entries based on a given mask
arm64: capabilities: Prepare for grouping features and errata work arounds
arm64: capabilities: Split the processing of errata work arounds
arm64: capabilities: Allow features based on local CPU scope
arm64: capabilities: Group handling of features and errata workarounds
arm64: capabilities: Introduce weak features based on local CPU
arm64: capabilities: Restrict KPTI detection to boot-time CPUs
arm64: capabilities: Add support for features enabled early
arm64: capabilities: Change scope of VHE to Boot CPU feature
arm64: capabilities: Clean up midr range helpers
arm64: Add helpers for checking CPU MIDR against a range
arm64: Add MIDR encoding for Arm Cortex-A55 and Cortex-A35
arm64: capabilities: Add support for checks based on a list of MIDRs
arm64: KVM: Use SMCCC_ARCH_WORKAROUND_1 for Falkor BP hardening
arm64: don't zero DIT on signal return
arm64: Get rid of __smccc_workaround_1_hvc_*
arm64: cpufeature: Detect SSBS and advertise to userspace
arm64: ssbd: Add support for PSTATE.SSBS rather than trapping to EL3
KVM: arm64: Set SCTLR_EL2.DSSBS if SSBD is forcefully disabled and !vhe
arm64: fix SSBS sanitization
arm64: Add sysfs vulnerability show for spectre-v1
arm64: add sysfs vulnerability show for meltdown
arm64: enable generic CPU vulnerabilites support
arm64: Always enable ssb vulnerability detection
arm64: Provide a command line to disable spectre_v2 mitigation
arm64: Advertise mitigation of Spectre-v2, or lack thereof
arm64: Always enable spectre-v2 vulnerability detection
arm64: add sysfs vulnerability show for spectre-v2
arm64: add sysfs vulnerability show for speculative store bypass
arm64: ssbs: Don't treat CPUs with SSBS as unaffected by SSB
arm64: Force SSBS on context switch
arm64: Use firmware to detect CPUs that are not affected by Spectre-v2
arm64/speculation: Support 'mitigations=' cmdline option
MIPS: tlbex: Fix build_restore_pagemask KScratch restore
staging: wlan-ng: fix exit return when sme->key_idx >= NUM_WEPKEYS
scsi: sd: Ignore a failure to sync cache due to lack of authorization
scsi: core: save/restore command resid for error handling
scsi: core: try to get module before removing device
scsi: ch: Make it possible to open a ch device multiple times again
Input: da9063 - fix capability and drop KEY_SLEEP
Input: synaptics-rmi4 - avoid processing unknown IRQs
ASoC: rsnd: Reinitialize bit clock inversion flag for every format setting
cfg80211: wext: avoid copying malformed SSIDs
mac80211: Reject malformed SSID elements
drm/edid: Add 6 bpc quirk for SDC panel in Lenovo G50
drm/amdgpu: Bail earlier when amdgpu.cik_/si_support is not set to 1
drivers/base/memory.c: don't access uninitialized memmaps in soft_offline_page_store()
fs/proc/page.c: don't access uninitialized memmaps in fs/proc/page.c
scsi: zfcp: fix reaction on bit error threshold notification
mm/slub: fix a deadlock in show_slab_objects()
mm/page_owner: don't access uninitialized memmaps when reading /proc/pagetypeinfo
hugetlbfs: don't access uninitialized memmaps in pfn_range_valid_gigantic()
xtensa: drop EXPORT_SYMBOL for outs*/ins*
parisc: Fix vmap memory leak in ioremap()/iounmap()
CIFS: avoid using MID 0xFFFF
x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area
pinctrl: armada-37xx: fix control of pins 32 and up
pinctrl: armada-37xx: swap polarity on LED group
btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group()
memstick: jmb38x_ms: Fix an error handling path in 'jmb38x_ms_probe()'
cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown
xen/netback: fix error path of xenvif_connect_data()
PCI: PM: Fix pci_power_up()
KVM: X86: introduce invalidate_gpa argument to tlb flush
kvm: vmx: Introduce lapic_mode enumeration
kvm: apic: Flush TLB after APIC mode/address change if VPIDs are in use
kvm: vmx: Basic APIC virtualization controls have three settings
RDMA/cxgb4: Do not dma memory off of the stack
Linux 4.14.151

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
1  2 
Documentation/admin-guide/kernel-parameters.txt
Documentation/arm64/cpu-feature-registers.txt
Makefile
arch/arm64/Kconfig
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c
arch/arm64/kernel/process.c
drivers/cpufreq/cpufreq.c
mm/shmem.c

index 011ddfc1e570f0942f49c772226b801c32c4dc92,7964f03846b1550475e7fbd48bb7f41a5cdb2d9e..6aa3558163c5c190c6ab0d7305c3fb00a3d8dade
@@@ -110,7 -110,9 +110,10 @@@ infrastructure
       x--------------------------------------------------x
       | Name                         |  bits   | visible |
       |--------------------------------------------------|
 +     | RES0                         | [63-48] |    n    |
+      | TS                           | [55-52] |    y    |
+      |--------------------------------------------------|
+      | FHM                          | [51-48] |    y    |
       |--------------------------------------------------|
       | DP                           | [47-44] |    y    |
       |--------------------------------------------------|
diff --cc Makefile
Simple merge
Simple merge
index 7bbbba5ae6813d1bdd1cc12ab0e74343b4e1dc46,50a89bcf9072e7dad38bd03df8a68b224d67aa5d..748b6a701730c63e37d0cdbfd109effa3eab0d6d
  
  #else
  
+ #include <linux/build_bug.h>
  #include <linux/types.h>
  
 -asm(
 -"     .irp    num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30\n"
 -"     .equ    .L__reg_num_x\\num, \\num\n"
 -"     .endr\n"
 +#define __DEFINE_MRS_MSR_S_REGNUM                             \
 +"     .irp    num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30\n" \
 +"     .equ    .L__reg_num_x\\num, \\num\n"                    \
 +"     .endr\n"                                                \
  "     .equ    .L__reg_num_xzr, 31\n"
 -"\n"
 -"     .macro  mrs_s, rt, sreg\n"
 -      __emit_inst(0xd5200000|(\\sreg)|(.L__reg_num_\\rt))
 +
 +#define DEFINE_MRS_S                                          \
 +      __DEFINE_MRS_MSR_S_REGNUM                               \
 +"     .macro  mrs_s, rt, sreg\n"                              \
 +"     .inst 0xd5200000|(\\sreg)|(.L__reg_num_\\rt)\n" \
  "     .endm\n"
 -"\n"
 -"     .macro  msr_s, sreg, rt\n"
 -      __emit_inst(0xd5000000|(\\sreg)|(.L__reg_num_\\rt))
 +
 +#define DEFINE_MSR_S                                          \
 +      __DEFINE_MRS_MSR_S_REGNUM                               \
 +"     .macro  msr_s, sreg, rt\n"                              \
 +"     .inst 0xd5000000|(\\sreg)|(.L__reg_num_\\rt)\n"         \
  "     .endm\n"
 -);
 +
 +#define UNDEFINE_MRS_S                                                \
 +"     .purgem mrs_s\n"
 +
 +#define UNDEFINE_MSR_S                                                \
 +"     .purgem msr_s\n"
 +
 +#define __mrs_s(r, v)                                         \
 +      DEFINE_MRS_S                                            \
 +"     mrs_s %0, " __stringify(r) "\n"                         \
 +      UNDEFINE_MRS_S : "=r" (v)
 +
 +#define __msr_s(r, v)                                         \
 +      DEFINE_MSR_S                                            \
 +"     msr_s " __stringify(r) ", %x0\n"                        \
 +      UNDEFINE_MSR_S : : "rZ" (v)
  
  /*
   * Unlike read_cpuid, calls to read_sysreg are never expected to be
   * For registers without architectural names, or simply unsupported by
   * GAS.
   */
 -#define read_sysreg_s(r) ({                                           \
 -      u64 __val;                                                      \
 -      asm volatile("mrs_s %0, " __stringify(r) : "=r" (__val));       \
 -      __val;                                                          \
 +#define read_sysreg_s(r) ({                                   \
 +      u64 __val;                                              \
 +      asm volatile(__mrs_s(r, __val));                        \
 +      __val;                                                  \
  })
  
 -#define write_sysreg_s(v, r) do {                                     \
 -      u64 __val = (u64)(v);                                           \
 -      asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \
 +#define write_sysreg_s(v, r) do {                             \
 +      u64 __val = (u64)(v);                                   \
 +      asm volatile(__msr_s(r, __val));                        \
  } while (0)
  
+ /*
+  * Modify bits in a sysreg. Bits in the clear mask are zeroed, then bits in the
+  * set mask are set. Other bits are left as-is.
+  */
+ #define sysreg_clear_set(sysreg, clear, set) do {                     \
+       u64 __scs_val = read_sysreg(sysreg);                            \
+       u64 __scs_new = (__scs_val & ~(u64)(clear)) | (set);            \
+       if (__scs_new != __scs_val)                                     \
+               write_sysreg(__scs_new, sysreg);                        \
+ } while (0)
  static inline void config_sctlr_el1(u32 clear, u32 set)
  {
        u32 val;
index 9639ea58035eff0a0851e5624a9ad157de470b0e,15ce2c8b9ee238260689c30a3ffa95153509fe8d..e85cbfd9e4f28e6ed205ff60336d175f48181135
@@@ -107,11 -108,13 +108,18 @@@ cpufeature_pan_not_uao(const struct arm
   * sync with the documentation of the CPU feature register ABI.
   */
  static const struct arm64_ftr_bits ftr_id_aa64isar0[] = {
 +      ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, ID_AA64ISAR0_DP_SHIFT, 4, 0),
 +      ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, ID_AA64ISAR0_SM4_SHIFT, 4, 0),
 +      ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, ID_AA64ISAR0_SM3_SHIFT, 4, 0),
 +      ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, ID_AA64ISAR0_SHA3_SHIFT, 4, 0),
 +      ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, ID_AA64ISAR0_RDM_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_TS_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_FHM_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_DP_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_SM4_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_SM3_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_SHA3_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_RDM_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_ATOMICS_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_CRC32_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR0_SHA2_SHIFT, 4, 0),
@@@ -834,28 -889,12 +894,12 @@@ static bool unmap_kernel_at_el0(const s
                return __kpti_forced > 0;
        }
  
-       /* Useful for KASLR robustness */
-       if (IS_ENABLED(CONFIG_RANDOMIZE_BASE))
-               return true;
-       /* Don't force KPTI for CPUs that are not vulnerable */
-       switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) {
-       case MIDR_CAVIUM_THUNDERX2:
-       case MIDR_BRCM_VULCAN:
-       case MIDR_CORTEX_A53:
-       case MIDR_CORTEX_A55:
-       case MIDR_CORTEX_A57:
-       case MIDR_CORTEX_A72:
-       case MIDR_CORTEX_A73:
-               return false;
-       }
-       /* Defer to CPU feature registers */
-       return !cpuid_feature_extract_unsigned_field(pfr0,
-                                                    ID_AA64PFR0_CSV3_SHIFT);
+       return !meltdown_safe;
  }
  
- static int __nocfi kpti_install_ng_mappings(void *__unused)
+ #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
 -static void
++static void __nocfi
+ kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
  {
        typedef void (kpti_remap_fn)(int, int, phys_addr_t);
        extern kpti_remap_fn idmap_kpti_install_ng_mappings;
index 1ff1c5a670818f3c5b1f9488577d22088601dfbe,9ff64e04e63d66aaed0a537b951138062ad33708..3f037684e1b16477f99314d1404fc5eedc76c7fb
@@@ -69,11 -69,18 +69,18 @@@ static const char *const hwcap_str[] = 
        "fcma",
        "lrcpc",
        "dcpop",
 -      "sha3",
 -      "sm3",
 -      "sm4",
 -      "asimddp",
 -      "sha512",
+       "sve",
+       "asimdfhm",
+       "dit",
+       "uscat",
+       "ilrcpc",
+       "flagm",
+       "ssbs",
 +      "sha3",
 +      "sm3",
 +      "sm4",
 +      "asimddp",
 +      "sha512",
        NULL
  };
  
Simple merge
Simple merge
diff --cc mm/shmem.c
Simple merge