Merge remote-tracking branch 'origin/dev/sumit-linux-3.10.96' into TOT-merge
Sumit Singh [Tue, 1 Mar 2016 09:05:34 +0000 (14:05 +0530)]
Conflicts:
arch/arm/include/asm/memory.h
arch/arm/kernel/module.c
arch/arm/mm/dma-mapping.c
arch/arm/mm/mmu.c
arch/arm64/kernel/setup.c
arch/arm64/kernel/time.c
arch/arm64/mm/mmu.c
drivers/mmc/core/core.c
drivers/regulator/core.c
drivers/usb/class/cdc-acm.c
drivers/video/console/Kconfig
fs/exec.c
fs/proc/task_mmu.c
fs/pstore/ram.c
include/linux/usb/quirks.h
kernel/power/qos.c
net/bluetooth/sco.c

Change-Id: I49c5d0d88a85f6fd120f01db7170744cf91459d5
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>

168 files changed:
1  2 
Makefile
arch/arc/kernel/signal.c
arch/arm/Makefile
arch/arm/include/asm/atomic.h
arch/arm/include/asm/elf.h
arch/arm/include/asm/memory.h
arch/arm/include/asm/pgtable-3level-hwdef.h
arch/arm/include/asm/pgtable-3level.h
arch/arm/include/asm/pgtable.h
arch/arm/kernel/entry-armv.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/fiq.c
arch/arm/kernel/module.c
arch/arm/mach-dove/common.c
arch/arm/mach-kirkwood/common.c
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-orion5x/common.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/poodle.c
arch/arm/mm/dma-mapping.c
arch/arm/mm/proc-v7-3level.S
arch/arm64/Kconfig
arch/arm64/include/asm/cputype.h
arch/arm64/include/asm/ptrace.h
arch/arm64/kernel/head.S
arch/arm64/kernel/ptrace.c
arch/arm64/kernel/setup.c
arch/arm64/kernel/signal32.c
arch/arm64/kernel/smp.c
arch/arm64/kernel/stacktrace.c
arch/arm64/kernel/vdso/Makefile
arch/arm64/mm/fault.c
arch/arm64/mm/init.c
arch/arm64/mm/mmap.c
arch/arm64/mm/mmu.c
arch/mips/kernel/signal32.c
arch/mn10300/Kconfig
arch/powerpc/kernel/signal_32.c
arch/x86/Kconfig
arch/x86/kernel/reboot.c
arch/x86/kernel/signal.c
arch/x86/pci/acpi.c
block/genhd.c
drivers/ata/libata-eh.c
drivers/base/devres.c
drivers/base/firmware_class.c
drivers/base/platform.c
drivers/base/regmap/regmap.c
drivers/cpufreq/speedstep-smi.c
drivers/cpuidle/cpuidle.c
drivers/cpuidle/governors/menu.c
drivers/gpio/gpiolib.c
drivers/hid/hid-core.c
drivers/hid/hid-input.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/usbhid/hid-core.c
drivers/i2c/i2c-core.c
drivers/media/rc/rc-main.c
drivers/mmc/card/block.c
drivers/mmc/card/queue.c
drivers/mmc/card/queue.h
drivers/mmc/core/core.c
drivers/mtd/mtd_blkdevs.c
drivers/net/ethernet/realtek/r8169.c
drivers/net/usb/usbnet.c
drivers/of/address.c
drivers/pci/pci-driver.c
drivers/pci/quirks.c
drivers/pinctrl/core.c
drivers/pinctrl/core.h
drivers/regulator/core.c
drivers/scsi/hpsa.c
drivers/scsi/scsi_error.c
drivers/spi/spi.c
drivers/spi/spidev.c
drivers/staging/ozwpan/ozusbsvc1.c
drivers/tty/serial/of_serial.c
drivers/tty/tty_io.c
drivers/tty/vt/vt.c
drivers/usb/class/cdc-acm.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/phy/phy.c
drivers/xen/gntdev.c
fs/binfmt_elf.c
fs/btrfs/super.c
fs/debugfs/inode.c
fs/exec.c
fs/exportfs/expfs.c
fs/ext4/extents.c
fs/ext4/mballoc.c
fs/ext4/super.c
fs/fuse/dev.c
fs/fuse/inode.c
fs/hpfs/super.c
fs/inode.c
fs/nfs/inode.c
fs/nfs/nfs4proc.c
fs/proc/task_mmu.c
fs/pstore/inode.c
include/linux/fs.h
include/linux/iio/iio.h
include/linux/interrupt.h
include/linux/kernel.h
include/linux/mm.h
include/linux/sched.h
include/linux/security.h
include/linux/syscalls.h
include/linux/usb.h
include/linux/usb/hcd.h
include/linux/usb/quirks.h
include/net/ip.h
include/net/ipv6.h
include/net/netns/ipv4.h
include/net/sock.h
kernel/cgroup.c
kernel/fork.c
kernel/module.c
kernel/power/qos.c
kernel/printk.c
kernel/ptrace.c
kernel/signal.c
kernel/smpboot.c
kernel/trace/trace.c
kernel/trace/trace.h
kernel/trace/trace_events.c
mm/compaction.c
mm/filemap.c
mm/hugetlb.c
mm/ksm.c
mm/memory.c
mm/mmap.c
mm/vmscan.c
net/bluetooth/sco.c
net/core/fib_rules.c
net/core/sock.c
net/ipv4/af_inet.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipmr.c
net/ipv4/ping.c
net/ipv4/route.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c
net/ipv4/udp.c
net/ipv6/af_inet6.c
net/ipv6/datagram.c
net/ipv6/ip6mr.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/mac80211/ieee80211_i.h
net/netlink/af_netlink.c
net/phonet/af_phonet.c
net/socket.c
net/unix/af_unix.c
net/wireless/nl80211.c
scripts/recordmcount.pl
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_intel.c
sound/soc/codecs/wm8903.c
sound/soc/soc-compress.c
virt/kvm/kvm_main.c

