Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfio-v5.12-rc4' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

- Fix 32-bit issue with new unmap-all flag (Steve Sistare)

- Various Kconfig changes for better coverage (Jason Gunthorpe)

- Fix to batch pinning support (Daniel Jordan)

* tag 'vfio-v5.12-rc4' of git://github.com/awilliam/linux-vfio:
vfio/type1: fix vaddr_get_pfns() return in vfio_pin_page_external()
vfio: Depend on MMU
ARM: amba: Allow some ARM_AMBA users to compile with COMPILE_TEST
vfio-platform: Add COMPILE_TEST to VFIO_PLATFORM
vfio: IOMMU_API should be selected
vfio/type1: fix unmap all on ILP32

+27 -12
+2 -2
drivers/vfio/Kconfig
··· 21 21 22 22 menuconfig VFIO 23 23 tristate "VFIO Non-Privileged userspace driver framework" 24 - depends on IOMMU_API 25 - select VFIO_IOMMU_TYPE1 if (X86 || S390 || ARM || ARM64) 24 + select IOMMU_API 25 + select VFIO_IOMMU_TYPE1 if MMU && (X86 || S390 || ARM || ARM64) 26 26 help 27 27 VFIO provides a framework for secure userspace device drivers. 28 28 See Documentation/driver-api/vfio.rst for more details.
+2 -2
drivers/vfio/platform/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config VFIO_PLATFORM 3 3 tristate "VFIO support for platform devices" 4 - depends on VFIO && EVENTFD && (ARM || ARM64) 4 + depends on VFIO && EVENTFD && (ARM || ARM64 || COMPILE_TEST) 5 5 select VFIO_VIRQFD 6 6 help 7 7 Support for platform devices with VFIO. This is required to make ··· 12 12 13 13 config VFIO_AMBA 14 14 tristate "VFIO support for AMBA devices" 15 - depends on VFIO_PLATFORM && ARM_AMBA 15 + depends on VFIO_PLATFORM && (ARM_AMBA || COMPILE_TEST) 16 16 help 17 17 Support for ARM AMBA devices with VFIO. This is required to make 18 18 use of ARM AMBA devices present on the system using the VFIO
+12 -8
drivers/vfio/vfio_iommu_type1.c
··· 189 189 } 190 190 191 191 static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu, 192 - dma_addr_t start, size_t size) 192 + dma_addr_t start, u64 size) 193 193 { 194 194 struct rb_node *res = NULL; 195 195 struct rb_node *node = iommu->dma_list.rb_node; ··· 785 785 return -ENODEV; 786 786 787 787 ret = vaddr_get_pfns(mm, vaddr, 1, dma->prot, pfn_base, pages); 788 - if (ret == 1 && do_accounting && !is_invalid_reserved_pfn(*pfn_base)) { 788 + if (ret != 1) 789 + goto out; 790 + 791 + ret = 0; 792 + 793 + if (do_accounting && !is_invalid_reserved_pfn(*pfn_base)) { 789 794 ret = vfio_lock_acct(dma, 1, true); 790 795 if (ret) { 791 796 put_pfn(*pfn_base, dma->prot); ··· 802 797 } 803 798 } 804 799 800 + out: 805 801 mmput(mm); 806 802 return ret; 807 803 } ··· 1294 1288 int ret = -EINVAL, retries = 0; 1295 1289 unsigned long pgshift; 1296 1290 dma_addr_t iova = unmap->iova; 1297 - unsigned long size = unmap->size; 1291 + u64 size = unmap->size; 1298 1292 bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL; 1299 1293 bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR; 1300 1294 struct rb_node *n, *first_n; ··· 1310 1304 if (unmap_all) { 1311 1305 if (iova || size) 1312 1306 goto unlock; 1313 - size = SIZE_MAX; 1314 - } else if (!size || size & (pgsize - 1)) { 1307 + size = U64_MAX; 1308 + } else if (!size || size & (pgsize - 1) || 1309 + iova + size - 1 < iova || size > SIZE_MAX) { 1315 1310 goto unlock; 1316 1311 } 1317 - 1318 - if (iova + size - 1 < iova || size > SIZE_MAX) 1319 - goto unlock; 1320 1312 1321 1313 /* When dirty tracking is enabled, allow only min supported pgsize */ 1322 1314 if ((unmap->flags & VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP) &&
+11
include/linux/amba/bus.h
··· 105 105 #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) 106 106 #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) 107 107 108 + #ifdef CONFIG_ARM_AMBA 108 109 int amba_driver_register(struct amba_driver *); 109 110 void amba_driver_unregister(struct amba_driver *); 111 + #else 112 + static inline int amba_driver_register(struct amba_driver *drv) 113 + { 114 + return -EINVAL; 115 + } 116 + static inline void amba_driver_unregister(struct amba_driver *drv) 117 + { 118 + } 119 + #endif 120 + 110 121 struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t); 111 122 void amba_device_put(struct amba_device *); 112 123 int amba_device_add(struct amba_device *, struct resource *);