| .. | .. |
|---|
| 1 | | -#include <linux/seq_file.h> |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 2 | 2 | #include <linux/cpumask.h> |
|---|
| 3 | 3 | #include <linux/kernel.h> |
|---|
| 4 | 4 | #include <linux/string.h> |
|---|
| .. | .. |
|---|
| 104 | 104 | else if (IS_ENABLED(CONFIG_AMD_IOMMU) && |
|---|
| 105 | 105 | amd_iommu_irq_ops.prepare() == 0) |
|---|
| 106 | 106 | 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; |
|---|
| 107 | 110 | else |
|---|
| 108 | 111 | return -ENOSYS; |
|---|
| 109 | 112 | |
|---|
| .. | .. |
|---|
| 157 | 160 | } |
|---|
| 158 | 161 | |
|---|
| 159 | 162 | /** |
|---|
| 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 | | -/** |
|---|
| 177 | 163 | * irq_remapping_get_irq_domain - Get the irqdomain serving the request @info |
|---|
| 178 | 164 | * @info: interrupt allocation information, used to identify the IOMMU device |
|---|
| 179 | 165 | * |
|---|
| 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. |
|---|
| 183 | 166 | * Returns pointer to IRQ domain, or NULL on failure. |
|---|
| 184 | 167 | */ |
|---|
| 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) |
|---|
| 187 | 169 | { |
|---|
| 188 | 170 | if (!remap_ops || !remap_ops->get_irq_domain) |
|---|
| 189 | 171 | return NULL; |
|---|