1. 20 Nov, 2019 7 commits
  2. 11 Nov, 2019 7 commits
    • Nicolas Saenz Julienne's avatar
      x86/PCI: sta2x11: use default DMA address translation · e380a039
      Nicolas Saenz Julienne authored
      The devices found behind this PCIe chip have unusual DMA mapping
      constraints as there is an AMBA interconnect placed in between them and
      the different PCI endpoints. The offset between physical memory
      addresses and AMBA's view is provided by reading a PCI config register,
      which is saved and used whenever DMA mapping is needed.
      
      It turns out that this DMA setup can be represented by properly setting
      'dma_pfn_offset', 'dma_bus_mask' and 'dma_mask' during the PCI device
      enable fixup. And ultimately allows us to get rid of this device's
      custom DMA functions.
      
      Aside from the code deletion and DMA setup, sta2x11_pdev_to_mapping() is
      moved to avoid warnings whenever CONFIG_PM is not enabled.
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      e380a039
    • Nicolas Saenz Julienne's avatar
      dma-direct: check for overflows on 32 bit DMA addresses · b12d6627
      Nicolas Saenz Julienne authored
      As seen on the new Raspberry Pi 4 and sta2x11's DMA implementation it is
      possible for a device configured with 32 bit DMA addresses and a partial
      DMA mapping located at the end of the address space to overflow. It
      happens when a higher physical address, not DMAable, is translated to
      it's DMA counterpart.
      
      For example the Raspberry Pi 4, configurable up to 4 GB of memory, has
      an interconnect capable of addressing the lower 1 GB of physical memory
      with a DMA offset of 0xc0000000. It transpires that, any attempt to
      translate physical addresses higher than the first GB will result in an
      overflow which dma_capable() can't detect as it only checks for
      addresses bigger then the maximum allowed DMA address.
      
      Fix this by verifying in dma_capable() if the DMA address range provided
      is at any point lower than the minimum possible DMA address on the bus.
      Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      b12d6627
    • Eric Dumazet's avatar
      dma-debug: increase HASH_SIZE · 5e76f564
      Eric Dumazet authored
      With modern NIC, it is not unusual having about ~256,000 active dma
      mappings and a hash size of 1024 buckets is too small.
      
      Forcing full cache line per bucket does not seem useful, especially now
      that we have contention on free_entries_lock for allocations and freeing
      of entries.  Better use the space to fit more buckets.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      5e76f564
    • Eric Dumazet's avatar
      dma-debug: reorder struct dma_debug_entry fields · d3694f30
      Eric Dumazet authored
      Move all fields used during exact match lookups to the first cache line.
      This makes debug_dma_mapping_error() and friends about 50% faster.
      
      Since it removes two 32bit holes, force a cacheline alignment on struct
      dma_debug_entry.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      d3694f30
    • Christoph Hellwig's avatar
      xtensa: use the generic uncached segment support · 0f665b9e
      Christoph Hellwig authored
      Switch xtensa over to use the generic uncached support, and thus the
      generic implementations of dma_alloc_* and dma_alloc_*, which also
      gains support for mmaping DMA memory.  The non-working nommu DMA
      support has been disabled, but could be re-enabled easily if platforms
      that actually have an uncached segment show up.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Tested-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      0f665b9e
    • Christoph Hellwig's avatar
      dma-mapping: merge the generic remapping helpers into dma-direct · 3acac065
      Christoph Hellwig authored
      Integrate the generic dma remapping implementation into the main flow.
      This prepares for architectures like xtensa that use an uncached
      segment for pages in the kernel mapping, but can also remap highmem
      from CMA.  To simplify that implementation we now always deduct the
      page from the physical address via the DMA address instead of the
      virtual address.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      3acac065
    • Christoph Hellwig's avatar
      dma-direct: provide mmap and get_sgtable method overrides · 34dc0ea6
      Christoph Hellwig authored
      For dma-direct we know that the DMA address is an encoding of the
      physical address that we can trivially decode.  Use that fact to
      provide implementations that do not need the arch_dma_coherent_to_pfn
      architecture hook.  Note that we still can only support mmap of
      non-coherent memory only if the architecture provides a way to set an
      uncached bit in the page tables.  This must be true for architectures
      that use the generic remap helpers, but other architectures can also
      manually select it.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      34dc0ea6
  3. 07 Nov, 2019 2 commits
  4. 31 Oct, 2019 1 commit
  5. 30 Oct, 2019 10 commits
  6. 29 Oct, 2019 1 commit
    • Linus Torvalds's avatar
      Merge tag 'fuse-fixes-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · 23fdb198
      Linus Torvalds authored
      Pull fuse fixes from Miklos Szeredi:
       "Mostly virtiofs fixes, but also fixes a regression and couple of
        longstanding data/metadata writeback ordering issues"
      
      * tag 'fuse-fixes-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: redundant get_fuse_inode() calls in fuse_writepages_fill()
        fuse: Add changelog entries for protocols 7.1 - 7.8
        fuse: truncate pending writes on O_TRUNC
        fuse: flush dirty data/metadata before non-truncate setattr
        virtiofs: Remove set but not used variable 'fc'
        virtiofs: Retry request submission from worker context
        virtiofs: Count pending forgets as in_flight forgets
        virtiofs: Set FR_SENT flag only after request has been sent
        virtiofs: No need to check fpq->connected state
        virtiofs: Do not end request in submission context
        fuse: don't advise readdirplus for negative lookup
        fuse: don't dereference req->args on finished request
        virtio-fs: don't show mount options
        virtio-fs: Change module name to virtiofs.ko
      23fdb198
  7. 28 Oct, 2019 6 commits
    • Linus Torvalds's avatar
      Merge tag 'arc-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 8005803a
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta:
       "Small fixes for ARC:
      
         - perf fix for Big Endian build [Alexey]
      
         - hadk platform enable soem peripherals [Eugeniy]"
      
      * tag 'arc-5.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: perf: Accommodate big-endian CPU
        ARC: [plat-hsdk]: Enable on-boardi SPI ADC IC
        ARC: [plat-hsdk]: Enable on-board SPI NOR flash IC
      8005803a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid · 0365fb6b
      Linus Torvalds authored
      Pull HID fixes from Jiri Kosina:
      
       - HID++ device support regression fixes (race condition during cleanup,
         device detection fix, opps fix) from Andrey Smirnov
      
       - disable PM on i2c-hid, as it's causing problems with a lot of
         devices; other OSes apparently don't implement/enable it either; from
         Kai-Heng Feng
      
       - error handling fix in intel-ish driver, from Zhang Lixu
      
       - syzbot fuzzer fix for HID core code from Alan Stern
      
       - a few other tiny fixups (printk message cleanup, new device ID)
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
        HID: i2c-hid: add Trekstor Primebook C11B to descriptor override
        HID: logitech-hidpp: do all FF cleanup in hidpp_ff_destroy()
        HID: logitech-hidpp: rework device validation
        HID: logitech-hidpp: split g920_get_config()
        HID: i2c-hid: Remove runtime power management
        HID: intel-ish-hid: fix wrong error handling in ishtp_cl_alloc_tx_ring()
        HID: google: add magnemite/masterball USB ids
        HID: Fix assumption that devices have inputs
        HID: prodikeys: make array keys static const, makes object smaller
        HID: fix error message in hid_open_report()
      0365fb6b
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 9e5eefba
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "Some minor fixes"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vringh: fix copy direction of vringh_iov_push_kern()
        vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt'
        virtio_ring: fix stalls for packed rings
      9e5eefba
    • Jason Wang's avatar
      vringh: fix copy direction of vringh_iov_push_kern() · b3683dee
      Jason Wang authored
      We want to copy from iov to buf, so the direction was wrong.
      
      Note: no real user for the helper, but it will be used by future
      features.
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      b3683dee
    • Stefano Garzarella's avatar
      vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt' · 67715961
      Stefano Garzarella authored
      The 'work' field was introduced with commit 06a8fc78
      ("VSOCK: Introduce virtio_vsock_common.ko")
      but it is never used in the code, so we can remove it to save
      memory allocated in the per-packet 'struct virtio_vsock_pkt'
      Suggested-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      67715961
    • Marvin Liu's avatar
      virtio_ring: fix stalls for packed rings · 40ce7919
      Marvin Liu authored
      When VIRTIO_F_RING_EVENT_IDX is negotiated, virtio devices can
      use virtqueue_enable_cb_delayed_packed to reduce the number of device
      interrupts.  At the moment, this is the case for virtio-net when the
      napi_tx module parameter is set to false.
      
      In this case, the virtio driver selects an event offset and expects that
      the device will send a notification when rolling over the event offset
      in the ring.  However, if this roll-over happens before the event
      suppression structure update, the notification won't be sent. To address
      this race condition the driver needs to check wether the device rolled
      over the offset after updating the event suppression structure.
      
      With VIRTIO_F_RING_PACKED, the virtio driver did this by reading the
      flags field of the descriptor at the specified offset.
      
      Unfortunately, checking at the event offset isn't reliable: if
      descriptors are chained (e.g. when INDIRECT is off) not all descriptors
      are overwritten by the device, so it's possible that the device skipped
      the specific descriptor driver is checking when writing out used
      descriptors. If this happens, the driver won't detect the race condition
      and will incorrectly expect the device to send a notification.
      
      For virtio-net, the result will be a TX queue stall, with the
      transmission getting blocked forever.
      
      With the packed ring, it isn't easy to find a location which is
      guaranteed to change upon the roll-over, except the next device
      descriptor, as described in the spec:
      
              Writes of device and driver descriptors can generally be
              reordered, but each side (driver and device) are only required to
              poll (or test) a single location in memory: the next device descriptor after
              the one they processed previously, in circular order.
      
      while this might be sub-optimal, let's do exactly this for now.
      
      Cc: stable@vger.kernel.org
      Cc: Jason Wang <jasowang@redhat.com>
      Fixes: f51f9826 ("virtio_ring: leverage event idx in packed ring")
      Signed-off-by: default avatarMarvin Liu <yong.liu@intel.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      40ce7919
  8. 27 Oct, 2019 6 commits
    • Linus Torvalds's avatar
      Linux 5.4-rc5 · d6d5df1d
      Linus Torvalds authored
      d6d5df1d
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 153a971f
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Two fixes for the VMWare guest support:
      
         - Unbreak VMWare platform detection which got wreckaged by converting
           an integer constant to a string constant.
      
         - Fix the clang build of the VMWAre hypercall by explicitely
           specifying the ouput register for INL instead of using the short
           form"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/vmware: Fix platform detection VMWARE_PORT macro
        x86/cpu/vmware: Use the full form of INL in VMWARE_HYPERCALL, for clang/llvm
      153a971f
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 2b776b54
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "A small set of fixes for time(keeping):
      
         - Add a missing include to prevent compiler warnings.
      
         - Make the VDSO implementation of clock_getres() POSIX compliant
           again. A recent change dropped the NULL pointer guard which is
           required as NULL is a valid pointer value for this function.
      
         - Fix two function documentation typos"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        posix-cpu-timers: Fix two trivial comments
        timers/sched_clock: Include local timekeeping.h for missing declarations
        lib/vdso: Make clock_getres() POSIX compliant again
      2b776b54
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a8a31fdc
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A set of perf fixes:
      
        kernel:
      
         - Unbreak the tracking of auxiliary buffer allocations which got
           imbalanced causing recource limit failures.
      
         - Fix the fallout of splitting of ToPA entries which missed to shift
           the base entry PA correctly.
      
         - Use the correct context to lookup the AUX event when unmapping the
           associated AUX buffer so the event can be stopped and the buffer
           reference dropped.
      
        tools:
      
         - Fix buildiid-cache mode setting in copyfile_mode_ns() when copying
           /proc/kcore
      
         - Fix freeing id arrays in the event list so the correct event is
           closed.
      
         - Sync sched.h anc kvm.h headers with the kernel sources.
      
         - Link jvmti against tools/lib/ctype.o to have weak strlcpy().
      
         - Fix multiple memory and file descriptor leaks, found by coverity in
           perf annotate.
      
         - Fix leaks in error handling paths in 'perf c2c', 'perf kmem', found
           by a static analysis tool"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/aux: Fix AUX output stopping
        perf/aux: Fix tracking of auxiliary trace buffer allocation
        perf/x86/intel/pt: Fix base for single entry topa
        perf kmem: Fix memory leak in compact_gfp_flags()
        tools headers UAPI: Sync sched.h with the kernel
        tools headers kvm: Sync kvm.h headers with the kernel sources
        tools headers kvm: Sync kvm headers with the kernel sources
        tools headers kvm: Sync kvm headers with the kernel sources
        perf c2c: Fix memory leak in build_cl_output()
        perf tools: Fix mode setting in copyfile_mode_ns()
        perf annotate: Fix multiple memory and file descriptor leaks
        perf tools: Fix resource leak of closedir() on the error paths
        perf evlist: Fix fix for freed id arrays
        perf jvmti: Link against tools/lib/ctype.h to have weak strlcpy()
      a8a31fdc
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1e1ac1cb
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Two fixes for interrupt controller drivers:
      
         - Skip IRQ_M_EXT entries in the device tree when initializing the
           RISCV PLIC controller to avoid a double init attempt.
      
         - Use the correct ITS list when issuing the VMOVP synchronization
           command so the operation works only on the ITS instances which are
           associated to a VM"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/sifive-plic: Skip contexts except supervisor in plic_init()
        irqchip/gic-v3-its: Use the exact ITSList for VMOVP
      1e1ac1cb
    • Linus Torvalds's avatar
      Merge tag '5.4-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · c9a2e4a8
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Seven cifs/smb3 fixes, including three for stable"
      
      * tag '5.4-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs
        CIFS: Fix use after free of file info structures
        CIFS: Fix retry mid list corruption on reconnects
        cifs: Fix missed free operations
        CIFS: avoid using MID 0xFFFF
        cifs: clarify comment about timestamp granularity for old servers
        cifs: Handle -EINPROGRESS only when noblockcnt is set
      c9a2e4a8