hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/iommu/irq_remapping.c
....@@ -1,4 +1,4 @@
1
-#include <linux/seq_file.h>
1
+// SPDX-License-Identifier: GPL-2.0-only
22 #include <linux/cpumask.h>
33 #include <linux/kernel.h>
44 #include <linux/string.h>
....@@ -104,6 +104,9 @@
104104 else if (IS_ENABLED(CONFIG_AMD_IOMMU) &&
105105 amd_iommu_irq_ops.prepare() == 0)
106106 remap_ops = &amd_iommu_irq_ops;
107
+ else if (IS_ENABLED(CONFIG_HYPERV_IOMMU) &&
108
+ hyperv_irq_remap_ops.prepare() == 0)
109
+ remap_ops = &hyperv_irq_remap_ops;
107110 else
108111 return -ENOSYS;
109112
....@@ -157,33 +160,12 @@
157160 }
158161
159162 /**
160
- * irq_remapping_get_ir_irq_domain - Get the irqdomain associated with the IOMMU
161
- * device serving request @info
162
- * @info: interrupt allocation information, used to identify the IOMMU device
163
- *
164
- * It's used to get parent irqdomain for HPET and IOAPIC irqdomains.
165
- * Returns pointer to IRQ domain, or NULL on failure.
166
- */
167
-struct irq_domain *
168
-irq_remapping_get_ir_irq_domain(struct irq_alloc_info *info)
169
-{
170
- if (!remap_ops || !remap_ops->get_ir_irq_domain)
171
- return NULL;
172
-
173
- return remap_ops->get_ir_irq_domain(info);
174
-}
175
-
176
-/**
177163 * irq_remapping_get_irq_domain - Get the irqdomain serving the request @info
178164 * @info: interrupt allocation information, used to identify the IOMMU device
179165 *
180
- * There will be one PCI MSI/MSIX irqdomain associated with each interrupt
181
- * remapping device, so this interface is used to retrieve the PCI MSI/MSIX
182
- * irqdomain serving request @info.
183166 * Returns pointer to IRQ domain, or NULL on failure.
184167 */
185
-struct irq_domain *
186
-irq_remapping_get_irq_domain(struct irq_alloc_info *info)
168
+struct irq_domain *irq_remapping_get_irq_domain(struct irq_alloc_info *info)
187169 {
188170 if (!remap_ops || !remap_ops->get_irq_domain)
189171 return NULL;