Skip to content

Commit 375a99f

Browse files
committed
Merge branch 'pci/ims-removal'
- Remove unused Interrupt Message Store (IMS) support (Bjorn Helgaas) * pci/ims-removal: Revert "genirq/msi: Provide constants for PCI/IMS support" Revert "x86/apic/msi: Enable PCI/IMS" Revert "iommu/vt-d: Enable PCI/IMS" Revert "iommu/amd: Enable PCI/IMS" Revert "PCI/MSI: Provide IMS (Interrupt Message Store) support" Revert "PCI/MSI: Provide pci_ims_alloc/free_irq()" Revert "PCI/MSI: Provide stubs for IMS functions"
2 parents f889102 + 8a1940b commit 375a99f

File tree

9 files changed

+5
-175
lines changed

9 files changed

+5
-175
lines changed

arch/x86/kernel/apic/msi.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ static int x86_msi_prepare(struct irq_domain *domain, struct device *dev,
184184
alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSI;
185185
return 0;
186186
case DOMAIN_BUS_PCI_DEVICE_MSIX:
187-
case DOMAIN_BUS_PCI_DEVICE_IMS:
188187
alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX;
189188
return 0;
190189
default:
@@ -229,10 +228,6 @@ static bool x86_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
229228
case DOMAIN_BUS_PCI_DEVICE_MSI:
230229
case DOMAIN_BUS_PCI_DEVICE_MSIX:
231230
break;
232-
case DOMAIN_BUS_PCI_DEVICE_IMS:
233-
if (!(pops->supported_flags & MSI_FLAG_PCI_IMS))
234-
return false;
235-
break;
236231
default:
237232
WARN_ON_ONCE(1);
238233
return false;

drivers/iommu/amd/iommu.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,20 +3701,11 @@ static struct irq_chip amd_ir_chip = {
37013701
};
37023702

37033703
static const struct msi_parent_ops amdvi_msi_parent_ops = {
3704-
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED |
3705-
MSI_FLAG_MULTI_PCI_MSI |
3706-
MSI_FLAG_PCI_IMS,
3704+
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED | MSI_FLAG_MULTI_PCI_MSI,
37073705
.prefix = "IR-",
37083706
.init_dev_msi_info = msi_parent_init_dev_msi_info,
37093707
};
37103708

3711-
static const struct msi_parent_ops virt_amdvi_msi_parent_ops = {
3712-
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED |
3713-
MSI_FLAG_MULTI_PCI_MSI,
3714-
.prefix = "vIR-",
3715-
.init_dev_msi_info = msi_parent_init_dev_msi_info,
3716-
};
3717-
37183709
int amd_iommu_create_irq_domain(struct amd_iommu *iommu)
37193710
{
37203711
struct fwnode_handle *fn;
@@ -3732,11 +3723,7 @@ int amd_iommu_create_irq_domain(struct amd_iommu *iommu)
37323723
irq_domain_update_bus_token(iommu->ir_domain, DOMAIN_BUS_AMDVI);
37333724
iommu->ir_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT |
37343725
IRQ_DOMAIN_FLAG_ISOLATED_MSI;
3735-
3736-
if (amd_iommu_np_cache)
3737-
iommu->ir_domain->msi_parent_ops = &virt_amdvi_msi_parent_ops;
3738-
else
3739-
iommu->ir_domain->msi_parent_ops = &amdvi_msi_parent_ops;
3726+
iommu->ir_domain->msi_parent_ops = &amdvi_msi_parent_ops;
37403727

37413728
return 0;
37423729
}

drivers/iommu/intel/irq_remapping.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static const struct irq_domain_ops intel_ir_domain_ops;
8282

8383
static void iommu_disable_irq_remapping(struct intel_iommu *iommu);
8484
static int __init parse_ioapics_under_ir(void);
85-
static const struct msi_parent_ops dmar_msi_parent_ops, virt_dmar_msi_parent_ops;
85+
static const struct msi_parent_ops dmar_msi_parent_ops;
8686

8787
static bool ir_pre_enabled(struct intel_iommu *iommu)
8888
{
@@ -567,11 +567,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
567567
irq_domain_update_bus_token(iommu->ir_domain, DOMAIN_BUS_DMAR);
568568
iommu->ir_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT |
569569
IRQ_DOMAIN_FLAG_ISOLATED_MSI;
570-
571-
if (cap_caching_mode(iommu->cap))
572-
iommu->ir_domain->msi_parent_ops = &virt_dmar_msi_parent_ops;
573-
else
574-
iommu->ir_domain->msi_parent_ops = &dmar_msi_parent_ops;
570+
iommu->ir_domain->msi_parent_ops = &dmar_msi_parent_ops;
575571

576572
ir_table->base = page_address(pages);
577573
ir_table->bitmap = bitmap;
@@ -1421,20 +1417,11 @@ static const struct irq_domain_ops intel_ir_domain_ops = {
14211417
};
14221418

14231419
static const struct msi_parent_ops dmar_msi_parent_ops = {
1424-
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED |
1425-
MSI_FLAG_MULTI_PCI_MSI |
1426-
MSI_FLAG_PCI_IMS,
1420+
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED | MSI_FLAG_MULTI_PCI_MSI,
14271421
.prefix = "IR-",
14281422
.init_dev_msi_info = msi_parent_init_dev_msi_info,
14291423
};
14301424

1431-
static const struct msi_parent_ops virt_dmar_msi_parent_ops = {
1432-
.supported_flags = X86_VECTOR_MSI_FLAGS_SUPPORTED |
1433-
MSI_FLAG_MULTI_PCI_MSI,
1434-
.prefix = "vIR-",
1435-
.init_dev_msi_info = msi_parent_init_dev_msi_info,
1436-
};
1437-
14381425
/*
14391426
* Support of Interrupt Remapping Unit Hotplug
14401427
*/

drivers/pci/msi/api.c

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -365,56 +365,6 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
365365
}
366366
EXPORT_SYMBOL(pci_irq_get_affinity);
367367

368-
/**
369-
* pci_ims_alloc_irq - Allocate an interrupt on a PCI/IMS interrupt domain
370-
* @dev: The PCI device to operate on
371-
* @icookie: Pointer to an IMS implementation specific cookie for this
372-
* IMS instance (PASID, queue ID, pointer...).
373-
* The cookie content is copied into the MSI descriptor for the
374-
* interrupt chip callbacks or domain specific setup functions.
375-
* @affdesc: Optional pointer to an interrupt affinity descriptor
376-
*
377-
* There is no index for IMS allocations as IMS is an implementation
378-
* specific storage and does not have any direct associations between
379-
* index, which might be a pure software construct, and device
380-
* functionality. This association is established by the driver either via
381-
* the index - if there is a hardware table - or in case of purely software
382-
* managed IMS implementation the association happens via the
383-
* irq_write_msi_msg() callback of the implementation specific interrupt
384-
* chip, which utilizes the provided @icookie to store the MSI message in
385-
* the appropriate place.
386-
*
387-
* Return: A struct msi_map
388-
*
389-
* On success msi_map::index contains the allocated index (>= 0) and
390-
* msi_map::virq the allocated Linux interrupt number (> 0).
391-
*
392-
* On fail msi_map::index contains the error code and msi_map::virq
393-
* is set to 0.
394-
*/
395-
struct msi_map pci_ims_alloc_irq(struct pci_dev *dev, union msi_instance_cookie *icookie,
396-
const struct irq_affinity_desc *affdesc)
397-
{
398-
return msi_domain_alloc_irq_at(&dev->dev, MSI_SECONDARY_DOMAIN, MSI_ANY_INDEX,
399-
affdesc, icookie);
400-
}
401-
EXPORT_SYMBOL_GPL(pci_ims_alloc_irq);
402-
403-
/**
404-
* pci_ims_free_irq - Allocate an interrupt on a PCI/IMS interrupt domain
405-
* which was allocated via pci_ims_alloc_irq()
406-
* @dev: The PCI device to operate on
407-
* @map: A struct msi_map describing the interrupt to free as
408-
* returned from pci_ims_alloc_irq()
409-
*/
410-
void pci_ims_free_irq(struct pci_dev *dev, struct msi_map map)
411-
{
412-
if (WARN_ON_ONCE(map.index < 0 || map.virq <= 0))
413-
return;
414-
msi_domain_free_irqs_range(&dev->dev, MSI_SECONDARY_DOMAIN, map.index, map.index);
415-
}
416-
EXPORT_SYMBOL_GPL(pci_ims_free_irq);
417-
418368
/**
419369
* pci_free_irq_vectors() - Free previously allocated IRQs for a device
420370
* @dev: the PCI device to operate on

drivers/pci/msi/irqdomain.c

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -355,65 +355,6 @@ bool pci_msi_domain_supports(struct pci_dev *pdev, unsigned int feature_mask,
355355
return (supported & feature_mask) == feature_mask;
356356
}
357357

358-
/**
359-
* pci_create_ims_domain - Create a secondary IMS domain for a PCI device
360-
* @pdev: The PCI device to operate on
361-
* @template: The MSI info template which describes the domain
362-
* @hwsize: The size of the hardware entry table or 0 if the domain
363-
* is purely software managed
364-
* @data: Optional pointer to domain specific data to be stored
365-
* in msi_domain_info::data
366-
*
367-
* Return: True on success, false otherwise
368-
*
369-
* An IMS domain is expected to have the following constraints:
370-
* - The index space is managed by the core code
371-
*
372-
* - There is no requirement for consecutive index ranges
373-
*
374-
* - The interrupt chip must provide the following callbacks:
375-
* - irq_mask()
376-
* - irq_unmask()
377-
* - irq_write_msi_msg()
378-
*
379-
* - The interrupt chip must provide the following optional callbacks
380-
* when the irq_mask(), irq_unmask() and irq_write_msi_msg() callbacks
381-
* cannot operate directly on hardware, e.g. in the case that the
382-
* interrupt message store is in queue memory:
383-
* - irq_bus_lock()
384-
* - irq_bus_unlock()
385-
*
386-
* These callbacks are invoked from preemptible task context and are
387-
* allowed to sleep. In this case the mandatory callbacks above just
388-
* store the information. The irq_bus_unlock() callback is supposed
389-
* to make the change effective before returning.
390-
*
391-
* - Interrupt affinity setting is handled by the underlying parent
392-
* interrupt domain and communicated to the IMS domain via
393-
* irq_write_msi_msg().
394-
*
395-
* The domain is automatically destroyed when the PCI device is removed.
396-
*/
397-
bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
398-
unsigned int hwsize, void *data)
399-
{
400-
struct irq_domain *domain = dev_get_msi_domain(&pdev->dev);
401-
402-
if (!domain || !irq_domain_is_msi_parent(domain))
403-
return false;
404-
405-
if (template->info.bus_token != DOMAIN_BUS_PCI_DEVICE_IMS ||
406-
!(template->info.flags & MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS) ||
407-
!(template->info.flags & MSI_FLAG_FREE_MSI_DESCS) ||
408-
!template->chip.irq_mask || !template->chip.irq_unmask ||
409-
!template->chip.irq_write_msi_msg || template->chip.irq_set_affinity)
410-
return false;
411-
412-
return msi_create_device_irq_domain(&pdev->dev, MSI_SECONDARY_DOMAIN, template,
413-
hwsize, data, NULL);
414-
}
415-
EXPORT_SYMBOL_GPL(pci_create_ims_domain);
416-
417358
/*
418359
* Users of the generic MSI infrastructure expect a device to have a single ID,
419360
* so with DMA aliases we have to pick the least-worst compromise. Devices with

include/linux/irqdomain_defs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ enum irq_domain_bus_token {
2525
DOMAIN_BUS_PCI_DEVICE_MSIX,
2626
DOMAIN_BUS_DMAR,
2727
DOMAIN_BUS_AMDVI,
28-
DOMAIN_BUS_PCI_DEVICE_IMS,
2928
DOMAIN_BUS_DEVICE_MSI,
3029
DOMAIN_BUS_WIRED_TO_MSI,
3130
};

include/linux/msi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,6 @@ enum {
573573
MSI_FLAG_MSIX_CONTIGUOUS = (1 << 19),
574574
/* PCI/MSI-X vectors can be dynamically allocated/freed post MSI-X enable */
575575
MSI_FLAG_PCI_MSIX_ALLOC_DYN = (1 << 20),
576-
/* Support for PCI/IMS */
577-
MSI_FLAG_PCI_IMS = (1 << 21),
578576
};
579577

