12 Jan, 2017

1 commit


01 Aug, 2016

1 commit

  • Pull IOMMU updates from Joerg Roedel:

    - big-endian support and preparation for defered probing for the Exynos
    IOMMU driver

    - simplifications in iommu-group id handling

    - support for Mediatek generation one IOMMU hardware

    - conversion of the AMD IOMMU driver to use the generic IOVA allocator.
    This driver now also benefits from the recent scalability
    improvements in the IOVA code.

    - preparations to use generic DMA mapping code in the Rockchip IOMMU
    driver

    - device tree adaption and conversion to use generic page-table code
    for the MSM IOMMU driver

    - an iova_to_phys optimization in the ARM-SMMU driver to greatly
    improve page-table teardown performance with VFIO

    - various other small fixes and conversions

    * tag 'iommu-updates-v4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (59 commits)
    iommu/amd: Initialize dma-ops domains with 3-level page-table
    iommu/amd: Update Alias-DTE in update_device_table()
    iommu/vt-d: Return error code in domain_context_mapping_one()
    iommu/amd: Use container_of to get dma_ops_domain
    iommu/amd: Flush iova queue before releasing dma_ops_domain
    iommu/amd: Handle IOMMU_DOMAIN_DMA in ops->domain_free call-back
    iommu/amd: Use dev_data->domain in get_domain()
    iommu/amd: Optimize map_sg and unmap_sg
    iommu/amd: Introduce dir2prot() helper
    iommu/amd: Implement timeout to flush unmap queues
    iommu/amd: Implement flush queue
    iommu/amd: Allow NULL pointer parameter for domain_flush_complete()
    iommu/amd: Set up data structures for flush queue
    iommu/amd: Remove align-parameter from __map_single()
    iommu/amd: Remove other remains of old address allocator
    iommu/amd: Make use of the generic IOVA allocator
    iommu/amd: Remove special mapping code for dma_ops path
    iommu/amd: Pass gfp-flags to iommu_map_page()
    iommu/amd: Implement apply_dm_region call-back
    iommu/amd: Create a list of reserved iova addresses
    ...

    Linus Torvalds
     

27 Jul, 2016

1 commit


21 Jun, 2016

1 commit

  • alloc_workqueue replaces deprecated create_workqueue().

    A dedicated workqueue has been used since the workitem (viz
    &fault->work), is involved in IO page-fault handling.
    WQ_MEM_RECLAIM has been set to guarantee forward progress under memory
    pressure, which is a requirement here.
    Since there are only a fixed number of work items, explicit concurrency
    limit is unnecessary.

    Signed-off-by: Bhaktipriya Shridhar
    Acked-by: Tejun Heo
    Signed-off-by: Joerg Roedel

    Bhaktipriya Shridhar
     

19 Feb, 2016

1 commit

  • We try to enforce protection keys in software the same way that we
    do in hardware. (See long example below).

    But, we only want to do this when accessing our *own* process's
    memory. If GDB set PKRU[6].AD=1 (disable access to PKEY 6), then
    tried to PTRACE_POKE a target process which just happened to have
    some mprotect_pkey(pkey=6) memory, we do *not* want to deny the
    debugger access to that memory. PKRU is fundamentally a
    thread-local structure and we do not want to enforce it on access
    to _another_ thread's data.

    This gets especially tricky when we have workqueues or other
    delayed-work mechanisms that might run in a random process's context.
    We can check that we only enforce pkeys when operating on our *own* mm,
    but delayed work gets performed when a random user context is active.
    We might end up with a situation where a delayed-work gup fails when
    running randomly under its "own" task but succeeds when running under
    another process. We want to avoid that.

    To avoid that, we use the new GUP flag: FOLL_REMOTE and add a
    fault flag: FAULT_FLAG_REMOTE. They indicate that we are
    walking an mm which is not guranteed to be the same as
    current->mm and should not be subject to protection key
    enforcement.

    Thanks to Jerome Glisse for pointing out this scenario.

    Signed-off-by: Dave Hansen
    Reviewed-by: Thomas Gleixner
    Cc: Alexey Kardashevskiy
    Cc: Andrea Arcangeli
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Boaz Harrosh
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dan Williams
    Cc: Dave Chinner
    Cc: Dave Hansen
    Cc: David Gibson
    Cc: Denys Vlasenko
    Cc: Dominik Dingel
    Cc: Dominik Vogt
    Cc: Eric B Munson
    Cc: Geliang Tang
    Cc: Guan Xuetao
    Cc: H. Peter Anvin
    Cc: Heiko Carstens
    Cc: Hugh Dickins
    Cc: Jan Kara
    Cc: Jason Low
    Cc: Jerome Marchand
    Cc: Joerg Roedel
    Cc: Kirill A. Shutemov
    Cc: Konstantin Khlebnikov
    Cc: Laurent Dufour
    Cc: Linus Torvalds
    Cc: Martin Schwidefsky
    Cc: Matthew Wilcox
    Cc: Mel Gorman
    Cc: Michael Ellerman
    Cc: Michal Hocko
    Cc: Mikulas Patocka
    Cc: Minchan Kim
    Cc: Oleg Nesterov
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Rik van Riel
    Cc: Sasha Levin
    Cc: Shachar Raindel
    Cc: Vlastimil Babka
    Cc: Xie XiuQi
    Cc: iommu@lists.linux-foundation.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mm@kvack.org
    Cc: linux-s390@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Signed-off-by: Ingo Molnar

    Dave Hansen
     

