Commit a2316dda authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'iommu-fixes-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull iommu fixes from Joerg Roedel:

 - Two cache flushing fixes for Intel and AMD drivers

 - AMD guest translation enabling fix

 - Update IOMMU tree location in MAINTAINERS file

* tag 'iommu-fixes-v6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  MAINTAINERS: Update IOMMU tree location
  iommu/amd: Fix GT feature enablement again
  iommu/vt-d: Fix missed device TLB cache tag
  iommu/amd: Invalidate cache before removing device from domain list
parents 1cf06684 09aaa2d0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1044,7 +1044,7 @@ M: Joerg Roedel <joro@8bytes.org>
R:	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
L:	iommu@lists.linux.dev
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F:	drivers/iommu/amd/
F:	include/linux/amd-iommu.h
@@ -11157,7 +11157,7 @@ M: David Woodhouse <dwmw2@infradead.org>
M:	Lu Baolu <baolu.lu@linux.intel.com>
L:	iommu@lists.linux.dev
S:	Supported
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F:	drivers/iommu/intel/
INTEL IPU3 CSI-2 CIO2 DRIVER
@@ -11530,7 +11530,7 @@ IOMMU DMA-API LAYER
M:	Robin Murphy <robin.murphy@arm.com>
L:	iommu@lists.linux.dev
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F:	drivers/iommu/dma-iommu.c
F:	drivers/iommu/dma-iommu.h
F:	drivers/iommu/iova.c
@@ -11542,7 +11542,7 @@ M: Will Deacon <will@kernel.org>
R:	Robin Murphy <robin.murphy@arm.com>
L:	iommu@lists.linux.dev
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux.git
F:	Documentation/devicetree/bindings/iommu/
F:	Documentation/userspace-api/iommu.rst
F:	drivers/iommu/
+1 −0
Original line number Diff line number Diff line
@@ -2743,6 +2743,7 @@ static void early_enable_iommu(struct amd_iommu *iommu)
	iommu_enable_command_buffer(iommu);
	iommu_enable_event_buffer(iommu);
	iommu_set_exclusion_range(iommu);
	iommu_enable_gt(iommu);
	iommu_enable_ga(iommu);
	iommu_enable_xt(iommu);
	iommu_enable_irtcachedis(iommu);
+6 −6
Original line number Diff line number Diff line
@@ -2061,6 +2061,12 @@ static void do_detach(struct iommu_dev_data *dev_data)
	struct protection_domain *domain = dev_data->domain;
	struct amd_iommu *iommu = get_amd_iommu_from_dev_data(dev_data);

	/* Clear DTE and flush the entry */
	amd_iommu_dev_update_dte(dev_data, false);

	/* Flush IOTLB and wait for the flushes to finish */
	amd_iommu_domain_flush_all(domain);

	/* Clear GCR3 table */
	if (pdom_is_sva_capable(domain))
		destroy_gcr3_table(dev_data, domain);
@@ -2069,12 +2075,6 @@ static void do_detach(struct iommu_dev_data *dev_data)
	dev_data->domain = NULL;
	list_del(&dev_data->list);

	/* Clear DTE and flush the entry */
	amd_iommu_dev_update_dte(dev_data, false);

	/* Flush IOTLB and wait for the flushes to finish */
	amd_iommu_domain_flush_all(domain);

	/* decrease reference counters - needs to happen after the flushes */
	domain->dev_iommu[iommu->index] -= 1;
	domain->dev_cnt                 -= 1;
+10 −10
Original line number Diff line number Diff line
@@ -2114,12 +2114,6 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
	if (ret)
		return ret;

	ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
	if (ret) {
		domain_detach_iommu(domain, iommu);
		return ret;
	}

	info->domain = domain;
	spin_lock_irqsave(&domain->lock, flags);
	list_add(&info->link, &domain->devices);
@@ -2137,15 +2131,21 @@ static int dmar_domain_attach_device(struct dmar_domain *domain,
	else
		ret = intel_pasid_setup_second_level(iommu, domain, dev, IOMMU_NO_PASID);

	if (ret) {
		device_block_translation(dev);
		return ret;
	}
	if (ret)
		goto out_block_translation;

	if (sm_supported(info->iommu) || !domain_type_is_si(info->domain))
		iommu_enable_pci_caps(info);

	ret = cache_tag_assign_domain(domain, dev, IOMMU_NO_PASID);
	if (ret)
		goto out_block_translation;

	return 0;

out_block_translation:
	device_block_translation(dev);
	return ret;
}

/**