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 'iommu-fixes-v4.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:
"Three fixes:

- Fix use of smp_processor_id() in preemptible code in the IOVA
allocation code. This got introduced with the scalability
improvements in this release cycle.

- A VT-d fix for out-of-bounds access of the iommu->domains array.
The bug showed during suspend/resume.

- AMD IOMMU fix to print the correct device id in the ACPI parsing
code"

* tag 'iommu-fixes-v4.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/amd: Initialize devid variable before using it
iommu/vt-d: Fix overflow of iommu->domains array
iommu/iova: Disable preemption around use of this_cpu_ptr()

+8 -4
+1 -1
drivers/iommu/amd_iommu_init.c
··· 1107 1107 break; 1108 1108 } 1109 1109 1110 + devid = e->devid; 1110 1111 DUMP_printk(" DEV_ACPI_HID(%s[%s])\t\tdevid: %02x:%02x.%x\n", 1111 1112 hid, uid, 1112 1113 PCI_BUS_NUM(devid), 1113 1114 PCI_SLOT(devid), 1114 1115 PCI_FUNC(devid)); 1115 1116 1116 - devid = e->devid; 1117 1117 flags = e->flags; 1118 1118 1119 1119 ret = add_acpi_hid_device(hid, uid, &devid, false);
+1 -1
drivers/iommu/intel-iommu.c
··· 4607 4607 if (!iommu) 4608 4608 continue; 4609 4609 4610 - for (did = 0; did < 0xffff; did++) { 4610 + for (did = 0; did < cap_ndoms(iommu->cap); did++) { 4611 4611 domain = get_iommu_domain(iommu, did); 4612 4612 4613 4613 if (!domain)
+6 -2
drivers/iommu/iova.c
··· 420 420 421 421 /* Try replenishing IOVAs by flushing rcache. */ 422 422 flushed_rcache = true; 423 + preempt_disable(); 423 424 for_each_online_cpu(cpu) 424 425 free_cpu_cached_iovas(cpu, iovad); 426 + preempt_enable(); 425 427 goto retry; 426 428 } 427 429 ··· 751 749 bool can_insert = false; 752 750 unsigned long flags; 753 751 754 - cpu_rcache = this_cpu_ptr(rcache->cpu_rcaches); 752 + cpu_rcache = get_cpu_ptr(rcache->cpu_rcaches); 755 753 spin_lock_irqsave(&cpu_rcache->lock, flags); 756 754 757 755 if (!iova_magazine_full(cpu_rcache->loaded)) { ··· 781 779 iova_magazine_push(cpu_rcache->loaded, iova_pfn); 782 780 783 781 spin_unlock_irqrestore(&cpu_rcache->lock, flags); 782 + put_cpu_ptr(rcache->cpu_rcaches); 784 783 785 784 if (mag_to_free) { 786 785 iova_magazine_free_pfns(mag_to_free, iovad); ··· 815 812 bool has_pfn = false; 816 813 unsigned long flags; 817 814 818 - cpu_rcache = this_cpu_ptr(rcache->cpu_rcaches); 815 + cpu_rcache = get_cpu_ptr(rcache->cpu_rcaches); 819 816 spin_lock_irqsave(&cpu_rcache->lock, flags); 820 817 821 818 if (!iova_magazine_empty(cpu_rcache->loaded)) { ··· 837 834 iova_pfn = iova_magazine_pop(cpu_rcache->loaded, limit_pfn); 838 835 839 836 spin_unlock_irqrestore(&cpu_rcache->lock, flags); 837 + put_cpu_ptr(rcache->cpu_rcaches); 840 838 841 839 return iova_pfn; 842 840 }