diff --cc Makefile
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  #define page_to_phys(page)    (__pfn_to_phys(page_to_pfn(page)))
  #define phys_to_page(phys)    (pfn_to_page(__phys_to_pfn(phys)))
  
+ /*
+  * PLAT_PHYS_OFFSET is the offset (from zero) of the start of physical
+  * memory.  This is used for XIP and NoMMU kernels, or by kernels which
+  * have their own mach/memory.h.  Assembly code must always use
+  * PLAT_PHYS_OFFSET and not PHYS_OFFSET.
+  */
+ #ifndef PLAT_PHYS_OFFSET
+ #define PLAT_PHYS_OFFSET      UL(CONFIG_PHYS_OFFSET)
+ #endif
 +/* Max physical memory supported (used in zsmalloc allocator) */
 +#ifndef MAX_PHYSMEM_BITS
 +#ifdef CONFIG_ARM_LPAE
 +#define MAX_PHYSMEM_BITS      40
 +#else /* !CONFIG_ARM_LPAE */
 +#define MAX_PHYSMEM_BITS      32
 +#endif
 +#endif
 +
  #ifndef __ASSEMBLY__
  
  /*
  #define L_PTE_SHARED          (_AT(pteval_t, 3) << 8)         /* SH[1:0], inner shareable */
  #define L_PTE_YOUNG           (_AT(pteval_t, 1) << 10)        /* AF */
  #define L_PTE_XN              (_AT(pteval_t, 1) << 54)        /* XN */
- #define L_PTE_DIRTY           (_AT(pteval_t, 1) << 55)        /* unused */
- #define L_PTE_SPECIAL         (_AT(pteval_t, 1) << 56)        /* unused */
+ #define L_PTE_DIRTY           (_AT(pteval_t, 1) << 55)
+ #define L_PTE_SPECIAL         (_AT(pteval_t, 1) << 56)
  #define L_PTE_NONE            (_AT(pteval_t, 1) << 57)        /* PROT_NONE */
+ #define L_PTE_RDONLY          (_AT(pteval_t, 1) << 58)        /* READ ONLY */
  
 +#define PMD_SECT_VALID                (_AT(pmdval_t, 1) << 0)
 +#define PMD_SECT_DIRTY                (_AT(pmdval_t, 1) << 55)
 +#define PMD_SECT_SPLITTING    (_AT(pmdval_t, 1) << 56)
 +#define PMD_SECT_NONE         (_AT(pmdval_t, 1) << 57)
 +
  /*
   * To be used in assembly code with the upper page attributes.
   */
@@@ -172,66 -166,25 +172,83 @@@ static inline pmd_t *pmd_offset(pud_t *
                clean_pmd_entry(pmdp);  \
        } while (0)
  
