From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@suse.de>
Cc: Ashok Raj <ashok.raj@intel.com>, Joerg Roedel <joro@8bytes.org>,
Andi Kleen <andi.kleen@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
"Ravi V. Shankar" <ravi.v.shankar@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org,
Ricardo Neri <ricardo.neri@intel.com>,
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>,
Tony Luck <tony.luck@intel.com>,
Jacob Pan <jacob.jun.pan@intel.com>,
Juergen Gross <jgross@suse.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Wincy Van <fanwenyi0529@gmail.com>,
Kate Stewart <kstewart@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Baoquan He <bhe@redhat.com>,
Dou Liyang <douly.fnst@cn.fujitsu.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Stephane Eranian <eranian@google.com>,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Subject: [RFC PATCH v3 19/21] iommu/vt-d: Rework prepare_irte() to support per-irq delivery mode
Date: Tue, 14 May 2019 07:02:12 -0700 [thread overview]
Message-ID: <1557842534-4266-20-git-send-email-ricardo.neri-calderon@linux.intel.com> (raw)
In-Reply-To: <1557842534-4266-1-git-send-email-ricardo.neri-calderon@linux.intel.com>
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.raj@intel.com>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Jacob Pan <jacob.jun.pan@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Wincy Van <fanwenyi0529@gmail.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
Cc: x86@kernel.org
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@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
next prev parent reply other threads:[~2019-05-14 14:03 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-14 14:01 [RFC PATCH v3 00/21] Implement an HPET-based hardlockup detector Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 01/21] x86/msi: Add definition for NMI delivery mode Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 02/21] x86/hpet: Expose hpet_writel() in header Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 03/21] x86/hpet: Calculate ticks-per-second in a separate function Ricardo Neri
2019-05-14 14:23 ` Randy Dunlap
2019-05-15 15:54 ` Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 04/21] x86/hpet: Add hpet_set_comparator() for periodic and one-shot modes Ricardo Neri
2019-05-14 14:24 ` Randy Dunlap
2019-05-15 15:56 ` Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 05/21] x86/hpet: Reserve timer for the HPET hardlockup detector Ricardo Neri
2019-05-14 14:01 ` [RFC PATCH v3 06/21] x86/hpet: Configure the timer used by the " Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 07/21] watchdog/hardlockup: Define a generic function to detect hardlockups Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 08/21] watchdog/hardlockup: Decouple the hardlockup detector from perf Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 09/21] x86/nmi: Add a NMI_WATCHDOG NMI handler category Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 10/21] watchdog/hardlockup: Add function to enable NMI watchdog on all allowed CPUs at once Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 11/21] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector Ricardo Neri
2019-05-14 14:26 ` Randy Dunlap
2019-05-15 15:56 ` Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 12/21] watchdog/hardlockup/hpet: Adjust timer expiration on the number of monitored CPUs Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 13/21] x86/watchdog/hardlockup/hpet: Determine if HPET timer caused NMI Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 14/21] watchdog/hardlockup: Use parse_option_str() to handle "nmi_watchdog" Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 15/21] watchdog/hardlockup/hpet: Only enable the HPET watchdog via a boot parameter Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 16/21] x86/watchdog: Add a shim hardlockup detector Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 17/21] x86/tsc: Switch to perf-based hardlockup detector if TSC become unstable Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 18/21] x86/apic: Add a parameter for the APIC delivery mode Ricardo Neri
2019-05-14 14:02 ` Ricardo Neri [this message]
2019-05-14 14:02 ` [RFC PATCH v3 20/21] iommu/vt-d: hpet: Reserve an interrupt remampping table entry for watchdog Ricardo Neri
2019-05-14 14:02 ` [RFC PATCH v3 21/21] x86/watchdog/hardlockup/hpet: Support interrupt remapping Ricardo Neri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1557842534-4266-20-git-send-email-ricardo.neri-calderon@linux.intel.com \
--to=ricardo.neri-calderon@linux.intel.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=andi.kleen@intel.com \
--cc=ashok.raj@intel.com \
--cc=bhe@redhat.com \
--cc=bhelgaas@google.com \
--cc=bp@suse.de \
--cc=douly.fnst@cn.fujitsu.com \
--cc=ebiederm@xmission.com \
--cc=eranian@google.com \
--cc=fanwenyi0529@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jacob.jun.pan@intel.com \
--cc=jan.kiszka@siemens.com \
--cc=jgross@suse.com \
--cc=joro@8bytes.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pombredanne@nexb.com \
--cc=ravi.v.shankar@intel.com \
--cc=ricardo.neri@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).