1. 13 Jan, 2016 2 commits
    • CQ Tang's avatar
      iommu/vt-d: Fix 64-bit accesses to 32-bit DMAR_GSTS_REG · fda3bec1
      CQ Tang authored
      This is a 32-bit register. Apparently harmless on real hardware, but
      causing justified warnings in simulation.
      Signed-off-by: default avatarCQ Tang <cq.tang@intel.com>
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@vger.kernel.org
      fda3bec1
    • David Woodhouse's avatar
      iommu/vt-d: Fix mm refcounting to hold mm_count not mm_users · e57e58bd
      David Woodhouse authored
      Holding mm_users works OK for graphics, which was the first user of SVM
      with VT-d. However, it works less well for other devices, where we actually
      do a mmap() from the file descriptor to which the SVM PASID state is tied.
      
      In this case on process exit we end up with a recursive reference count:
       - The MM remains alive until the file is closed and the driver's release()
         call ends up unbinding the PASID.
       - The VMA corresponding to the mmap() remains intact until the MM is
         destroyed.
       - Thus the file isn't closed, even when exit_files() runs, because the
         VMA is still holding a reference to it. And the MM remains alive…
      
      To address this issue, we *stop* holding mm_users while the PASID is bound.
      We already hold mm_count by virtue of the MMU notifier, and that can be
      made to be sufficient.
      
      It means that for a period during process exit, the fun part of mmput()
      has happened and exit_mmap() has been called so the MM is basically
      defunct. But the PGD still exists and the PASID is still bound to it.
      
      During this period, we have to be very careful — exit_mmap() doesn't use
      mm->mmap_sem because it doesn't expect anyone else to be touching the MM
      (quite reasonably, since mm_users is zero). So we also need to fix the
      fault handler to just report failure if mm_users is already zero, and to
      temporarily bump mm_users while handling any faults.
      
      Additionally, exit_mmap() calls mmu_notifier_release() *before* it tears
      down the page tables, which is too early for us to flush the IOTLB for
      this PASID. And __mmu_notifier_release() removes every notifier from the
      list, so when exit_mmap() finally *does* tear down the mappings and
      clear the page tables, we don't get notified. So we work around this by
      clearing the PASID table entry in our MMU notifier release() callback.
      That way, the hardware *can't* get any pages back from the page tables
      before they get cleared.
      
      Hardware designers have confirmed that the resulting 'PASID not present'
      faults should be handled just as gracefully as 'page not present' faults,
      the important criterion being that they don't perturb the operation for
      any *other* PASID in the system.
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Cc: stable@vger.kernel.org
      e57e58bd
  2. 10 Jan, 2016 1 commit
  3. 09 Jan, 2016 4 commits
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · eac6f76a
      Linus Torvalds authored
      Pull SCSI fix from James Bottomley:
       "A single fix for machines with pages > 4k (PPC mostly).
      
        There's a bug in our optimal transfer size code where we don't account
        for pages > 4k and can set the transfer size to be less than the page
        size causing nasty failures"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        sd: Reject optimal transfer length smaller than page size
      eac6f76a
    • Linus Torvalds's avatar
      Merge tag 'pci-v4.4-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · c0cb1393
      Linus Torvalds authored
      Pull PCI fixlet from Bjorn Helgaas:
       "This marks the TI DRA7xx host bridge driver as broken.  Apparently it
        has never worked without some additional out-of-tree code, so I'm
        going to mark it broken now and remove it completely next cycle unless
        it's fixed"
      
      * tag 'pci-v4.4-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: dra7xx: Mark driver as broken
      c0cb1393
    • Michal Hocko's avatar
      vmstat: allocate vmstat_wq before it is used · 751e5f5c
      Michal Hocko authored
      kernel test robot has reported the following crash:
      
        BUG: unable to handle kernel NULL pointer dereference at 00000100
        IP: [<c1074df6>] __queue_work+0x26/0x390
        *pdpt = 0000000000000000 *pde = f000ff53f000ff53 *pde = f000ff53f000ff53
        Oops: 0000 [#1] PREEMPT PREEMPT SMP SMP
        CPU: 0 PID: 24 Comm: kworker/0:1 Not tainted 4.4.0-rc4-00139-g373ccbe5 #1
        Workqueue: events vmstat_shepherd
        task: cb684600 ti: cb7ba000 task.ti: cb7ba000
        EIP: 0060:[<c1074df6>] EFLAGS: 00010046 CPU: 0
        EIP is at __queue_work+0x26/0x390
        EAX: 00000046 EBX: cbb37800 ECX: cbb37800 EDX: 00000000
        ESI: 00000000 EDI: 00000000 EBP: cb7bbe68 ESP: cb7bbe38
         DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
        CR0: 8005003b CR2: 00000100 CR3: 01fd5000 CR4: 000006b0
        Stack:
        Call Trace:
          __queue_delayed_work+0xa1/0x160
          queue_delayed_work_on+0x36/0x60
          vmstat_shepherd+0xad/0xf0
          process_one_work+0x1aa/0x4c0
          worker_thread+0x41/0x440
          kthread+0xb0/0xd0
          ret_from_kernel_thread+0x21/0x40
      
      The reason is that start_shepherd_timer schedules the shepherd work item
      which uses vmstat_wq (vmstat_shepherd) before setup_vmstat allocates
      that workqueue so if the further initialization takes more than HZ we
      might end up scheduling on a NULL vmstat_wq.  This is really unlikely
      but not impossible.
      
      Fixes: 373ccbe5 ("mm, vmstat: allow WQ concurrency to discover memory reclaim doesn't make any progress")
      Reported-by: default avatarkernel test robot <ying.huang@linux.intel.com>
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
      Tested-by: default avatarTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Cc: stable@vger.kernel.org
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      751e5f5c
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 44d8a7d5
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "This is the final small set of ARM SoC bug fixes for linux-4.4, almost
        all regressions:
      
        OMAP:
         - data corruption on the Nokia N900 flash
      
        Allwinner:
         - Two defconfig change to get USB working again
      
        ARM Versatile:
         - Interrupt numbers gone bad after an older bug fix
      
        Nomadik:
         - Crashes from incorrect L2 cache settings
      
        VIA vt8500:
         - SD/MMC support on WM8650 never worked"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        dts: vt8500: Add SDHC node to DTS file for WM8650
        ARM: Fix broken USB support in multi_v7_defconfig for sunxi devices
        ARM: versatile: fix MMC/SD interrupt assignment
        ARM: nomadik: set latencies to 8 cycles
        ARM: OMAP2+: Fix onenand rate detection to avoid filesystem corruption
        ARM: Fix broken USB support in sunxi_defconfig
      44d8a7d5
  4. 08 Jan, 2016 15 commits
  5. 07 Jan, 2016 15 commits
  6. 06 Jan, 2016 3 commits