Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Kill all traces of irq_remapping_get_irq_domain()

All users are converted to use the fwspec based parent domain lookup.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201024213535.443185-30-dwmw2@infradead.org

authored by

David Woodhouse and committed by
Thomas Gleixner
ed381fca b643128b

-88
-2
arch/x86/include/asm/hw_irq.h
··· 40 40 X86_IRQ_ALLOC_TYPE_PCI_MSIX, 41 41 X86_IRQ_ALLOC_TYPE_DMAR, 42 42 X86_IRQ_ALLOC_TYPE_UV, 43 - X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT, 44 - X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT, 45 43 }; 46 44 47 45 struct ioapic_alloc_info {
-9
arch/x86/include/asm/irq_remapping.h
··· 44 44 extern int irq_remap_enable_fault_handling(void); 45 45 extern void panic_if_irq_remap(const char *msg); 46 46 47 - extern struct irq_domain * 48 - irq_remapping_get_irq_domain(struct irq_alloc_info *info); 49 - 50 47 /* Create PCI MSI/MSIx irqdomain, use @parent as the parent irqdomain. */ 51 48 extern struct irq_domain * 52 49 arch_create_remap_msi_irq_domain(struct irq_domain *par, const char *n, int id); ··· 66 69 67 70 static inline void panic_if_irq_remap(const char *msg) 68 71 { 69 - } 70 - 71 - static inline struct irq_domain * 72 - irq_remapping_get_irq_domain(struct irq_alloc_info *info) 73 - { 74 - return NULL; 75 72 } 76 73 77 74 #endif /* CONFIG_IRQ_REMAP */
-34
drivers/iommu/amd/iommu.c
··· 3601 3601 { 3602 3602 switch (info->type) { 3603 3603 case X86_IRQ_ALLOC_TYPE_IOAPIC: 3604 - case X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT: 3605 3604 return get_ioapic_devid(info->devid); 3606 3605 case X86_IRQ_ALLOC_TYPE_HPET: 3607 - case X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT: 3608 3606 return get_hpet_devid(info->devid); 3609 3607 case X86_IRQ_ALLOC_TYPE_PCI_MSI: 3610 3608 case X86_IRQ_ALLOC_TYPE_PCI_MSIX: ··· 3613 3615 } 3614 3616 } 3615 3617 3616 - static struct irq_domain *get_irq_domain_for_devid(struct irq_alloc_info *info, 3617 - int devid) 3618 - { 3619 - struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; 3620 - 3621 - if (!iommu) 3622 - return NULL; 3623 - 3624 - switch (info->type) { 3625 - case X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT: 3626 - case X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT: 3627 - return iommu->ir_domain; 3628 - default: 3629 - WARN_ON_ONCE(1); 3630 - return NULL; 3631 - } 3632 - } 3633 - 3634 - static struct irq_domain *get_irq_domain(struct irq_alloc_info *info) 3635 - { 3636 - int devid; 3637 - 3638 - if (!info) 3639 - return NULL; 3640 - 3641 - devid = get_devid(info); 3642 - if (devid < 0) 3643 - return NULL; 3644 - return get_irq_domain_for_devid(info, devid); 3645 - } 3646 - 3647 3618 struct irq_remap_ops amd_iommu_irq_ops = { 3648 3619 .prepare = amd_iommu_prepare, 3649 3620 .enable = amd_iommu_enable, 3650 3621 .disable = amd_iommu_disable, 3651 3622 .reenable = amd_iommu_reenable, 3652 3623 .enable_faulting = amd_iommu_enable_faulting, 3653 - .get_irq_domain = get_irq_domain, 3654 3624 }; 3655 3625 3656 3626 static void fill_msi_msg(struct msi_msg *msg, u32 index)
-9
drivers/iommu/hyperv-iommu.c
··· 160 160 return IRQ_REMAP_X2APIC_MODE; 161 161 } 162 162 163 - static struct irq_domain *hyperv_get_irq_domain(struct irq_alloc_info *info) 164 - { 165 - if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT) 166 - return ioapic_ir_domain; 167 - else 168 - return NULL; 169 - } 170 - 171 163 struct irq_remap_ops hyperv_irq_remap_ops = { 172 164 .prepare = hyperv_prepare_irq_remapping, 173 165 .enable = hyperv_enable_irq_remapping, 174 - .get_irq_domain = hyperv_get_irq_domain, 175 166 }; 176 167 177 168 #endif
-17
drivers/iommu/intel/irq_remapping.c
··· 1127 1127 irte->redir_hint = 1; 1128 1128 } 1129 1129 1130 - static struct irq_domain *intel_get_irq_domain(struct irq_alloc_info *info) 1131 - { 1132 - if (!info) 1133 - return NULL; 1134 - 1135 - switch (info->type) { 1136 - case X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT: 1137 - return map_ioapic_to_ir(info->devid); 1138 - case X86_IRQ_ALLOC_TYPE_HPET_GET_PARENT: 1139 - return map_hpet_to_ir(info->devid); 1140 - default: 1141 - WARN_ON_ONCE(1); 1142 - return NULL; 1143 - } 1144 - } 1145 - 1146 1130 struct irq_remap_ops intel_irq_remap_ops = { 1147 1131 .prepare = intel_prepare_irq_remapping, 1148 1132 .enable = intel_enable_irq_remapping, 1149 1133 .disable = disable_irq_remapping, 1150 1134 .reenable = reenable_irq_remapping, 1151 1135 .enable_faulting = enable_drhd_fault_handling, 1152 - .get_irq_domain = intel_get_irq_domain, 1153 1136 }; 1154 1137 1155 1138 static void intel_ir_reconfigure_irte(struct irq_data *irqd, bool force)
-14
drivers/iommu/irq_remapping.c
··· 158 158 if (irq_remapping_enabled) 159 159 panic(msg); 160 160 } 161 - 162 - /** 163 - * irq_remapping_get_irq_domain - Get the irqdomain serving the request @info 164 - * @info: interrupt allocation information, used to identify the IOMMU device 165 - * 166 - * Returns pointer to IRQ domain, or NULL on failure. 167 - */ 168 - struct irq_domain *irq_remapping_get_irq_domain(struct irq_alloc_info *info) 169 - { 170 - if (!remap_ops || !remap_ops->get_irq_domain) 171 - return NULL; 172 - 173 - return remap_ops->get_irq_domain(info); 174 - }
-3
drivers/iommu/irq_remapping.h
··· 42 42 43 43 /* Enable fault handling */ 44 44 int (*enable_faulting)(void); 45 - 46 - /* Get the irqdomain associated to IOMMU device */ 47 - struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *); 48 45 }; 49 46 50 47 extern struct irq_remap_ops intel_irq_remap_ops;