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-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull iommu fixes from Joerg Roedel:

- AMD IOMMU fix for sg-mapping with sg->offset > PAGE_SIZE

- Fix for IOVA code to trigger the slow-path less often

- Two fixes for Intel VT-d to avoid writing to read-only registers and
to flush the right domain id for the default domains in scalable mode

* tag 'iommu-fixes-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/vt-d: Save the right domain ID used by hardware
iommu/vt-d: Check capability before disabling protected memory
iommu/iova: Fix tracking of recently failed iova address
iommu/amd: fix sg->dma_address for sg->offset bigger than PAGE_SIZE

+13 -4
+6 -1
drivers/iommu/amd_iommu.c
··· 2608 2608 2609 2609 /* Everything is mapped - write the right values into s->dma_address */ 2610 2610 for_each_sg(sglist, s, nelems, i) { 2611 - s->dma_address += address + s->offset; 2611 + /* 2612 + * Add in the remaining piece of the scatter-gather offset that 2613 + * was masked out when we were determining the physical address 2614 + * via (sg_phys(s) & PAGE_MASK) earlier. 2615 + */ 2616 + s->dma_address += address + (s->offset & ~PAGE_MASK); 2612 2617 s->dma_length = s->length; 2613 2618 } 2614 2619
+4 -1
drivers/iommu/intel-iommu.c
··· 1538 1538 u32 pmen; 1539 1539 unsigned long flags; 1540 1540 1541 + if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap)) 1542 + return; 1543 + 1541 1544 raw_spin_lock_irqsave(&iommu->register_lock, flags); 1542 1545 pmen = readl(iommu->reg + DMAR_PMEN_REG); 1543 1546 pmen &= ~DMA_PMEN_EPM; ··· 5335 5332 5336 5333 ctx_lo = context[0].lo; 5337 5334 5338 - sdev->did = domain->iommu_did[iommu->seq_id]; 5335 + sdev->did = FLPT_DEFAULT_DID; 5339 5336 sdev->sid = PCI_DEVID(info->bus, info->devfn); 5340 5337 5341 5338 if (!(ctx_lo & CONTEXT_PASIDE)) {
+3 -2
drivers/iommu/iova.c
··· 207 207 curr_iova = rb_entry(curr, struct iova, node); 208 208 } while (curr && new_pfn <= curr_iova->pfn_hi); 209 209 210 - if (limit_pfn < size || new_pfn < iovad->start_pfn) 210 + if (limit_pfn < size || new_pfn < iovad->start_pfn) { 211 + iovad->max32_alloc_size = size; 211 212 goto iova32_full; 213 + } 212 214 213 215 /* pfn_lo will point to size aligned address if size_aligned is set */ 214 216 new->pfn_lo = new_pfn; ··· 224 222 return 0; 225 223 226 224 iova32_full: 227 - iovad->max32_alloc_size = size; 228 225 spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); 229 226 return -ENOMEM; 230 227 }