]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 10 Mar 2019 19:47:57 +0000 (12:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 10 Mar 2019 19:47:57 +0000 (12:47 -0700)
Pull virtio updates from Michael Tsirkin:
 "Several fixes, most notably fix for virtio on swiotlb systems"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vhost: silence an unused-variable warning
  virtio: hint if callbacks surprisingly might sleep
  virtio-ccw: wire up ->bus_name callback
  s390/virtio: handle find on invalid queue gracefully
  virtio-ccw: diag 500 may return a negative cookie
  virtio_balloon: remove the unnecessary 0-initialization
  virtio-balloon: improve update_balloon_size_func
  virtio-blk: Consider virtio_max_dma_size() for maximum segment size
  virtio: Introduce virtio_max_dma_size()
  dma: Introduce dma_max_mapping_size()
  swiotlb: Add is_swiotlb_active() function
  swiotlb: Introduce swiotlb_max_mapping_size()

1  2 
Documentation/DMA-API.txt
include/linux/dma-mapping.h
include/linux/swiotlb.h
kernel/dma/direct.c
kernel/dma/mapping.c
kernel/dma/swiotlb.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index a9ad02d4d84e2ffa431fa6018f26a2c3f039cd6e,c873f9cc21460536f52edd26966a7b6cd668948d..9f5851064aea6854b426fa34ffe3ab10588666fe
@@@ -666,35 -651,28 +666,49 @@@ bool swiotlb_map(struct device *dev, ph
        return true;
  }
  
 -/*
 - * Return whether the given device DMA address mask can be supported
 - * properly.  For example, if your device can only drive the low 24-bits
 - * during bus mastering, then you would pass 0x00ffffff as the mask to
 - * this function.
 - */
 -int
 -swiotlb_dma_supported(struct device *hwdev, u64 mask)
 -{
 -      return __phys_to_dma(hwdev, io_tlb_end - 1) <= mask;
 -}
 -
+ size_t swiotlb_max_mapping_size(struct device *dev)
+ {
+       return ((size_t)1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE;
+ }
+ bool is_swiotlb_active(void)
+ {
+       /*
+        * When SWIOTLB is initialized, even if io_tlb_start points to physical
+        * address zero, io_tlb_end surely doesn't.
+        */
+       return io_tlb_end != 0;
+ }
++
 +#ifdef CONFIG_DEBUG_FS
 +
 +static int __init swiotlb_create_debugfs(void)
 +{
 +      struct dentry *d_swiotlb_usage;
 +      struct dentry *ent;
 +
 +      d_swiotlb_usage = debugfs_create_dir("swiotlb", NULL);
 +
 +      if (!d_swiotlb_usage)
 +              return -ENOMEM;
 +
 +      ent = debugfs_create_ulong("io_tlb_nslabs", 0400,
 +                                 d_swiotlb_usage, &io_tlb_nslabs);
 +      if (!ent)
 +              goto fail;
 +
 +      ent = debugfs_create_ulong("io_tlb_used", 0400,
 +                                 d_swiotlb_usage, &io_tlb_used);
 +      if (!ent)
 +              goto fail;
 +
 +      return 0;
 +
 +fail:
 +      debugfs_remove_recursive(d_swiotlb_usage);
 +      return -ENOMEM;
 +}
 +
 +late_initcall(swiotlb_create_debugfs);
 +
 +#endif