A recent change introduced a new member to struct irq_cfg to specify the delivery mode of an interrupt. Supporting the configuration of the delivery mode would require adding a third argument to prepare_irte(). Instead, simply take a pointer to a irq_cfg data structure as a the only argument.
Internally, configure the delivery mode of the Interrupt Remapping Table Entry as specified in the irq_cfg data structure and not as the APIC setting. This change does not change the existing behavior, as the delivery mode of the APIC is used to configure irq_cfg data structure. Cc: Ashok Raj <ashok....@intel.com> Cc: Andi Kleen <andi.kl...@intel.com> Cc: Tony Luck <tony.l...@intel.com> Cc: Borislav Petkov <b...@suse.de> Cc: Jacob Pan <jacob.jun....@intel.com> Cc: Joerg Roedel <j...@8bytes.org> Cc: Juergen Gross <jgr...@suse.com> Cc: Bjorn Helgaas <bhelg...@google.com> Cc: Wincy Van <fanwenyi0...@gmail.com> Cc: Kate Stewart <kstew...@linuxfoundation.org> Cc: Philippe Ombredanne <pombreda...@nexb.com> Cc: "Eric W. Biederman" <ebied...@xmission.com> Cc: Baoquan He <b...@redhat.com> Cc: Dou Liyang <douly.f...@cn.fujitsu.com> Cc: Jan Kiszka <jan.kis...@siemens.com> Cc: Stephane Eranian <eran...@google.com> Cc: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Cc: "Ravi V. Shankar" <ravi.v.shan...@intel.com> Cc: x...@kernel.org Cc: iommu@lists.linux-foundation.org Signed-off-by: Ricardo Neri <ricardo.neri-calde...@linux.intel.com> --- drivers/iommu/intel_irq_remapping.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 2d74641b7f7b..4ebf3af76589 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c @@ -1073,7 +1073,7 @@ static int reenable_irq_remapping(int eim) return -1; } -static void prepare_irte(struct irte *irte, int vector, unsigned int dest) +static void prepare_irte(struct irte *irte, struct irq_cfg *irq_cfg) { memset(irte, 0, sizeof(*irte)); @@ -1087,9 +1087,9 @@ static void prepare_irte(struct irte *irte, int vector, unsigned int dest) * irq migration in the presence of interrupt-remapping. */ irte->trigger_mode = 0; - irte->dlvry_mode = apic->irq_delivery_mode; - irte->vector = vector; - irte->dest_id = IRTE_DEST(dest); + irte->dlvry_mode = irq_cfg->delivery_mode; + irte->vector = irq_cfg->vector; + irte->dest_id = IRTE_DEST(irq_cfg->dest_apicid); irte->redir_hint = 1; } @@ -1266,7 +1266,7 @@ static void intel_irq_remapping_prepare_irte(struct intel_ir_data *data, struct irte *irte = &data->irte_entry; struct msi_msg *msg = &data->msi_entry; - prepare_irte(irte, irq_cfg->vector, irq_cfg->dest_apicid); + prepare_irte(irte, irq_cfg); switch (info->type) { case X86_IRQ_ALLOC_TYPE_IOAPIC: /* Set source-id of interrupt request */ -- 2.17.1