A previous changeset 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 an irq_cfg data structure as the only
argument.

Always configure the delivery mode of the Interrupt Remapping Table
Entry using the values specified in the irq_cfg data structure.

This change does not change the existing behavior, as the delivery mode
of the APIC is used to configure the irq_cfg of each irq.

Cc: Andi Kleen <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Woodhouse <[email protected]> (supporter:INTEL IOMMU (VT-d))
Cc: "Ravi V. Shankar" <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jacob Pan <[email protected]>
Cc: Lu Baolu <[email protected]> (supporter:INTEL IOMMU (VT-d))
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected] (open list:INTEL IOMMU (VT-d))
Cc: [email protected]
Reviewed-by: Ashok Raj <[email protected]>
Signed-off-by: Ricardo Neri <[email protected]>
---
Changes since v4:
 * None

Changes since v3:
 * None

Changes since v2:
 * None

Changes since v1:
 * Introduced this patch.
---
 drivers/iommu/intel/irq_remapping.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/intel/irq_remapping.c 
b/drivers/iommu/intel/irq_remapping.c
index 611ef5243cb6..daa5df53db59 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -1104,7 +1104,7 @@ void intel_irq_remap_add_device(struct 
dmar_pci_notify_info *info)
        dev_set_msi_domain(&info->dev->dev, map_dev_to_ir(info->dev));
 }
 
-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));
 
@@ -1118,9 +1118,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->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;
 }
 
@@ -1261,8 +1261,7 @@ static void intel_irq_remapping_prepare_irte(struct 
intel_ir_data *data,
 {
        struct irte *irte = &data->irte_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

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to