+ /*
+  * For 3 levels of paging the PTE_EXT_NG bit will be set for user address ptes
+  * that are written to a page table but not for ptes created with mk_pte.
+  *
+  * In hugetlb_no_page, a new huge pte (new_pte) is generated and passed to
+  * hugetlb_cow, where it is compared with an entry in a page table.
+  * This comparison test fails erroneously leading ultimately to a memory leak.
+  *
+  * To correct this behaviour, we mask off PTE_EXT_NG for any pte that is
+  * present before running the comparison.
+  */
+ #define __HAVE_ARCH_PTE_SAME
+ #define pte_same(pte_a,pte_b) ((pte_present(pte_a) ? pte_val(pte_a) & ~PTE_EXT_NG     \
+                                       : pte_val(pte_a))                               \
+                               == (pte_present(pte_b) ? pte_val(pte_b) & ~PTE_EXT_NG   \
+                                       : pte_val(pte_b)))
  #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,__pte(pte_val(pte)|(ext)))
  
 +#define pte_huge(pte)         (pte_val(pte) && !(pte_val(pte) & PTE_TABLE_BIT))
 +#define pte_mkhuge(pte)               (__pte(pte_val(pte) & ~PTE_TABLE_BIT))
 +
 +#define pmd_young(pmd)                (pmd_val(pmd) & PMD_SECT_AF)
 +
 +#define __HAVE_ARCH_PMD_WRITE
 +#define pmd_write(pmd)                (!(pmd_val(pmd) & PMD_SECT_RDONLY))
 +
 +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 +#define pmd_trans_huge(pmd)   (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT))
 +#define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING)
 +#endif
 +
 +#define PMD_BIT_FUNC(fn,op) \
 +static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; }
 +
 +PMD_BIT_FUNC(wrprotect,       |= PMD_SECT_RDONLY);
 +PMD_BIT_FUNC(mkold,   &= ~PMD_SECT_AF);
 +PMD_BIT_FUNC(mksplitting, |= PMD_SECT_SPLITTING);
 +PMD_BIT_FUNC(mkwrite,   &= ~PMD_SECT_RDONLY);
 +PMD_BIT_FUNC(mkdirty,   |= PMD_SECT_DIRTY);
 +PMD_BIT_FUNC(mkyoung,   |= PMD_SECT_AF);
 +
 +#define pmd_mkhuge(pmd)               (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT))
 +
 +#define pmd_pfn(pmd)          (((pmd_val(pmd) & PMD_MASK) & PHYS_MASK) >> PAGE_SHIFT)
 +#define pfn_pmd(pfn,prot)     (__pmd(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))
 +#define mk_pmd(page,prot)     pfn_pmd(page_to_pfn(page),prot)
 +
 +/* represent a notpresent pmd by zero, this is used by pmdp_invalidate */
 +#define pmd_mknotpresent(pmd) (__pmd(0))
 +
 +static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
 +{
 +      const pmdval_t mask = PMD_SECT_USER | PMD_SECT_XN | PMD_SECT_RDONLY |
 +                              PMD_SECT_VALID | PMD_SECT_NONE;
 +      pmd_val(pmd) = (pmd_val(pmd) & ~mask) | (pgprot_val(newprot) & mask);
 +      return pmd;
 +}
 +
 +static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr,
 +                            pmd_t *pmdp, pmd_t pmd)
 +{
 +      BUG_ON(addr >= TASK_SIZE);
 +
 +      /* create a faulting entry if PROT_NONE protected */
 +      if (pmd_val(pmd) & PMD_SECT_NONE)
 +              pmd_val(pmd) &= ~PMD_SECT_VALID;
 +
 +      *pmdp = __pmd(pmd_val(pmd) | PMD_SECT_nG);
 +      flush_pmd_entry(pmdp);
 +}
 +
 +static inline int has_transparent_hugepage(void)
 +{
 +      return 1;
 +}
 +
  #endif /* __ASSEMBLY__ */
  
  #endif /* _ASM_PGTABLE_3LEVEL_H */
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -431,10 -423,19 +431,16 @@@ void __init dma_contiguous_remap(void
                if (start >= end)
                        continue;
  
 -              map.pfn = __phys_to_pfn(start);
 -              map.virtual = __phys_to_virt(start);
 -              map.length = end - start;
 -              map.type = MT_MEMORY_DMA_READY;
 +              map.type = MT_MEMORY;
  
                /*
-                * Clear previous low-memory mapping
+                * Clear previous low-memory mapping to ensure that the
+                * TLB does not see any conflicting entries, then flush
+                * the TLB of the old entries before creating new mappings.
+                *
+                * This ensures that any speculatively loaded TLB entries
+                * (even though they may be rare) can not cause any problems,
+                * and ensures that this code is architecturally compliant.
                 */
                for (addr = __phys_to_virt(start); addr < __phys_to_virt(end);
                     addr += PMD_SIZE)
Simple merge
Simple merge
@@@ -98,9 -71,11 +98,11 @@@ static inline unsigned int __attribute_
  
  static inline u32 __attribute_const__ read_cpuid_cachetype(void)
  {
 -      return read_cpuid(ID_CTR_EL0);
 +      return read_cpuid(CTR_EL0);
  }
  
+ void cpuinfo_store_cpu(void);
  #endif /* __ASSEMBLY__ */
  
  #endif
Simple merge
Simple merge
   */
  void ptrace_disable(struct task_struct *child)
  {
+       /*
+        * This would be better off in core code, but PTRACE_DETACH has
+        * grown its fair share of arch-specific worts and changing it
+        * is likely to cause regressions on obscure architectures.
+        */
+       user_disable_single_step(child);
  }
  
 -/*
 - * Handle hitting a breakpoint.
 - */
 -static int ptrace_break(struct pt_regs *regs)
 -{
 -      siginfo_t info = {
 -              .si_signo = SIGTRAP,
 -              .si_errno = 0,
 -              .si_code  = TRAP_BRKPT,
 -              .si_addr  = (void __user *)instruction_pointer(regs),
 -      };
 -
 -      force_sig_info(SIGTRAP, &info, current);
 -      return 0;
 -}
 -
 -static int arm64_break_trap(unsigned long addr, unsigned int esr,
 -                          struct pt_regs *regs)
 -{
 -      return ptrace_break(regs);
 -}
 -
  #ifdef CONFIG_HAVE_HW_BREAKPOINT
  /*
   * Handle hitting a HW-breakpoint.
@@@ -41,7 -41,8 +41,9 @@@
  #include <linux/memblock.h>
  #include <linux/of_fdt.h>
  #include <linux/of_platform.h>
+ #include <linux/personality.h>
 +#include <asm/cpu.h>
  #include <asm/cputype.h>
  #include <asm/elf.h>
  #include <asm/cputable.h>
@@@ -291,11 -140,9 +293,13 @@@ static void __init setup_machine_fdt(ph
  {
        struct boot_param_header *devtree;
        unsigned long dt_root;
 +#ifdef CONFIG_ARM64_MACH_FRAMEWORK
 +      struct machine_desc *mdesc, *mdesc_best = NULL;
 +      unsigned int score, mdesc_score = ~1;
 +#endif
  
+       cpuinfo_store_cpu();
        /* Check we have a non-NULL DT pointer */
        if (!dt_phys) {
                early_print("\n"
@@@ -525,25 -326,41 +529,49 @@@ static const char *hwcap_str[] = 
        NULL
  };
  
 +static void denver_show(struct seq_file *m)
 +{
 +      u32 aidr;
 +
 +      asm volatile("mrs %0, AIDR_EL1" : "=r" (aidr) : );
 +      seq_printf(m, "MTS version\t: %u\n", aidr);
 +}
 +
+ #ifdef CONFIG_COMPAT
+ static const char *compat_hwcap_str[] = {
+       "swp",
+       "half",
+       "thumb",
+       "26bit",
+       "fastmult",
+       "fpa",
+       "vfp",
+       "edsp",
+       "java",
+       "iwmmxt",
+       "crunch",
+       "thumbee",
+       "neon",
+       "vfpv3",
+       "vfpv3d16",
+       "tls",
+       "vfpv4",
+       "idiva",
+       "idivt",
+       "vfpd32",
+       "lpae",
+       "evtstrm"
+ };
+ #endif /* CONFIG_COMPAT */
  static int c_show(struct seq_file *m, void *v)
  {
-       int i;
-       struct cpu_info *cpu_info;
-       cpu_info = lookup_processor_type(read_cpuid_id());
-       seq_printf(m, "Processor\t: %s rev %d (%s)\n",
-                  cpu_info->cpu_name, read_cpuid_id() & 15, ELF_PLATFORM);
+       int i, j;
  
        for_each_online_cpu(i) {
+               struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
+               u32 midr = cpuinfo->reg_midr;
                /*
                 * glibc reads /proc/cpuinfo to determine the number of
                 * online processors, looking for lines beginning with
  #ifdef CONFIG_SMP
                seq_printf(m, "processor\t: %d\n", i);
  #endif
-       }
+               seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
+                          loops_per_jiffy / (500000UL/HZ),
+                          loops_per_jiffy / (5000UL/HZ) % 100);
  
-       /* dump out the processor features */
-       seq_puts(m, "Features\t: ");
-       for (i = 0; hwcap_str[i]; i++)
-               if (elf_hwcap & (1 << i))
-                       seq_printf(m, "%s ", hwcap_str[i]);
- #ifdef CONFIG_ARMV7_COMPAT_CPUINFO
-       if (is_compat_task()) {
-               /* Print out the non-optional ARMv8 HW capabilities */
-               seq_printf(m, "wp half thumb fastmult vfp edsp neon vfpv3 tlsi ");
-               seq_printf(m, "vfpv4 idiva idivt ");
-       }
- #endif
-       seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
-       seq_printf(m, "CPU architecture: %s\n",
- #if IS_ENABLED(CONFIG_ARMV7_COMPAT_CPUINFO)
-                       is_compat_task() ? "8" :
- #endif
-                       "AArch64");
-       seq_printf(m, "CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15);
-       seq_printf(m, "CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff);
-       seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
+               /*
+                * Dump out the common processor features in a single line.
+                * Userspace should read the hwcaps with getauxval(AT_HWCAP)
+                * rather than attempting to parse this, but there's a body of
+                * software which does already (at least for 32-bit).
+                */
+               seq_puts(m, "Features\t:");
+               if (personality(current->personality) == PER_LINUX32) {
+ #ifdef CONFIG_COMPAT
+                       for (j = 0; compat_hwcap_str[j]; j++)
+                               if (COMPAT_ELF_HWCAP & (1 << j))
+                                       seq_printf(m, " %s", compat_hwcap_str[j]);
+ #endif /* CONFIG_COMPAT */
+               } else {
+                       for (j = 0; hwcap_str[j]; j++)
+                               if (elf_hwcap & (1 << j))
+                                       seq_printf(m, " %s", hwcap_str[j]);
+               }
+               seq_puts(m, "\n");
  
-       seq_puts(m, "\n");
+               seq_printf(m, "CPU implementer\t: 0x%02x\n", (midr >> 24));
+               seq_printf(m, "CPU architecture: 8\n");
+               seq_printf(m, "CPU variant\t: 0x%x\n", ((midr >> 20) & 0xf));
+               seq_printf(m, "CPU part\t: 0x%03x\n", ((midr >> 4) & 0xfff));
+               seq_printf(m, "CPU revision\t: %d\n\n", (midr & 0xf));
+       }
  
 +      seq_printf(m, "Hardware\t: %s\n", machine_name);
 +      seq_printf(m, "Revision\t: %04x\n", system_rev);
 +      seq_printf(m, "Serial\t\t: %08x%08x\n",
 +                 system_serial_high, system_serial_low);
 +
 +      if ((read_cpuid_id() >> 24) == 'N')
 +              denver_show(m);
        return 0;
  }
  
@@@ -181,16 -209,8 +181,16 @@@ int copy_siginfo_to_user32(compat_sigin
        case __SI_MESGQ: /* But this is */
                err |= __put_user(from->si_pid, &to->si_pid);
                err |= __put_user(from->si_uid, &to->si_uid);
-               err |= __put_user((compat_uptr_t)(unsigned long)from->si_ptr, &to->si_ptr);
+               err |= __put_user(from->si_int, &to->si_int);
                break;
 +#ifdef __ARCH_SIGSYS
 +      case __SI_SYS:
 +              err |= __put_user((compat_uptr_t)(unsigned long)
 +                              from->si_call_addr, &to->si_call_addr);
 +              err |= __put_user(from->si_syscall, &to->si_syscall);
 +              err |= __put_user(from->si_arch, &to->si_arch);
 +              break;
 +#endif
        default: /* this is just in case for now ... */
                err |= __put_user(from->si_pid, &to->si_pid);
                err |= __put_user(from->si_uid, &to->si_uid);
@@@ -170,24 -188,23 +170,29 @@@ asmlinkage void __cpuinit secondary_sta
        trace_hardirqs_off();
  
        /*
 -       * Let the primary processor know we're out of the
 -       * pen, then head off into the C entry point
 +       * Give the platform a chance to do its own initialisation.
 +       */
 +      platform_secondary_init(cpu);
 +
 +      if (cpu_ops[cpu]->cpu_postboot)
 +              cpu_ops[cpu]->cpu_postboot();
 +
 +      /*
 +       * Log the CPU info before it is marked online and might get read.
         */
 -      write_pen_release(INVALID_HWID);
 +      cpuinfo_store_cpu();
  
        /*
 -       * Synchronise with the boot thread.
 +       * Enable GIC and timers.
         */
 -      raw_spin_lock(&boot_lock);
 -      raw_spin_unlock(&boot_lock);
 +      notify_cpu_starting(cpu);
  
        /*
+        * Log the CPU info before it is marked online and might get read.
+        */
+       cpuinfo_store_cpu();
+       /*
         * OK, now it's safe to let the boot CPU continue.  Wait for
         * the CPU migration code to notice that the CPU is online
         * before we continue.
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -470,8 -346,11 +470,11 @@@ void __init paging_init(void
  
        bootmem_init();
  
 -      empty_zero_page = virt_to_page(zero_page);
  
 +      dma_contiguous_remap();
+       /* Ensure the zero page is visible to the page table walker */
+       dsb();
        /*
         * TTBR0 is only used for the identity mapping at this stage. Make it
         * point to zero page to avoid speculatively fetching new entries.
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc block/genhd.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -754,13 -327,10 +754,13 @@@ EXPORT_SYMBOL(mmc_start_bkops)
   */
  static void mmc_wait_data_done(struct mmc_request *mrq)
  {
 +      unsigned long flags;
        struct mmc_context_info *context_info = &mrq->host->context_info;
  
 +      spin_lock_irqsave(&context_info->lock, flags);
-       mrq->host->context_info.is_done_rcv = true;
-       wake_up_interruptible(&mrq->host->context_info.wait);
+       context_info->is_done_rcv = true;
+       wake_up_interruptible(&context_info->wait);
 +      spin_unlock_irqrestore(&context_info->lock, flags);
  }
  
  static void mmc_wait_done(struct mmc_request *mrq)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -944,8 -769,7 +944,8 @@@ static int suspend_prepare(struct regul
  static void print_constraints(struct regulator_dev *rdev)
  {
        struct regulation_constraints *constraints = rdev->constraints;
 +      unsigned int ramp_delay = 0;
-       char buf[110] = "";
+       char buf[160] = "";
        int count = 0;
        int ret;
  
@@@ -1916,13 -1594,14 +1918,15 @@@ static int _regulator_do_enable(struct 
        }
  
        trace_regulator_enable(rdev_get_name(rdev));
 +      _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_ENABLE, NULL);
  
        if (rdev->ena_pin) {
-               ret = regulator_ena_gpio_ctrl(rdev, true);
-               if (ret < 0)
-                       return ret;
-               rdev->ena_gpio_state = 1;
+               if (!rdev->ena_gpio_state) {
+                       ret = regulator_ena_gpio_ctrl(rdev, true);
+                       if (ret < 0)
+                               return ret;
+                       rdev->ena_gpio_state = 1;
+               }
        } else if (rdev->desc->ops->enable) {
                ret = rdev->desc->ops->enable(rdev);
                if (ret < 0)
@@@ -2045,12 -1703,12 +2049,14 @@@ static int _regulator_do_disable(struc
        trace_regulator_disable(rdev_get_name(rdev));
  
        if (rdev->ena_pin) {
-               ret = regulator_ena_gpio_ctrl(rdev, false);
-               if (ret < 0) {
-                       rdev_err(rdev, "gpio_cntrl failed: %d\n", ret);
-                       return ret;
+               if (rdev->ena_gpio_state) {
+                       ret = regulator_ena_gpio_ctrl(rdev, false);
 -                      if (ret < 0)
++                      if (ret < 0) {
++                              rdev_err(rdev, "gpio_cntrl failed: %d\n", ret);
+                               return ret;
++                      }
+                       rdev->ena_gpio_state = 0;
                }
-               rdev->ena_gpio_state = 0;
  
        } else if (rdev->desc->ops->disable) {
                ret = rdev->desc->ops->disable(rdev);
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -399,11 -380,17 +403,16 @@@ void oz_usb_rx(struct oz_pd *pd, struc
        case OZ_GET_DESC_RSP: {
                        struct oz_get_desc_rsp *body =
                                (struct oz_get_desc_rsp *)usb_hdr;
-                       int data_len = elt->length -
-                                       sizeof(struct oz_get_desc_rsp) + 1;
-                       u16 offs = le16_to_cpu(get_unaligned(&body->offset));
-                       u16 total_size =
+                       u16 offs, total_size;
+                       u8 data_len;
+                       if (elt->length < sizeof(struct oz_get_desc_rsp) - 1)
+                               break;
+                       data_len = elt->length -
+                                       (sizeof(struct oz_get_desc_rsp) - 1);
+                       offs = le16_to_cpu(get_unaligned(&body->offset));
+                       total_size =
                                le16_to_cpu(get_unaligned(&body->total_size));
 -                      oz_trace("USB_REQ_GET_DESCRIPTOR - cnf\n");
                        oz_hcd_get_desc_cnf(usb_ctx->hport, body->req_id,
                                        body->rcode, body->data,
                                        data_len, offs, total_size);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -278,10 -280,8 +280,11 @@@ struct xhci_op_regs 
  #define XDEV_U0               (0x0 << 5)
  #define XDEV_U2               (0x2 << 5)
  #define XDEV_U3               (0x3 << 5)
+ #define XDEV_INACTIVE (0x6 << 5)
  #define XDEV_RESUME   (0xf << 5)
 +#define XDEV_DISABLED (0x4 << 5)
 +#define XDEV_RXDETECT (0x5 << 5)
 +#define XDEV_POLLING  (0x7 << 5)
  /* true: port has power (see HCC_PPC) */
  #define PORT_POWER    (1 << 9)
  /* bits 10:13 indicate device speed:
Simple merge
Simple merge
diff --cc fs/binfmt_elf.c
Simple merge
Simple merge
Simple merge
diff --cc fs/exec.c
+++ b/fs/exec.c
@@@ -1265,6 -1265,53 +1265,53 @@@ static int check_unsafe_exec(struct lin
        return res;
  }
  
+ static void bprm_fill_uid(struct linux_binprm *bprm)
+ {
+       struct inode *inode;
+       unsigned int mode;
+       kuid_t uid;
+       kgid_t gid;
+       /* clear any previous set[ug]id data from a previous binary */
+       bprm->cred->euid = current_euid();
+       bprm->cred->egid = current_egid();
+       if (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)
+               return;
 -      if (current->no_new_privs)
++      if (task_no_new_privs(current))
+               return;
+       inode = file_inode(bprm->file);
+       mode = ACCESS_ONCE(inode->i_mode);
+       if (!(mode & (S_ISUID|S_ISGID)))
+               return;
+       /* Be careful if suid/sgid is set */
+       mutex_lock(&inode->i_mutex);
+       /* reload atomically mode/uid/gid now that lock held */
+       mode = inode->i_mode;
+       uid = inode->i_uid;
+       gid = inode->i_gid;
+       mutex_unlock(&inode->i_mutex);
+       /* We ignore suid/sgid if there are no mappings for them in the ns */
+       if (!kuid_has_mapping(bprm->cred->user_ns, uid) ||
+                !kgid_has_mapping(bprm->cred->user_ns, gid))
+               return;
+       if (mode & S_ISUID) {
+               bprm->per_clear |= PER_CLEAR_ON_SETID;
+               bprm->cred->euid = uid;
+       }
+       if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
+               bprm->per_clear |= PER_CLEAR_ON_SETID;
+               bprm->cred->egid = gid;
+       }
+ }
  /* 
   * Fill the binprm structure from the inode. 
   * Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
Simple merge
Simple merge
Simple merge
diff --cc fs/ext4/super.c
Simple merge
diff --cc fs/fuse/dev.c
Simple merge
diff --cc fs/fuse/inode.c
Simple merge
diff --cc fs/hpfs/super.c
Simple merge
diff --cc fs/inode.c
Simple merge
diff --cc fs/nfs/inode.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
  /* device generates spurious wakeup, ignore remote wakeup capability */
  #define USB_QUIRK_IGNORE_REMOTE_WAKEUP        0x00000200
  
 +#define USB_QUIRK_OTG_COMPLIANCE      0x00000080
 +
 +/* device can handle u1/u2 power states well */
 +#define USB_QUIRK_ENABLE_U1U2         0x00000400
 +
+ /* device can't handle Link Power Management */
+ #define USB_QUIRK_NO_LPM                      BIT(10)
  #endif /* __LINUX_USB_QUIRKS_H */
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/cgroup.c
Simple merge
diff --cc kernel/fork.c
Simple merge
diff --cc kernel/module.c
Simple merge
Simple merge
diff --cc kernel/printk.c
Simple merge
diff --cc kernel/ptrace.c
Simple merge
diff --cc kernel/signal.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc mm/compaction.c
Simple merge
diff --cc mm/filemap.c
Simple merge
diff --cc mm/hugetlb.c
Simple merge
diff --cc mm/ksm.c
Simple merge
diff --cc mm/memory.c
Simple merge
diff --cc mm/mmap.c
Simple merge
diff --cc mm/vmscan.c
Simple merge
@@@ -459,10 -456,9 +459,13 @@@ static int sco_sock_bind(struct socket 
        if (!addr || addr->sa_family != AF_BLUETOOTH)
                return -EINVAL;
  
 -      if (addr_len < sizeof(struct sockaddr_sco))
++      if (alen < sizeof(struct sockaddr_sco))
+               return -EINVAL;
 +      memset(&sa, 0, sizeof(sa));
 +      len = min_t(unsigned int, sizeof(sa), alen);
 +      memcpy(&sa, addr, len);
 +
        lock_sock(sk);
  
        if (sk->sk_state != BT_OPEN) {
Simple merge
diff --cc net/core/sock.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/ipmr.c
Simple merge
diff --cc net/ipv4/ping.c
@@@ -974,10 -718,14 +974,13 @@@ void ping_rcv(struct sk_buff *skb
        /* Push ICMP header back */
        skb_push(skb, skb->data - (u8 *)icmph);
  
 -      sk = ping_v4_lookup(net, saddr, daddr, ntohs(icmph->un.echo.id),
 -                          skb->dev->ifindex);
 +      sk = ping_lookup(net, skb, ntohs(icmph->un.echo.id));
        if (sk != NULL) {
+               struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
                pr_debug("rcv on socket %p\n", sk);
-               ping_queue_rcv_skb(sk, skb_get(skb));
+               if (skb2)
+                       ping_queue_rcv_skb(sk, skb2);
                sock_put(sk);
                return;
        }
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv4/udp.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv6/udp.c
Simple merge
Simple merge
Simple merge
@@@ -439,8 -376,11 +439,12 @@@ static int phonet_rcv(struct sk_buff *s
        struct phonethdr *ph;
        struct sockaddr_pn sa;
        u16 len;
 +      int i;
  
+       skb = skb_share_check(skb, GFP_ATOMIC);
+       if (!skb)
+               return NET_RX_DROP;
        /* check we have at least a full Phonet header */
        if (!pskb_pull(skb, sizeof(struct phonethdr)))
                goto out;
diff --cc net/socket.c
Simple merge
@@@ -1897,8 -2055,12 +2056,12 @@@ static long unix_stream_data_wait(struc
  
                set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
                unix_state_unlock(sk);
 -              timeo = schedule_timeout(timeo);
 +              timeo = freezable_schedule_timeout(timeo);
                unix_state_lock(sk);
+               if (sock_flag(sk, SOCK_DEAD))
+                       break;
                clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags);
        }
  
Simple merge
Simple merge
Simple merge
@@@ -1226,19 -1096,44 +1226,49 @@@ static unsigned int azx_get_response(st
                                     unsigned int addr)
  {
        struct azx *chip = bus->private_data;
 +      unsigned int ret = 0;
        if (chip->disabled)
 -              return 0;
 +              return ret;
 +      pm_runtime_get_sync(chip->dev);
        if (chip->single_cmd)
 -              return azx_single_get_response(bus, addr);
 +              ret = azx_single_get_response(bus, addr);
        else
 -              return azx_rirb_get_response(bus, addr);
 +              ret = azx_rirb_get_response(bus, addr);
 +      pm_runtime_put(chip->dev);
 +
 +      return ret;
  }
  
+ #ifdef CONFIG_PM_SLEEP
+ /* put codec down to D3 at hibernation for Intel SKL+;
+  * otherwise BIOS may still access the codec and screw up the driver
+  */
+ #define IS_SKL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa170)
+ #define IS_SKL_LP(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x9d70)
+ #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98)
+ #define IS_SKL_PLUS(pci) (IS_SKL(pci) || IS_SKL_LP(pci) || IS_BXT(pci))
+ static int azx_freeze_noirq(struct device *dev)
+ {
+       struct pci_dev *pci = to_pci_dev(dev);
+       if (IS_SKL_PLUS(pci))
+               pci_set_power_state(pci, PCI_D3hot);
+       return 0;
+ }
+ static int azx_thaw_noirq(struct device *dev)
+ {
+       struct pci_dev *pci = to_pci_dev(dev);
+       if (IS_SKL_PLUS(pci))
+               pci_set_power_state(pci, PCI_D0);
+       return 0;
+ }
+ #endif /* CONFIG_PM_SLEEP */
  #ifdef CONFIG_PM
  static void azx_power_notify(struct hda_bus *bus, bool power_up);
  #endif
Simple merge
@@@ -698,9 -382,9 +698,10 @@@ int soc_new_compress(struct snd_soc_pcm
        struct snd_soc_dai *codec_dai = rtd->codec_dai;
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
        struct snd_compr *compr;
 +      struct snd_pcm *be_pcm;
        char new_name[64];
        int ret = 0, direction = 0;
+       int playback = 0, capture = 0;
  
        /* check client and interface hw capabilities */
        snprintf(new_name, sizeof(new_name), "%s %s-%d",
Simple merge