iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/vt-d: debugfs: Check irq_remapping_cap before PI info dump
@ 2021-01-19 18:25 Tina Zhang
  2021-01-20  2:34 ` Lu Baolu
  0 siblings, 1 reply; 5+ messages in thread
From: Tina Zhang @ 2021-01-19 18:25 UTC (permalink / raw)
  Cc: iommu, Yi Sun

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-20 12:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 18:25 [PATCH] iommu/vt-d: debugfs: Check irq_remapping_cap before PI info dump Tina Zhang
2021-01-20  2:34 ` Lu Baolu
2021-01-20  8:41   ` Zhang, Tina
2021-01-20 11:37     ` Lu Baolu
2021-01-20 12:21       ` Zhang, Tina

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).