11 Sep, 2019

1 commit


25 Jul, 2019

1 commit

  • Generally, declaring a platform device as a static variable is
    a bad idea and can cause all kinds of problems, in particular
    with the DMA configuration and lifetime rules.

    A specific problem we hit here is from a bug in clang that warns
    about certain (otherwise valid) macros when used in static variables:

    drivers/misc/mic/card/mic_x100.c:285:27: warning: shift count >= width of type [-Wshift-count-overflow]
    static u64 mic_dma_mask = DMA_BIT_MASK(64);
    ^~~~~~~~~~~~~~~~
    include/linux/dma-mapping.h:141:54: note: expanded from macro 'DMA_BIT_MASK'
    #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<
    Link: https://lore.kernel.org/r/20190712092426.872625-1-arnd@arndb.de
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

13 Jul, 2019

1 commit

  • Pull driver core and debugfs updates from Greg KH:
    "Here is the "big" driver core and debugfs changes for 5.3-rc1

    It's a lot of different patches, all across the tree due to some api
    changes and lots of debugfs cleanups.

    Other than the debugfs cleanups, in this set of changes we have:

    - bus iteration function cleanups

    - scripts/get_abi.pl tool to display and parse Documentation/ABI
    entries in a simple way

    - cleanups to Documenatation/ABI/ entries to make them parse easier
    due to typos and other minor things

    - default_attrs use for some ktype users

    - driver model documentation file conversions to .rst

    - compressed firmware file loading

    - deferred probe fixes

    All of these have been in linux-next for a while, with a bunch of
    merge issues that Stephen has been patient with me for"

    * tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits)
    debugfs: make error message a bit more verbose
    orangefs: fix build warning from debugfs cleanup patch
    ubifs: fix build warning after debugfs cleanup patch
    driver: core: Allow subsystems to continue deferring probe
    drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT
    arch_topology: Remove error messages on out-of-memory conditions
    lib: notifier-error-inject: no need to check return value of debugfs_create functions
    swiotlb: no need to check return value of debugfs_create functions
    ceph: no need to check return value of debugfs_create functions
    sunrpc: no need to check return value of debugfs_create functions
    ubifs: no need to check return value of debugfs_create functions
    orangefs: no need to check return value of debugfs_create functions
    nfsd: no need to check return value of debugfs_create functions
    lib: 842: no need to check return value of debugfs_create functions
    debugfs: provide pr_fmt() macro
    debugfs: log errors when something goes wrong
    drivers: s390/cio: Fix compilation warning about const qualifiers
    drivers: Add generic helper to match by of_node
    driver_find_device: Unify the match function with class_find_device()
    bus_find_device: Unify the match callback with class_find_device
    ...

    Linus Torvalds
     

18 Jun, 2019

1 commit


11 Jun, 2019