14 Dec, 2015

4 commits


15 Oct, 2015

1 commit

  • handle_mm_fault indirectly triggers a BUG in do_numa_page
    when given a VMA without read/write/execute access. Check
    this condition in do_fault.

    do_fault -> handle_mm_fault -> handle_pte_fault -> do_numa_page

    mm/memory.c
    3147 static int do_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
    ....
    3159 /* A PROT_NONE fault should not end up here */
    3160 BUG_ON(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)));

    Signed-off-by: Jay Cornwall
    Cc: # v4.1+
    Signed-off-by: Joerg Roedel

    Jay Cornwall
     

14 Aug, 2015

1 commit


30 Jul, 2015

1 commit

  • Since the conversion to default domains the
    iommu_attach_device function only works for devices with
    their own group. But this isn't always true for current
    IOMMUv2 capable devices, so use iommu_attach_group instead.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     

04 May, 2015

1 commit

  • This patch fixes a bug in put_pasid_state_wait that appeared in kernel 4.0
    The bug is that pasid_state->count wasn't decremented before entering the
    wait_event. Thus, the condition in wait_event will never be true.

    The fix is to decrement (atomically) the pasid_state->count before the
    wait_event.

    Signed-off-by: Oded Gabbay
    Cc: stable@vger.kernel.org #v4.0
    Signed-off-by: Joerg Roedel

    Oded Gabbay
     

04 Mar, 2015

1 commit


04 Feb, 2015

4 commits


16 Dec, 2014

1 commit

  • Pull drm updates from Dave Airlie:
    "Highlights:

    - AMD KFD driver merge

    This is the AMD HSA interface for exposing a lowlevel interface for
    GPGPU use. They have an open source userspace built on top of this
    interface, and the code looks as good as it was going to get out of
    tree.

    - Initial atomic modesetting work

    The need for an atomic modesetting interface to allow userspace to
    try and send a complete set of modesetting state to the driver has
    arisen, and been suffering from neglect this past year. No more,
    the start of the common code and changes for msm driver to use it
    are in this tree. Ongoing work to get the userspace ioctl finished
    and the code clean will probably wait until next kernel.

    - DisplayID 1.3 and tiled monitor exposed to userspace.

    Tiled monitor property is now exposed for userspace to make use of.

    - Rockchip drm driver merged.

    - imx gpu driver moved out of staging

    Other stuff:

    - core:
    panel - MIPI DSI + new panels.
    expose suggested x/y properties for virtual GPUs

    - i915:
    Initial Skylake (SKL) support
    gen3/4 reset work
    start of dri1/ums removal
    infoframe tracking
    fixes for lots of things.

    - nouveau:
    tegra k1 voltage support
    GM204 modesetting support
    GT21x memory reclocking work

    - radeon:
    CI dpm fixes
    GPUVM improvements
    Initial DPM fan control

    - rcar-du:
    HDMI support added
    removed some support for old boards
    slave encoder driver for Analog Devices adv7511

    - exynos:
    Exynos4415 SoC support

    - msm:
    a4xx gpu support
    atomic helper conversion

    - tegra:
    iommu support
    universal plane support
    ganged-mode DSI support

    - sti:
    HDMI i2c improvements

    - vmwgfx:
    some late fixes.

    - qxl:
    use suggested x/y properties"

    * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (969 commits)
    drm: sti: fix module compilation issue
    drm/i915: save/restore GMBUS freq across suspend/resume on gen4
    drm: sti: correctly cleanup CRTC and planes
    drm: sti: add HQVDP plane
    drm: sti: add cursor plane
    drm: sti: enable auxiliary CRTC
    drm: sti: fix delay in VTG programming
    drm: sti: prepare sti_tvout to support auxiliary crtc
    drm: sti: use drm_crtc_vblank_{on/off} instead of drm_vblank_{on/off}
    drm: sti: fix hdmi avi infoframe
    drm: sti: remove event lock while disabling vblank
    drm: sti: simplify gdp code
    drm: sti: clear all mixer control
    drm: sti: remove gpio for HDMI hot plug detection
    drm: sti: allow to change hdmi ddc i2c adapter
    drm/doc: Document drm_add_modes_noedid() usage
    drm/i915: Remove '& 0xffff' from the mask given to WA_REG()
    drm/i915: Invert the mask and val arguments in wa_add() and WA_REG()
    drm: Zero out DRM object memory upon cleanup
    drm/i915/bdw: Fix the write setting up the WIZ hashing mode
    ...

    Linus Torvalds
     