580578
/**

include/linux/msi_api.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ struct device;
1515
*/
1616
enum msi_domain_ids {
1717
MSI_DEFAULT_DOMAIN,
18-
MSI_SECONDARY_DOMAIN,
1918
MSI_MAX_DEVICE_IRQDOMAINS,
2019
};
2120

include/linux/pci.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,8 +1656,6 @@ struct msix_entry {
16561656
u16 entry; /* Driver uses to specify entry, OS writes */
16571657
};
16581658

1659-
struct msi_domain_template;
1660-
16611659
#ifdef CONFIG_PCI_MSI
16621660
int pci_msi_vec_count(struct pci_dev *dev);
16631661
void pci_disable_msi(struct pci_dev *dev);
@@ -1690,11 +1688,6 @@ void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map);
16901688
void pci_free_irq_vectors(struct pci_dev *dev);
16911689
int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
16921690
const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
1693-
bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
1694-
unsigned int hwsize, void *data);
1695-
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie,
1696-
const struct irq_affinity_desc *affdesc);
1697-
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
16981691

16991692
#else
17001693
static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
@@ -1758,25 +1751,6 @@ static inline const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev,
17581751
{
17591752
return cpu_possible_mask;
17601753
}
1761-
1762-
static inline bool pci_create_ims_domain(struct pci_dev *pdev,
1763-
const struct msi_domain_template *template,
1764-
unsigned int hwsize, void *data)
1765-
{ return false; }
1766-
1767-
static inline struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,
1768-
union msi_instance_cookie *icookie,
1769-
const struct irq_affinity_desc *affdesc)
1770-
{
1771-
struct msi_map map = { .index = -ENOSYS, };
1772-
1773-
return map;
1774-
}
1775-
1776-
static inline void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map)
1777-
{
1778-
}
1779-
17801754
#endif
17811755

17821756
/**

0 commit comments

Comments
 (0)