From: Tina Zhang <tina.zhang@intel.com>
Cc: iommu@lists.linux-foundation.org, Yi Sun <yi.sun@intel.com>
Subject: [PATCH] iommu/vt-d: debugfs: Check irq_remapping_cap before PI info dump
Date: Tue, 19 Jan 2021 13:25:26 -0500 [thread overview]
Message-ID: <20210119182526.2927-1-tina.zhang@intel.com> (raw)
irq_remapping_cap() was introduced to detect whether irq remapping
supports new features, such as VT-d Posted-Interrupts", according to
commit 959c870f7305 ("iommu, x86: Provide irq_remapping_cap() interface").
The VT-d Posted-Interrupts support can be disabled by the command
line parameter "intremap=nopost".
So, it's better to use irq_remapping_cap() to check if the VT-d
Posted-Interrupts is enabled before any Posted Interrupt Descriptor
info dump.
Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Sohil Mehta <sohil.mehta@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
---
drivers/iommu/intel/debugfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/debugfs.c b/drivers/iommu/intel/debugfs.c
index efea7f02abd9..87a4a76866f4 100644
--- a/drivers/iommu/intel/debugfs.c
+++ b/drivers/iommu/intel/debugfs.c
@@ -516,7 +516,8 @@ static int ir_translation_struct_show(struct seq_file *m, void *unused)
seq_puts(m, "****\n\n");
for_each_active_iommu(iommu, drhd) {
- if (!cap_pi_support(iommu->cap))
+ if (!irq_remapping_cap(IRQ_POSTING_CAP) ||
+ !cap_pi_support(iommu->cap))
continue;
seq_printf(m, "Posted Interrupt supported on IOMMU: %s\n",
--
2.25.1
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next reply other threads:[~2021-01-19 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 18:25 Tina Zhang [this message]
2021-01-20 2:34 ` [PATCH] iommu/vt-d: debugfs: Check irq_remapping_cap before PI info dump Lu Baolu
2021-01-20 8:41 ` Zhang, Tina
2021-01-20 11:37 ` Lu Baolu
2021-01-20 12:21 ` Zhang, Tina
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=20210119182526.2927-1-tina.zhang@intel.com \
--to=tina.zhang@intel.com \
--cc=iommu@lists.linux-foundation.org \
--cc=yi.sun@intel.com \
/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