Lines Matching +full:interrupt +full:- +full:affinity

1 // SPDX-License-Identifier: GPL-2.0
4 * Hyper-V stub IOMMU driver.
12 #include <linux/interrupt.h>
29 * According 82093AA IO-APIC spec , IO APIC has a 24-entry Interrupt
30 * Redirection Table. Hyper-V exposes one single IO-APIC and so define
41 struct irq_data *parent = data->parent_data; in hyperv_ir_set_affinity()
46 /* Return error If new irq affinity is out of ioapic_max_cpumask. */ in hyperv_ir_set_affinity()
48 return -EINVAL; in hyperv_ir_set_affinity()
50 ret = parent->chip->irq_set_affinity(parent, mask, force); in hyperv_ir_set_affinity()
54 entry = data->chip_data; in hyperv_ir_set_affinity()
55 entry->dest = cfg->dest_apicid; in hyperv_ir_set_affinity()
56 entry->vector = cfg->vector; in hyperv_ir_set_affinity()
63 .name = "HYPERV-IR",
77 if (!info || info->type != X86_IRQ_ALLOC_TYPE_IOAPIC || nr_irqs > 1) in hyperv_irq_remapping_alloc()
78 return -EINVAL; in hyperv_irq_remapping_alloc()
87 return -EINVAL; in hyperv_irq_remapping_alloc()
90 irq_data->chip = &hyperv_ir_chip; in hyperv_irq_remapping_alloc()
93 * If there is interrupt remapping function of IOMMU, setting irq in hyperv_irq_remapping_alloc()
94 * affinity only needs to change IRTE of IOMMU. But Hyper-V doesn't in hyperv_irq_remapping_alloc()
95 * support interrupt remapping function, setting irq affinity of IO-APIC in hyperv_irq_remapping_alloc()
96 * interrupts still needs to change IO-APIC registers. But ioapic_ in hyperv_irq_remapping_alloc()
97 * configure_entry() will ignore value of cfg->vector and cfg-> in hyperv_irq_remapping_alloc()
98 * dest_apicid when IO-APIC's parent irq domain is not the vector in hyperv_irq_remapping_alloc()
100 * and dest_apicid to IO-APIC register, IO-APIC entry pointer is saved in hyperv_irq_remapping_alloc()
102 * affinity() set vector and dest_apicid directly into IO-APIC entry. in hyperv_irq_remapping_alloc()
104 irq_data->chip_data = info->ioapic.entry; in hyperv_irq_remapping_alloc()
107 * Hypver-V IO APIC irq affinity should be in the scope of in hyperv_irq_remapping_alloc()
111 cpumask_copy(desc->irq_common_data.affinity, &ioapic_max_cpumask); in hyperv_irq_remapping_alloc()
126 struct IO_APIC_route_entry *entry = irq_data->chip_data; in hyperv_irq_remapping_activate()
128 entry->dest = cfg->dest_apicid; in hyperv_irq_remapping_activate()
129 entry->vector = cfg->vector; in hyperv_irq_remapping_activate()
147 return -ENODEV; in hyperv_prepare_irq_remapping()
149 fn = irq_domain_alloc_named_id_fwnode("HYPERV-IR", 0); in hyperv_prepare_irq_remapping()
151 return -ENOMEM; in hyperv_prepare_irq_remapping()
160 return -ENOMEM; in hyperv_prepare_irq_remapping()
164 * Hyper-V doesn't provide irq remapping function for in hyperv_prepare_irq_remapping()
165 * IO-APIC and so IO-APIC only accepts 8-bit APIC ID. in hyperv_prepare_irq_remapping()
167 * in the MADT table on Hyper-v are sorted monotonic increasingly. in hyperv_prepare_irq_remapping()
170 * max cpu affinity for IOAPIC irqs. Scan cpu 0-255 and set cpu in hyperv_prepare_irq_remapping()
173 for (i = min_t(unsigned int, num_possible_cpus() - 1, 255); i >= 0; i--) in hyperv_prepare_irq_remapping()
187 if (info->type == X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT) in hyperv_get_irq_domain()