1 commit

  • _scif_init() free scif_dev in the free_sdev erro path,
    but _scif_exit will free it again when module exit, it
    cause BUG_ON issue,

    kernel BUG at mm/slub.c:3944!
    invalid opcode: 0000 [#1] SMP KASAN PTI

    Set scif_dev to NULL in scif_destroy_scifdev() to fix it.

    Cc: Sudeep Dutt
    Cc: Ashutosh Dixit
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Reported-by: Hulk Robot
    Signed-off-by: Kefeng Wang
    Signed-off-by: Greg Kroah-Hartman

    Kefeng Wang
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details the full gnu general public license is included in
    this distribution in the file called copying

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 39 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141901.397680977@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 655 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


24 Apr, 2019

1 commit

  • We have supported per-device dma_map_ops in generic code for a long
    time, and this symbol just guards the inclusion of the dma_map_ops
    registry used for vmd. Stop enabling it for anything but vmd.

    No change in functionality intended.

    Signed-off-by: Christoph Hellwig
    Acked-by: Bjorn Helgaas
    Cc: Borislav Petkov
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20190410080220.21705-3-hch@lst.de
    Signed-off-by: Ingo Molnar

    Christoph Hellwig
     

10 Mar, 2019

1 commit

  • Pull rdma updates from Jason Gunthorpe:
    "This has been a slightly more active cycle than normal with ongoing
    core changes and quite a lot of collected driver updates.

    - Various driver fixes for bnxt_re, cxgb4, hns, mlx5, pvrdma, rxe

    - A new data transfer mode for HFI1 giving higher performance

    - Significant functional and bug fix update to the mlx5
    On-Demand-Paging MR feature

    - A chip hang reset recovery system for hns

    - Change mm->pinned_vm to an atomic64

    - Update bnxt_re to support a new 57500 chip

    - A sane netlink 'rdma link add' method for creating rxe devices and
    fixing the various unregistration race conditions in rxe's
    unregister flow

    - Allow lookup up objects by an ID over netlink

    - Various reworking of the core to driver interface:
    - drivers should not assume umem SGLs are in PAGE_SIZE chunks
    - ucontext is accessed via udata not other means
    - start to make the core code responsible for object memory
    allocation
    - drivers should convert struct device to struct ib_device via a
    helper
    - drivers have more tools to avoid use after unregister problems"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (280 commits)
    net/mlx5: ODP support for XRC transport is not enabled by default in FW
    IB/hfi1: Close race condition on user context disable and close
    RDMA/umem: Revert broken 'off by one' fix
    RDMA/umem: minor bug fix in error handling path
    RDMA/hns: Use GFP_ATOMIC in hns_roce_v2_modify_qp
    cxgb4: kfree mhp after the debug print
    IB/rdmavt: Fix concurrency panics in QP post_send and modify to error
    IB/rdmavt: Fix loopback send with invalidate ordering
    IB/iser: Fix dma_nents type definition
    IB/mlx5: Set correct write permissions for implicit ODP MR
    bnxt_re: Clean cq for kernel consumers only
    RDMA/uverbs: Don't do double free of allocated PD
    RDMA: Handle ucontext allocations by IB/core
    RDMA/core: Fix a WARN() message
    bnxt_re: fix the regression due to changes in alloc_pbl
    IB/mlx4: Increase the timeout for CM cache
    IB/core: Abort page fault handler silently during owning process exit
    IB/mlx5: Validate correct PD before prefetch MR
    IB/mlx5: Protect against prefetch of invalid MR
    RDMA/uverbs: Store PR pointer before it is overwritten
    ...

    Linus Torvalds
     

27 Feb, 2019

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.

    This patch fixes the following warning:

    drivers/misc/mic/scif/scif_rma.c: In function ‘scif_unregister_window’:
    drivers/misc/mic/scif/scif_rma.c:665:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
    send_msg = true;
    ~~~~~~~~~^~~~~~
    drivers/misc/mic/scif/scif_rma.c:668:2: note: here
    case OP_IN_PROGRESS:
    ^~~~

    Warning level 3 was used: -Wimplicit-fallthrough=3

    Notice that, in this particular case, the code comment is modified
    in accordance with what GCC is expecting to find.

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Greg Kroah-Hartman

    Gustavo A. R. Silva
     

26 Feb, 2019

3 commits

  • VOP_BUS does not actually depend on x86-64 or PCI or X86_DEV_DMA_OPS.

    The dependency on X86_DEV_DMA_OPS has been unnecessary since commit
    5657933dbb6e25fe ("treewide: Move dma_ops from struct dev_archdata into
    struct device").

    Signed-off-by: Vincent Whitchurch
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     
  • Some architectures (like MIPS) implement ioremap as a macro, and this
    leads to conflicts with the ioremap function pointer in various mic
    structures.

    drivers/misc/mic/vop/vop_vringh.c:
    In function 'vop_virtio_init_post':
    drivers/misc/mic/vop/vop_vringh.c:86:13:
    error: macro "ioremap" passed 3 arguments, but takes just 2

    Rename ioremap to remap to fix this. Likewise for iounmap.

    Signed-off-by: Vincent Whitchurch
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     
  • Fix these on 32-bit:

    vop_vringh.c:711:13: error: cast from pointer to integer of different
    size [-Werror=pointer-to-int-cast]

    Signed-off-by: Vincent Whitchurch
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     

11 Feb, 2019

1 commit


08 Feb, 2019

2 commits

  • The driver uses mmap_sem for both pinned_vm accounting and
    get_user_pages(). By using gup_fast() and letting the mm handle the lock
    if needed, we can no longer rely on the semaphore and simplify the whole
    thing.

    Reviewed-by: Ira Weiny
    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Jason Gunthorpe

    Davidlohr Bueso
     
  • Taking a sleeping lock to _only_ increment a variable is quite the
    overkill, and pretty much all users do this. Furthermore, some drivers
    (ie: infiniband and scif) that need pinned semantics can go to quite
    some trouble to actually delay via workqueue (un)accounting for pinned
    pages when not possible to acquire it.

    By making the counter atomic we no longer need to hold the mmap_sem and
    can simply some code around it for pinned_vm users. The counter is 64-bit
    such that we need not worry about overflows such as rdma user input
    controlled from userspace.

    Reviewed-by: Ira Weiny
    Reviewed-by: Christoph Lameter
    Reviewed-by: Daniel Jordan
    Reviewed-by: Jan Kara
    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Jason Gunthorpe

    Davidlohr Bueso
     

01 Feb, 2019

2 commits

  • The remove path contains a hack which depends on internal structures in
    other source files, similar to the one which was recently removed from
    the registration path. Since commit 1ce9e6055fa0 ("virtio_ring:
    introduce packed ring support"), this leads to a crash when vop devices
    are removed.

    The structure in question is only examined to get the virtual address of
    the allocated used page. Store that pointer locally instead to fix the
    crash.

    Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
    Signed-off-by: Vincent Whitchurch
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     
  • KASAN detects a use-after-free when vop devices are removed.

    This problem was introduced by commit 0063e8bbd2b62d136 ("virtio_vop:
    don't kfree device on register failure"). That patch moved the freeing
    of the struct _vop_vdev to the release function, but failed to ensure
    that vop holds a reference to the device when it doesn't want it to go
    away. A kfree() was replaced with a put_device() in the unregistration
    path, but the last reference to the device is already dropped in
    unregister_virtio_device() so the struct is freed before vop is done
    with it.

    Fix it by holding a reference until cleanup is done. This is similar to
    the fix in virtio_pci in commit 2989be09a8a9d6 ("virtio_pci: fix use
    after free on release").

    ==================================================================
    BUG: KASAN: use-after-free in vop_scan_devices+0xc6c/0xe50 [vop]
    Read of size 8 at addr ffff88800da18580 by task kworker/0:1/12

    CPU: 0 PID: 12 Comm: kworker/0:1 Not tainted 5.0.0-rc4+ #53
    Workqueue: events vop_hotplug_devices [vop]
    Call Trace:
    dump_stack+0x74/0xbb
    print_address_description+0x5d/0x2b0
    ? vop_scan_devices+0xc6c/0xe50 [vop]
    kasan_report+0x152/0x1aa
    ? vop_scan_devices+0xc6c/0xe50 [vop]
    ? vop_scan_devices+0xc6c/0xe50 [vop]
    vop_scan_devices+0xc6c/0xe50 [vop]
    ? vop_loopback_free_irq+0x160/0x160 [vop_loopback]
    process_one_work+0x7c0/0x14b0
    ? pwq_dec_nr_in_flight+0x2d0/0x2d0
    ? do_raw_spin_lock+0x120/0x280
    worker_thread+0x8f/0xbf0
    ? __kthread_parkme+0x78/0xf0
    ? process_one_work+0x14b0/0x14b0
    kthread+0x2ae/0x3a0
    ? kthread_park+0x120/0x120
    ret_from_fork+0x3a/0x50

    Allocated by task 12:
    kmem_cache_alloc_trace+0x13a/0x2a0
    vop_scan_devices+0x473/0xe50 [vop]
    process_one_work+0x7c0/0x14b0
    worker_thread+0x8f/0xbf0
    kthread+0x2ae/0x3a0
    ret_from_fork+0x3a/0x50

    Freed by task 12:
    kfree+0x104/0x310
    device_release+0x73/0x1d0
    kobject_put+0x14f/0x420
    unregister_virtio_device+0x32/0x50
    vop_scan_devices+0x19d/0xe50 [vop]
    process_one_work+0x7c0/0x14b0
    worker_thread+0x8f/0xbf0
    kthread+0x2ae/0x3a0
    ret_from_fork+0x3a/0x50

    The buggy address belongs to the object at ffff88800da18008
    which belongs to the cache kmalloc-2k of size 2048
    The buggy address is located 1400 bytes inside of
    2048-byte region [ffff88800da18008, ffff88800da18808)
    The buggy address belongs to the page:
    page:ffffea0000368600 count:1 mapcount:0 mapping:ffff88801440dbc0 index:0x0 compound_mapcount: 0
    flags: 0x4000000000010200(slab|head)
    raw: 4000000000010200 ffffea0000378608 ffffea000037a008 ffff88801440dbc0
    raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000
    page dumped because: kasan: bad access detected

    Memory state around the buggy address:
    ffff88800da18480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ffff88800da18500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    >ffff88800da18580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ^
    ffff88800da18600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ffff88800da18680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ==================================================================

    Fixes: 0063e8bbd2b62d136 ("virtio_vop: don't kfree device on register failure")
    Signed-off-by: Vincent Whitchurch
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     

30 Jan, 2019

1 commit

  • VOP is broken in mainline since commit 1ce9e6055fa0a9043 ("virtio_ring:
    introduce packed ring support"); attempting to use the virtqueues leads
    to various kernel crashes. I'm testing it with my not-yet-merged
    loopback patches, but even the in-tree MIC hardware cannot work.

    The problem is not in the referenced commit per se, but is due to the
    following hack in vop_find_vq() which depends on the layout of private
    structures in other source files, which that commit happened to change:

    /*
    * To reassign the used ring here we are directly accessing
    * struct vring_virtqueue which is a private data structure
    * in virtio_ring.c. At the minimum, a BUILD_BUG_ON() in
    * vring_new_virtqueue() would ensure that
    * (&vq->vring == (struct vring *) (&vq->vq + 1));
    */
    vr = (struct vring *)(vq + 1);
    vr->used = used;

    Fix vop by using __vring_new_virtqueue() to create the needed vring
    layout from the start, instead of attempting to patch in the used ring
    later. __vring_new_virtqueue() was added way back in commit
    2a2d1382fe9dcc ("virtio: Add improved queue allocation API") in order to
    address mic's usecase, according to the commit message.

    Fixes: 1ce9e6055fa0 ("virtio_ring: introduce packed ring support")
    Signed-off-by: Vincent Whitchurch
    Signed-off-by: Greg Kroah-Hartman

    Vincent Whitchurch
     

28 Jan, 2019

1 commit


22 Jan, 2019

4 commits


18 Jan, 2019

1 commit


15 Jan, 2019

1 commit

  • Some vqs may not need to be allocated when their related feature bits
    are disabled. So callers may pass in such vqs with "names = NULL".
    Then we skip such vq allocations.

    Signed-off-by: Wei Wang
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Wei Wang
    Signed-off-by: Wei Wang
    Reviewed-by: Cornelia Huck
    Cc: stable@vger.kernel.org
    Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT")

    Wei Wang
     

02 Jan, 2019

1 commit

  • Pull IOMMU updates from Joerg Roedel:

    - Page table code for AMD IOMMU now supports large pages where smaller
    page-sizes were mapped before. VFIO had to work around that in the
    past and I included a patch to remove it (acked by Alex Williamson)

    - Patches to unmodularize a couple of IOMMU drivers that would never
    work as modules anyway.

    - Work to unify the the iommu-related pointers in 'struct device' into
    one pointer. This work is not finished yet, but will probably be in
    the next cycle.

    - NUMA aware allocation in iommu-dma code

    - Support for r8a774a1 and r8a774c0 in the Renesas IOMMU driver

    - Scalable mode support for the Intel VT-d driver

    - PM runtime improvements for the ARM-SMMU driver

    - Support for the QCOM-SMMUv2 IOMMU hardware from Qualcom

    - Various smaller fixes and improvements

    * tag 'iommu-updates-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (78 commits)
    iommu: Check for iommu_ops == NULL in iommu_probe_device()
    ACPI/IORT: Don't call iommu_ops->add_device directly
    iommu/of: Don't call iommu_ops->add_device directly
    iommu: Consolitate ->add/remove_device() calls
    iommu/sysfs: Rename iommu_release_device()
    dmaengine: sh: rcar-dmac: Use device_iommu_mapped()
    xhci: Use device_iommu_mapped()
    powerpc/iommu: Use device_iommu_mapped()
    ACPI/IORT: Use device_iommu_mapped()
    iommu/of: Use device_iommu_mapped()
    driver core: Introduce device_iommu_mapped() function
    iommu/tegra: Use helper functions to access dev->iommu_fwspec
    iommu/qcom: Use helper functions to access dev->iommu_fwspec
    iommu/of: Use helper functions to access dev->iommu_fwspec
    iommu/mediatek: Use helper functions to access dev->iommu_fwspec
    iommu/ipmmu-vmsa: Use helper functions to access dev->iommu_fwspec
    iommu/dma: Use helper functions to access dev->iommu_fwspec
    iommu/arm-smmu: Use helper functions to access dev->iommu_fwspec
    ACPI/IORT: Use helper functions to access dev->iommu_fwspec
    iommu: Introduce wrappers around dev->iommu_fwspec
    ...

    Linus Torvalds
     

29 Dec, 2018

4 commits

  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char and misc driver patches for 4.21-rc1.

    Lots of different types of driver things in here, as this tree seems
    to be the "collection of various driver subsystems not big enough to
    have their own git tree" lately.

    Anyway, some highlights of the changes in here:

    - binderfs: is it a rule that all driver subsystems will eventually
    grow to have their own filesystem? Binder now has one to handle the
    use of it in containerized systems.

    This was discussed at the Plumbers conference a few months ago and
    knocked into mergable shape very fast by Christian Brauner. Who
    also has signed up to be another binder maintainer, showing a
    distinct lack of good judgement :)

    - binder updates and fixes

    - mei driver updates

    - fpga driver updates and additions

    - thunderbolt driver updates

    - soundwire driver updates

    - extcon driver updates

    - nvmem driver updates

    - hyper-v driver updates

    - coresight driver updates

    - pvpanic driver additions and reworking for more device support

    - lp driver updates. Yes really, it's _finally_ moved to the proper
    parallal port driver model, something I never thought I would see
    happen. Good stuff.

    - other tiny driver updates and fixes.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (116 commits)
    MAINTAINERS: add another Android binder maintainer
    intel_th: msu: Fix an off-by-one in attribute store
    stm class: Add a reference to the SyS-T document
    stm class: Fix a module refcount leak in policy creation error path
    char: lp: use new parport device model
    char: lp: properly count the lp devices
    char: lp: use first unused lp number while registering
    char: lp: detach the device when parallel port is removed
    char: lp: introduce list to save port number
    bus: qcom: remove duplicated include from qcom-ebi2.c
    VMCI: Use memdup_user() rather than duplicating its implementation
    char/rtc: Use of_node_name_eq for node name comparisons
    misc: mic: fix a DMA pool free failure
    ptp: fix an IS_ERR() vs NULL check
    genwqe: Fix size check
    binder: implement binderfs
    binder: fix use-after-free due to ksys_close() during fdget()
    bus: fsl-mc: remove duplicated include files
    bus: fsl-mc: explicitly define the fsl_mc_command endianness
    misc: ti-st: make array read_ver_cmd static, shrinks object size
    ...

    Linus Torvalds
     
  • Merge misc updates from Andrew Morton:

    - large KASAN update to use arm's "software tag-based mode"

    - a few misc things

    - sh updates

    - ocfs2 updates

    - just about all of MM

    * emailed patches from Andrew Morton : (167 commits)
    kernel/fork.c: mark 'stack_vm_area' with __maybe_unused
    memcg, oom: notify on oom killer invocation from the charge path
    mm, swap: fix swapoff with KSM pages
    include/linux/gfp.h: fix typo
    mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm
    hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race
    hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization
    memory_hotplug: add missing newlines to debugging output
    mm: remove __hugepage_set_anon_rmap()
    include/linux/vmstat.h: remove unused page state adjustment macro
    mm/page_alloc.c: allow error injection
    mm: migrate: drop unused argument of migrate_page_move_mapping()
    blkdev: avoid migration stalls for blkdev pages
    mm: migrate: provide buffer_migrate_page_norefs()
    mm: migrate: move migrate_page_lock_buffers()
    mm: migrate: lock buffers before migrate_page_move_mapping()
    mm: migration: factor out code to compute expected number of page references
    mm, page_alloc: enable pcpu_drain with zone capability
    kmemleak: add config to select auto scan
    mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init
    ...

    Linus Torvalds
     
  • Pull DMA mapping updates from Christoph Hellwig:
    "A huge update this time, but a lot of that is just consolidating or
    removing code:

    - provide a common DMA_MAPPING_ERROR definition and avoid indirect
    calls for dma_map_* error checking

    - use direct calls for the DMA direct mapping case, avoiding huge
    retpoline overhead for high performance workloads

    - merge the swiotlb dma_map_ops into dma-direct

    - provide a generic remapping DMA consistent allocator for
    architectures that have devices that perform DMA that is not cache
    coherent. Based on the existing arm64 implementation and also used
    for csky now.

    - improve the dma-debug infrastructure, including dynamic allocation
    of entries (Robin Murphy)

    - default to providing chaining scatterlist everywhere, with opt-outs
    for the few architectures (alpha, parisc, most arm32 variants) that
    can't cope with it

    - misc sparc32 dma-related cleanups

    - remove the dma_mark_clean arch hook used by swiotlb on ia64 and
    replace it with the generic noncoherent infrastructure

    - fix the return type of dma_set_max_seg_size (Niklas Söderlund)

    - move the dummy dma ops for not DMA capable devices from arm64 to
    common code (Robin Murphy)

    - ensure dma_alloc_coherent returns zeroed memory to avoid kernel
    data leaks through userspace. We already did this for most common
    architectures, but this ensures we do it everywhere.
    dma_zalloc_coherent has been deprecated and can hopefully be
    removed after -rc1 with a coccinelle script"

    * tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping: (73 commits)
    dma-mapping: fix inverted logic in dma_supported
    dma-mapping: deprecate dma_zalloc_coherent
    dma-mapping: zero memory returned from dma_alloc_*
    sparc/iommu: fix ->map_sg return value
    sparc/io-unit: fix ->map_sg return value
    arm64: default to the direct mapping in get_arch_dma_ops
    PCI: Remove unused attr variable in pci_dma_configure
    ia64: only select ARCH_HAS_DMA_COHERENT_TO_PFN if swiotlb is enabled
    dma-mapping: bypass indirect calls for dma-direct
    vmd: use the proper dma_* APIs instead of direct methods calls
    dma-direct: merge swiotlb_dma_ops into the dma_direct code
    dma-direct: use dma_direct_map_page to implement dma_direct_map_sg
    dma-direct: improve addressability error reporting
    swiotlb: remove dma_mark_clean
    swiotlb: remove SWIOTLB_MAP_ERROR
    ACPI / scan: Refactor _CCA enforcement
    dma-mapping: factor out dummy DMA ops
    dma-mapping: always build the direct mapping code
    dma-mapping: move dma_cache_sync out of line
    dma-mapping: move various slow path functions out of line
    ...

    Linus Torvalds
     
  • Patch series "mmu notifier contextual informations", v2.

    This patchset adds contextual information, why an invalidation is
    happening, to mmu notifier callback. This is necessary for user of mmu
    notifier that wish to maintains their own data structure without having to
    add new fields to struct vm_area_struct (vma).

    For instance device can have they own page table that mirror the process
    address space. When a vma is unmap (munmap() syscall) the device driver
    can free the device page table for the range.

    Today we do not have any information on why a mmu notifier call back is
    happening and thus device driver have to assume that it is always an
    munmap(). This is inefficient at it means that it needs to re-allocate
    device page table on next page fault and rebuild the whole device driver
    data structure for the range.

    Other use case beside munmap() also exist, for instance it is pointless
    for device driver to invalidate the device page table when the
    invalidation is for the soft dirtyness tracking. Or device driver can
    optimize away mprotect() that change the page table permission access for
    the range.

    This patchset enables all this optimizations for device drivers. I do not
    include any of those in this series but another patchset I am posting will
    leverage this.

    The patchset is pretty simple from a code point of view. The first two
    patches consolidate all mmu notifier arguments into a struct so that it is
    easier to add/change arguments. The last patch adds the contextual
    information (munmap, protection, soft dirty, clear, ...).

    This patch (of 3):

    To avoid having to change many callback definition everytime we want to
    add a parameter use a structure to group all parameters for the
    mmu_notifier invalidate_range_start/end callback. No functional changes
    with this patch.

    [akpm@linux-foundation.org: fix drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c kerneldoc]
    Link: http://lkml.kernel.org/r/20181205053628.3210-2-jglisse@redhat.com
    Signed-off-by: Jérôme Glisse
    Acked-by: Jan Kara
    Acked-by: Jason Gunthorpe [infiniband]
    Cc: Matthew Wilcox
    Cc: Ross Zwisler
    Cc: Dan Williams
    Cc: Paolo Bonzini
    Cc: Radim Krcmar
    Cc: Michal Hocko
    Cc: Christian Koenig
    Cc: Felix Kuehling
    Cc: Ralph Campbell
    Cc: John Hubbard
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jérôme Glisse
     

20 Dec, 2018

2 commits


19 Dec, 2018

1 commit

  • In _scif_prog_signal(), a DMA pool is allocated if the MIC Coprocessor is
    not X100, i.e., the boolean variable 'x100' is false. This DMA pool will be
    freed eventually through the callback function scif_prog_signal_cb() with
    the parameter of 'status', which actually points to the start of DMA pool.
    Specifically, in scif_prog_signal_cb(), the 'ep' field and the
    'src_dma_addr' field of 'status' are used to free the DMA pool by invoking
    dma_pool_free(). Given that 'status' points to the start address of the DMA
    pool, both 'status->ep' and 'status->src_dma_addr' are in the DMA pool. And
    so, the device has the permission to access them. Even worse, a malicious
    device can modify them. As a result, dma_pool_free() will not succeed.

    To avoid the above issue, this patch introduces a new data structure, i.e.,
    scif_cb_arg, to store the arguments required by the call back function. A
    variable 'cb_arg' is allocated in _scif_prog_signal() to pass the
    arguments. 'cb_arg' will be freed after dma_pool_free() in
    scif_prog_signal_cb().

    Signed-off-by: Wenwen Wang
    Signed-off-by: Greg Kroah-Hartman

    Wenwen Wang
     

10 Dec, 2018

1 commit

  • Several conflicts, seemingly all over the place.

    I used Stephen Rothwell's sample resolutions for many of these, if not
    just to double check my own work, so definitely the credit largely
    goes to him.

    The NFP conflict consisted of a bug fix (moving operations
    past the rhashtable operation) while chaning the initial
    argument in the function call in the moved code.

    The net/dsa/master.c conflict had to do with a bug fix intermixing of
    making dsa_master_set_mtu() static with the fixing of the tagging
    attribute location.

    cls_flower had a conflict because the dup reject fix from Or
    overlapped with the addition of port range classifiction.

    __set_phy_supported()'s conflict was relatively easy to resolve
    because Andrew fixed it in both trees, so it was just a matter
    of taking the net-next copy. Or at least I think it was :-)

    Joe Stringer's fix to the handling of netns id 0 in bpf_sk_lookup()
    intermixed with changes on how the sdif and caller_net are calculated
    in these code paths in net-next.

    The remaining BPF conflicts were largely about the addition of the
    __bpf_md_ptr stuff in 'net' overlapping with adjustments and additions
    to the relevant data structure where the MD pointer macros are used.

    Signed-off-by: David S. Miller

    David S. Miller
     

06 Dec, 2018

1 commit

  • We already have the DEFINE_SHOW_ATTRIBUTE.There is no need to define
    such a macro,so remove GENWQE_DEBUGFS_RO.Also use DEFINE_SHOW_ATTRIBUTE
    to simplify some code.

    Signed-off-by: Yangtao Li
    Signed-off-by: Greg Kroah-Hartman

    Yangtao Li
     

27 Nov, 2018

2 commits

  • gcc '-Wunused-but-set-variable' warning:

    drivers/misc/mic/scif/scif_rma.c: In function 'scif_create_remote_lookup':
    drivers/misc/mic/scif/scif_rma.c:373:25: warning:
    variable 'vmalloc_num_pages' set but not used [-Wunused-but-set-variable]

    'vmalloc_num_pages' should be used to determine if the address is
    within the vmalloc range.

    Fixes: ba612aa8b487 ("misc: mic: SCIF memory registration and unregistration")
    Signed-off-by: YueHaibing
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     
  • Currently, ccw, vop and remoteproc need some legacy virtio
    APIs to create or access virtio rings, which are not supported
    by packed ring. So disable packed ring on these transports
    for now.

    Signed-off-by: Tiwei Bie
    Signed-off-by: David S. Miller

    Tiwei Bie
     

12 Nov, 2018

1 commit

  • Commit e61d98d8dad00 ("x64, x2apic/intr-remap: Intel vt-d, IOMMU
    code reorganization") moved dma_remapping.h from drivers/pci/ to
    current place. It is entirely VT-d specific, but uses a generic
    name. This merges dma_remapping.h with include/linux/intel-iommu.h
    and removes dma_remapping.h as the result.

    Cc: Ashok Raj
    Cc: Jacob Pan
    Cc: Sohil Mehta
    Suggested-by: Christoph Hellwig
    Signed-off-by: Lu Baolu
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Liu, Yi L
    Signed-off-by: Joerg Roedel

    Lu Baolu