[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210504191049.22661-6-ricardo.neri-calderon@linux.intel.com>
Date: Tue, 4 May 2021 12:10:47 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>
Cc: woodhouse@...r.kernel.org, Jacob Pan <jacob.jun.pan@...el.com>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Stephane Eranian <eranian@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...e.de>,
iommu@...ts.linux-foundation.org, x86@...nel.org,
linux-kernel@...r.kernel.org,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Ricardo Neri <ricardo.neri@...el.com>,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>,
Andi Kleen <andi.kleen@...el.com>,
David Woodhouse <dwmw2@...radead.org>
Subject: [RFC PATCH v5 5/7] iommu/vt-d: Fixup delivery mode of the HPET hardlockup interrupt
The HPET hardlockup detector requires that the HPET timer delivers the
interrupt as NMI. When interrupt remapping is disabled, this can be
done by programming the HPET MSI registers directly. With interrupt
remapping, it is necessary to populate an entry in the interrupt
remapping table.
In x86 there is not an IRQF_NMI flag that can be used to indicate the
delivery mode when requesting an interrupt (via request_irq()). Thus,
there is no way for the interrupt remapping driver to know and set
the delivery mode.
Hence, when allocating an interrupt, check if such interrupt belongs to
the HPET hardlockup detector and fixup the delivery mode accordingly.
Cc: Andi Kleen <andi.kleen@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: David Woodhouse <dwmw2@...radead.org> (supporter:INTEL IOMMU (VT-d))
Cc: "Ravi V. Shankar" <ravi.v.shankar@...el.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jacob Pan <jacob.jun.pan@...el.com>
Cc: Lu Baolu <baolu.lu@...ux.intel.com> (supporter:INTEL IOMMU (VT-d))
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: iommu@...ts.linux-foundation.org (open list:INTEL IOMMU (VT-d))
Cc: x86@...nel.org
Reviewed-by: Ashok Raj <ashok.raj@...el.com>
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
---
Changes since v4:
* Introduced this patch.
Changes since v3:
* N/A
Changes since v2:
* N/A
Changes since v1:
* N/A
---
drivers/iommu/intel/irq_remapping.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/iommu/intel/irq_remapping.c b/drivers/iommu/intel/irq_remapping.c
index daa5df53db59..b07c68ecac01 100644
--- a/drivers/iommu/intel/irq_remapping.c
+++ b/drivers/iommu/intel/irq_remapping.c
@@ -18,6 +18,7 @@
#include <asm/apic.h>
#include <asm/smp.h>
#include <asm/cpu.h>
+#include <asm/hpet.h>
#include <asm/irq_remapping.h>
#include <asm/pci-direct.h>
@@ -1376,6 +1377,14 @@ static int intel_irq_remapping_alloc(struct irq_domain *domain,
irq_data->hwirq = (index << 16) + i;
irq_data->chip_data = ird;
irq_data->chip = &intel_ir_chip;
+
+ /*
+ * If we find the HPET hardlockup detector irq, fixup the
+ * delivery mode.
+ */
+ if (is_hpet_irq_hardlockup_detector(info))
+ irq_cfg->delivery_mode = APIC_DELIVERY_MODE_NMI;
+
intel_irq_remapping_prepare_irte(ird, irq_cfg, info, index, i);
irq_set_status_flags(virq + i, IRQ_MOVE_PCNTXT);
}
--
2.17.1
Powered by blists - more mailing lists