Skip to content
  1. Dec 16, 2016
  2. Dec 15, 2016
    • Michael S. Tsirkin's avatar
      vsock/virtio: fix src/dst cid format · f83f12d6
      Michael S. Tsirkin authored
      
      
      These fields are 64 bit, using le32_to_cpu and friends
      on these will not do the right thing.
      Fix this up.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      f83f12d6
    • Michael S. Tsirkin's avatar
      vsock/virtio: mark an internal function static · 819483d8
      Michael S. Tsirkin authored
      
      
      virtio_transport_alloc_pkt is only used locally, make it static.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      819483d8
    • Michael S. Tsirkin's avatar
      vsock/virtio: add a missing __le annotation · 6c7efafd
      Michael S. Tsirkin authored
      
      
      guest cid is read from config space, therefore it's in little endian
      format and is treated as such, annotate it accordingly.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      6c7efafd
    • Michael S. Tsirkin's avatar
      vhost: add missing __user annotations · 72952cc0
      Michael S. Tsirkin authored
      
      
      Several vhost functions were missing __user annotations
      on pointers, causing sparse warnings. Fix this up.
      
      sparse also warns about vhost_process_iotlb_msg which
      is local and should be static. Fix that up as well.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      72952cc0
    • Michael S. Tsirkin's avatar
      vhost: make interval tree static inline · 2f952c01
      Michael S. Tsirkin authored
      
      
      vhost_umem_interval_tree is only used locally within vhost.c, mark it
      static. As some functions generated go unused, this triggers warnings
      unless we also mark it inline.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      2f952c01
    • Michael S. Tsirkin's avatar
      drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked · 3373755a
      Michael S. Tsirkin authored
      
      
      virtio_gpu_queue_ctrl_buffer_locked is called with ctrlq.qlock taken, it
      releases and acquires this lock.  This causes a sparse warning.  Add
      appropriate annotations for sparse context checking.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      3373755a
    • Michael S. Tsirkin's avatar
      drm/virtio: fix lock context imbalance · f862e60f
      Michael S. Tsirkin authored
      
      
      When virtio_gpu_free_vbufs exits due to list empty, it does not
      drop the free_vbufs lock that it took.
      list empty is not expected to happen anyway, but it can't hurt to fix
      this and drop the lock.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      f862e60f
    • Michael S. Tsirkin's avatar
      drm/virtio: fix endianness in primary_plane_update · 8854a56f
      Michael S. Tsirkin authored
      
      
      virtio_gpu_cmd_transfer_to_host_2d expects x and y
      parameters in LE, but virtio_gpu_primary_plane_update
      passes in the CPU format instead.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      8854a56f
    • Michael S. Tsirkin's avatar
      virtio_console: drop unused config fields · 7328fa64
      Michael S. Tsirkin authored
      
      
      struct ports_device includes a config field including the whole
      virtio_console_config, but only max_nr_ports in there is ever updated or
      used. The rest is unused and in fact does not even mirror the
      device config. Drop everything except max_nr_ports,
      saving some memory.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarJason Wang <jasowang@redhat.com>
      7328fa64
    • Gonglei's avatar
      virtio_ring: fix complaint by sparse · c60923cb
      Gonglei authored
      
      
       # make C=2 CF="-D__CHECK_ENDIAN__" ./drivers/virtio/
      
      drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
      drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
      drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
      drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
      drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
      drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
      drivers/virtio/virtio_ring.c:423:19: warning: incorrect type in assignment (different base types)
      drivers/virtio/virtio_ring.c:423:19:    expected unsigned int [unsigned] [assigned] i
      drivers/virtio/virtio_ring.c:423:19:    got restricted __virtio16 [usertype] next
      drivers/virtio/virtio_ring.c:604:39: warning: incorrect type in initializer (different base types)
      drivers/virtio/virtio_ring.c:604:39:    expected unsigned short [unsigned] [usertype] nextflag
      drivers/virtio/virtio_ring.c:604:39:    got restricted __virtio16
      drivers/virtio/virtio_ring.c:612:33: warning: restricted __virtio16 degrades to integer
      
      Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      c60923cb
    • Gonglei's avatar
      virtio_pci_modern: fix complaint by sparse · 61bd405f
      Gonglei authored
      
      
      drivers/virtio/virtio_pci_modern.c:66:40: warning: incorrect type in argument 2 (different base types)
      drivers/virtio/virtio_pci_modern.c:66:40:    expected unsigned int [noderef] [usertype] <asn:2>*addr
      drivers/virtio/virtio_pci_modern.c:66:40:    got restricted __le32 [noderef] [usertype] <asn:2>*lo
      drivers/virtio/virtio_pci_modern.c:67:33: warning: incorrect type in argument 2 (different base types)
      drivers/virtio/virtio_pci_modern.c:67:33:    expected unsigned int [noderef] [usertype] <asn:2>*addr
      drivers/virtio/virtio_pci_modern.c:67:33:    got restricted __le32 [noderef] [usertype] <asn:2>*hi
      drivers/virtio/virtio_pci_modern.c:150:32: warning: incorrect type in argument 2 (different base types)
      drivers/virtio/virtio_pci_modern.c:150:32:    expected unsigned int [noderef] [usertype] <asn:2>*addr
      drivers/virtio/virtio_pci_modern.c:150:32:    got restricted __le32 [noderef] <asn:2>*<noident>
      drivers/virtio/virtio_pci_modern.c:151:39: warning: incorrect type in argument 1 (different base types)
      drivers/virtio/virtio_pci_modern.c:151:39:    expected unsigned int [noderef] [usertype] <asn:2>*addr
      drivers/virtio/virtio_pci_modern.c:151:39:    got restricted __le32 [noderef] <asn:2>*<noident>
      drivers/virtio/virtio_pci_modern.c:152:32: warning: incorrect type in argument 2 (different base types)
      drivers/virtio/virtio_pci_modern.c:152:32:    expected unsigned int [noderef] [usertype] <asn:2>*addr
      
      Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      61bd405f
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · a57cb1c1
      Linus Torvalds authored
      Merge more updates from Andrew Morton:
      
       - a few misc things
      
       - kexec updates
      
       - DMA-mapping updates to better support networking DMA operations
      
       - IPC updates
      
       - various MM changes to improve DAX fault handling
      
       - lots of radix-tree changes, mainly to the test suite. All leading up
         to reimplementing the IDA/IDR code to be a wrapper layer over the
         radix-tree. However the final trigger-pulling patch is held off for
         4.11.
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits)
        radix tree test suite: delete unused rcupdate.c
        radix tree test suite: add new tag check
        radix-tree: ensure counts are initialised
        radix tree test suite: cache recently freed objects
        radix tree test suite: add some more functionality
        idr: reduce the number of bits per level from 8 to 6
        rxrpc: abstract away knowledge of IDR internals
        tpm: use idr_find(), not idr_find_slowpath()
        idr: add ida_is_empty
        radix tree test suite: check multiorder iteration
        radix-tree: fix replacement for multiorder entries
        radix-tree: add radix_tree_split_preload()
        radix-tree: add radix_tree_split
        radix-tree: add radix_tree_join
        radix-tree: delete radix_tree_range_tag_if_tagged()
        radix-tree: delete radix_tree_locate_item()
        radix-tree: improve multiorder iterators
        btrfs: fix race in btrfs_free_dummy_fs_info()
        radix-tree: improve dump output
        radix-tree: make radix_tree_find_next_bit more useful
        ...
      a57cb1c1
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · cf1b3341
      Linus Torvalds authored
      Pull block IO fixes from Jens Axboe:
       "A few fixes that I collected as post-merge.
      
        I was going to wait a bit with sending this out, but the O_DIRECT fix
        should really go in sooner rather than later"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        blk-mq: Fix failed allocation path when mapping queues
        blk-mq: Avoid memory reclaim when remapping queues
        block_dev: don't update file access position for sync direct IO
        nvme/pci: Log PCI_STATUS when the controller dies
        block_dev: don't test bdev->bd_contains when it is not stable
      cf1b3341
    • Linus Torvalds's avatar
      Merge branch 'for-4.10/fs-unmap' of git://git.kernel.dk/linux-block · 80eabba7
      Linus Torvalds authored
      Pull fs meta data unmap optimization from Jens Axboe:
       "A series from Jan Kara, providing a more efficient way for unmapping
        meta data from in the buffer cache than doing it block-by-block.
      
        Provide a general helper that existing callers can use"
      
      * 'for-4.10/fs-unmap' of git://git.kernel.dk/linux-block:
        fs: Remove unmap_underlying_metadata
        fs: Add helper to clean bdev aliases under a bh and use it
        ext2: Use clean_bdev_aliases() instead of iteration
        ext4: Use clean_bdev_aliases() instead of iteration
        direct-io: Use clean_bdev_aliases() instead of handmade iteration
        fs: Provide function to unmap metadata for a range of blocks
      80eabba7
    • Linus Torvalds's avatar
      docs: add back 'Documentation/Changes' file (as symlink) · 852d21ae
      Linus Torvalds authored
      Jaegeuk Kim reports that the debian kernel package build gets confused
      by the lack of Documentation/Changes file.  We also refer to that path
      name in ver_linux and various how-to files and Kconfig files.
      
      The file got renamed away in commit 186128f7
      
       ("docs-rst: add
      documents to development-process"), and as Jaegeuk Kim points out, the
      commit message for that change says "use symlinks instead of renames",
      but then the commit itself actually does renames after all.
      
      Maybe we should do the other files too, but for now this just adds the
      minimal symlink back to the historical name, so that people looking for
      Documentation/Changes will actually find what they are looking for, and
      the debian scripts continue to work.
      
      Reported-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      852d21ae
    • Matthew Wilcox's avatar
      radix tree test suite: delete unused rcupdate.c · e1e14ab8
      Matthew Wilcox authored
      
      
      This file was used to implement call_rcu() before liburcu implemented
      that function.  It hasn't even been compiled since before the test suite
      was added to the kernel.  Remove it to reduce confusion.
      
      Link: http://lkml.kernel.org/r/1481667692-14500-5-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e1e14ab8
    • Matthew Wilcox's avatar
      radix tree test suite: add new tag check · 092bc0b2
      Matthew Wilcox authored
      
      
      We have a check that setting a tag on a single entry at root succeeds,
      but we were missing a check that clearing a tag on that same entry also
      succeeds.
      
      Link: http://lkml.kernel.org/r/1481667692-14500-4-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      092bc0b2
    • Matthew Wilcox's avatar
      radix-tree: ensure counts are initialised · e8de4340
      Matthew Wilcox authored
      
      
      radix_tree_join() was freeing nodes with a non-zero ->exceptional count,
      and radix_tree_split() wasn't zeroing ->exceptional when it allocated
      the new node.  Fix this by making all callers of radix_tree_node_alloc()
      pass in the new counts (and some other always-initialised fields), which
      will prevent the problem recurring if in future we decide to do
      something similar.
      
      Link: http://lkml.kernel.org/r/1481667692-14500-3-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e8de4340
    • Matthew Wilcox's avatar
      radix tree test suite: cache recently freed objects · bbe9d71f
      Matthew Wilcox authored
      
      
      The kmem_cache_alloc implementation simply allocates new memory from
      malloc() and calls the ctor, which zeroes out the entire object.  This
      means it cannot spot bugs where the object isn't properly reinitialised
      before being freed.
      
      Add a small (11 objects) cache before freeing objects back to malloc.
      This is enough to let us write a test to catch it, although the memory
      allocator is now aware of the structure of the radix tree node, since it
      chains free objects through ->private_data (like the percpu cache does).
      
      Link: http://lkml.kernel.org/r/1481667692-14500-2-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      bbe9d71f
    • Matthew Wilcox's avatar
      radix tree test suite: add some more functionality · de1af8f6
      Matthew Wilcox authored
      
      
      IDR needs more functionality from the kernel: kmalloc()/kfree(), and
      xchg().
      
      Link: http://lkml.kernel.org/r/1480369871-5271-67-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      de1af8f6
    • Matthew Wilcox's avatar
      idr: reduce the number of bits per level from 8 to 6 · 424251a4
      Matthew Wilcox authored
      
      
      In preparation for merging the IDR and radix tree, reduce the fanout at
      each level from 256 to 64.  If this causes a performance problem then a
      bisect will point to this commit, and we'll have a better idea about
      what we might do to fix it.
      
      Link: http://lkml.kernel.org/r/1480369871-5271-66-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      424251a4
    • Matthew Wilcox's avatar
      rxrpc: abstract away knowledge of IDR internals · 44430612
      Matthew Wilcox authored
      
      
      Add idr_get_cursor() / idr_set_cursor() APIs, and remove the reference
      to IDR_SIZE.
      
      Link: http://lkml.kernel.org/r/1480369871-5271-65-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      44430612
    • Matthew Wilcox's avatar
      tpm: use idr_find(), not idr_find_slowpath() · 37f4915f
      Matthew Wilcox authored
      
      
      idr_find_slowpath() is not intended to be part of the public API, it's
      an implementation detail.  There's no reason to skip straight to the
      slowpath here.
      
      Link: http://lkml.kernel.org/r/1480369871-5271-64-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      Cc: Marcel Selhorst <tpmdd@selhorst.net>
      Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      37f4915f
    • Matthew Wilcox's avatar
      idr: add ida_is_empty · 99c49407
      Matthew Wilcox authored
      
      
      Two of the USB Gadgets were poking around in the internals of struct ida
      in order to determine if it is empty.  Add the appropriate abstraction.
      
      Link: http://lkml.kernel.org/r/1480369871-5271-63-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
      Acked-by: default avatarKonstantin Khlebnikov <koct9i@gmail.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      99c49407
    • Matthew Wilcox's avatar
      radix tree test suite: check multiorder iteration · 3e3cdc68
      Matthew Wilcox authored
      
      
      The random iteration test only inserts order-0 entries currently.
      Update it to insert entries of order between 7 and 0.  Also make the
      maximum index configurable, make some variables static, make the test
      duration variable, remove some useless spinning, and add a fifth thread
      which calls tag_tagged_items().
      
      Link: http://lkml.kernel.org/r/1480369871-5271-62-git-send-email-mawilcox@linuxonhyperv.com
      Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Tested-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3e3cdc68