14 Dec, 2014

2 commits

  • Merge second patchbomb from Andrew Morton:
    - the rest of MM
    - misc fs fixes
    - add execveat() syscall
    - new ratelimit feature for fault-injection
    - decompressor updates
    - ipc/ updates
    - fallocate feature creep
    - fsnotify cleanups
    - a few other misc things

    * emailed patches from Andrew Morton : (99 commits)
    cgroups: Documentation: fix trivial typos and wrong paragraph numberings
    parisc: percpu: update comments referring to __get_cpu_var
    percpu: update local_ops.txt to reflect this_cpu operations
    percpu: remove __get_cpu_var and __raw_get_cpu_var macros
    fsnotify: remove destroy_list from fsnotify_mark
    fsnotify: unify inode and mount marks handling
    fallocate: create FAN_MODIFY and IN_MODIFY events
    mm/cma: make kmemleak ignore CMA regions
    slub: fix cpuset check in get_any_partial
    slab: fix cpuset check in fallback_alloc
    shmdt: use i_size_read() instead of ->i_size
    ipc/shm.c: fix overly aggressive shmdt() when calls span multiple segments
    ipc/msg: increase MSGMNI, remove scaling
    ipc/sem.c: increase SEMMSL, SEMMNI, SEMOPM
    ipc/sem.c: change memory barrier in sem_lock() to smp_rmb()
    lib/decompress.c: consistency of compress formats for kernel image
    decompress_bunzip2: off by one in get_next_block()
    usr/Kconfig: make initrd compression algorithm selection not expert
    fault-inject: add ratelimit option
    ratelimit: add initialization macro
    ...

    Linus Torvalds
     
  • This could be useful for debug in the future if we want to track
    major/minor faults more closely, and also avoids the put_page trick we
    used with gup.

    In order to do this, we also track the task struct in the PASID state
    structure. This lets us update the appropriate task stats after the fault
    has been handled, and may aid with debug in the future as well.

    Signed-off-by: Jesse Barnes
    Tested-by: Oded Gabbay
    Cc: Joerg Roedel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesse Barnes
     

12 Nov, 2014

1 commit

  • This patch fixes a bug in the accounting of the
    device_state. In the current code, the device_state was put
    (decremented) too many times, which sometimes lead to the
    driver getting stuck permanently in put_device_state_wait().
    That happen because the device_state->count would go below
    zero, which is never supposed to happen.

    The root cause is that the device_state was decremented in
    put_pasid_state() and put_pasid_state_wait() but also in all
    the functions that call those functions. Therefore, the
    device_state was decremented twice in each of these code
    paths.

    The fix is to decouple the device_state accounting from the
    pasid_state accounting - remove the call to
    put_device_state() from the put_pasid_state() and the
    put_pasid_state_wait())

    Signed-off-by: Oded Gabbay
    Signed-off-by: Joerg Roedel

    Oded Gabbay
     

24 Sep, 2014

1 commit

  • 1. We were calling clear_flush_young_notify in unmap_one, but we are
    within an mmu notifier invalidate range scope. The spte exists no more
    (due to range_start) and the accessed bit info has already been
    propagated (due to kvm_pfn_set_accessed). Simply call
    clear_flush_young.

    2. We clear_flush_young on a primary MMU PMD, but this may be mapped
    as a collection of PTEs by the secondary MMU (e.g. during log-dirty).
    This required expanding the interface of the clear_flush_young mmu
    notifier, so a lot of code has been trivially touched.

    3. In the absence of shadow_accessed_mask (e.g. EPT A bit), we emulate
    the access bit by blowing the spte. This requires proper synchronizing
    with MMU notifier consumers, like every other removal of spte's does.

    Signed-off-by: Andres Lagar-Cavilla
    Acked-by: Rik van Riel
    Signed-off-by: Paolo Bonzini

    Andres Lagar-Cavilla
     

30 Jul, 2014

4 commits


10 Jul, 2014

9 commits


09 Jul, 2014

1 commit


20 Jun, 2014

1 commit

  • Commit e79df31 introduced mmu_notifer_count to protect
    against parallel mmu_notifier_invalidate_range_start/end
    calls. The patch left a small race condition when
    invalidate_range_end() races with a new
    invalidate_range_start() the empty page-table may be
    reverted leading to stale TLB entries in the IOMMU and the
    device. Use a spin_lock instead of just an atomic variable
    to eliminate the race.

    Signed-off-by: Joerg Roedel

    Joerg Roedel
     

26 May, 2014

2 commits