Linux IOMMU Development
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Tina Zhang <tina.zhang@intel.com>
Cc: iommu@lists.linux-foundation.org, Yi Sun <yi.sun@intel.com>
Subject: Re: [PATCH] iommu/vt-d: debugfs: Check irq_remapping_cap before PI info dump
Date: Wed, 20 Jan 2021 10:34:50 +0800	[thread overview]
Message-ID: <d084772f-6364-34d9-1c89-e1c3d6a35301@linux.intel.com> (raw)
In-Reply-To: <20210119182526.2927-1-tina.zhang@intel.com>

On 1/20/21 2:25 AM, Tina Zhang wrote:
> 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))

With irq_remapping_cap(IRQ_POSTING_CAP), do you still need
cap_pi_support(iommu->cap)?

>   			continue;
>   
>   		seq_printf(m, "Posted Interrupt supported on IOMMU: %s\n",
> 

Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-01-20  2:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=d084772f-6364-34d9-1c89-e1c3d6a35301@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=tina.zhang@intel.com \
    --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