Commit 5e586872 authored by Jan Beulich's avatar Jan Beulich

x86/IOMMU: abstract Intel-specific adjust_vtd_irq_affinities()

This can't be folded into the resume hook, as that runs before bringing
back up APs, but the affinity adjustment wants to happen with all CPUs
back online. Hence a separate hook is needed such that AMD can then
leverage it as well.
Signed-off-by: default avatarJan Beulich <>
Reviewed-by: default avatarKevin Tian <>
Reviewed-by: default avatarAndrew Cooper <>
parent 6c546637
......@@ -275,7 +275,7 @@ static int enter_state(u32 state)
system_state = SYS_STATE_active;
......@@ -2141,7 +2141,7 @@ static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
dma_msi_set_affinity(irq_to_desc(drhd->iommu->msi.irq), cpumask);
int adjust_vtd_irq_affinities(void)
static int adjust_vtd_irq_affinities(void)
struct acpi_drhd_unit *drhd;
......@@ -2725,6 +2725,7 @@ const struct iommu_ops __initconstrel intel_iommu_ops = {
.read_apic_from_ire = io_apic_read_remap_rte,
.read_msi_from_ire = msi_msg_read_remap_rte,
.setup_hpet_msi = intel_setup_hpet_msi,
.adjust_irq_affinities = adjust_vtd_irq_affinities,
.suspend = vtd_suspend,
.resume = vtd_resume,
.share_p2m = iommu_set_pgd,
......@@ -81,8 +81,14 @@ void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned in
unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
int iommu_setup_hpet_msi(struct msi_desc *);
static inline int iommu_adjust_irq_affinities(void)
return iommu_ops.adjust_irq_affinities
? iommu_ops.adjust_irq_affinities()
: 0;
/* While VT-d specific, this must get declared in a generic header. */
int adjust_vtd_irq_affinities(void);
int __must_check iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte,
int order, int present);
......@@ -224,7 +224,10 @@ struct iommu_ops {
void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
int (*setup_hpet_msi)(struct msi_desc *);
int (*adjust_irq_affinities)(void);
#endif /* CONFIG_X86 */
int __must_check (*suspend)(void);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment