Commit 810531a1 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

iommu/vt-d: Enable PCI/IMS



PCI/IMS works like PCI/MSI-X in the remapping. Just add the feature flag,
but only when on real hardware.

Virtualized IOMMUs need additional support, e.g. for PASID.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124232327.081482253@linutronix.de
parent 6e24c887
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static const struct irq_domain_ops intel_ir_domain_ops;

static void iommu_disable_irq_remapping(struct intel_iommu *iommu);
static int __init parse_ioapics_under_ir(void);
static const struct msi_parent_ops dmar_msi_parent_ops;
static const struct msi_parent_ops dmar_msi_parent_ops, virt_dmar_msi_parent_ops;

static bool ir_pre_enabled(struct intel_iommu *iommu)
{
@@ -577,6 +577,10 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)

	irq_domain_update_bus_token(iommu->ir_domain,  DOMAIN_BUS_DMAR);
	iommu->ir_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;

	if (cap_caching_mode(iommu->cap))
		iommu->ir_domain->msi_parent_ops = &virt_dmar_msi_parent_ops;
	else
		iommu->ir_domain->msi_parent_ops = &dmar_msi_parent_ops;

	ir_table->base = page_address(pages);
@@ -1429,11 +1433,20 @@ static const struct irq_domain_ops intel_ir_domain_ops = {
};

static const struct msi_parent_ops dmar_msi_parent_ops = {
	.supported_flags	= X86_VECTOR_MSI_FLAGS_SUPPORTED | MSI_FLAG_MULTI_PCI_MSI,
	.supported_flags	= X86_VECTOR_MSI_FLAGS_SUPPORTED |
				  MSI_FLAG_MULTI_PCI_MSI |
				  MSI_FLAG_PCI_IMS,
	.prefix			= "IR-",
	.init_dev_msi_info	= msi_parent_init_dev_msi_info,
};

static const struct msi_parent_ops virt_dmar_msi_parent_ops = {
	.supported_flags	= X86_VECTOR_MSI_FLAGS_SUPPORTED |
				  MSI_FLAG_MULTI_PCI_MSI,
	.prefix			= "vIR-",
	.init_dev_msi_info	= msi_parent_init_dev_msi_info,
};

/*
 * Support of Interrupt Remapping Unit Hotplug
 */