linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/1] iommu/vt-d: Enable PASID during iommu device probe
Date: Tue, 13 Sep 2022 08:01:09 +0000	[thread overview]
Message-ID: <BN9PR11MB52766A868879689D55AE9DC68C479@BN9PR11MB5276.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220912024826.1684913-1-baolu.lu@linux.intel.com>

> From: Lu Baolu <baolu.lu@linux.intel.com>
> Sent: Monday, September 12, 2022 10:48 AM
>
> @@ -1401,7 +1403,6 @@ static void iommu_enable_dev_iotlb(struct
> device_domain_info *info)

This is not the right name now as dev_iotlb is only related to ATS.

>  		info->pfsid = pci_dev_id(pf_pdev);
>  	}
> 
> -#ifdef CONFIG_INTEL_IOMMU_SVM
>  	/* The PCIe spec, in its wisdom, declares that the behaviour of
>  	   the device if you enable PASID support after ATS support is
>  	   undefined. So always enable PASID support on devices which
> @@ -1414,7 +1415,7 @@ static void iommu_enable_dev_iotlb(struct
> device_domain_info *info)
>  	    (info->pasid_enabled ? pci_prg_resp_pasid_required(pdev) : 1)
> &&
>  	    !pci_reset_pri(pdev) && !pci_enable_pri(pdev, PRQ_DEPTH))
>  		info->pri_enabled = 1;
> -#endif
> +
>  	if (info->ats_supported && pci_ats_page_aligned(pdev) &&
>  	    !pci_enable_ats(pdev, VTD_PAGE_SHIFT)) {
>  		info->ats_enabled = 1;

iommu_enable_dev_iotlb() is currently called both when the device is probed
and when sva is enabled (which is actually useless). From this angle the commit
msg is inaccurate. 

> diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
> index 39a06d245f12..b3f40375f214 100644
> --- a/drivers/iommu/intel/Kconfig
> +++ b/drivers/iommu/intel/Kconfig
> @@ -21,6 +21,8 @@ config INTEL_IOMMU
>  	select IOASID
>  	select IOMMU_DMA
>  	select PCI_ATS
> +	select PCI_PRI
> +	select PCI_PASID
>  	help
>  	  DMA remapping (DMAR) devices support enables independent
> address
>  	  translations for Direct Memory Access (DMA) from devices.
> @@ -48,8 +50,6 @@ config INTEL_IOMMU_DEBUGFS
>  config INTEL_IOMMU_SVM
>  	bool "Support for Shared Virtual Memory with Intel IOMMU"
>  	depends on X86_64
> -	select PCI_PASID
> -	select PCI_PRI
>  	select MMU_NOTIFIER
>  	select IOASID

this is already selected by CONFIG_INTEL_IOMMU

>  	select IOMMU_SVA
> --
> 2.25.1


  parent reply	other threads:[~2022-09-13  8:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  2:48 [PATCH 1/1] iommu/vt-d: Enable PASID during iommu device probe Lu Baolu
2022-09-13  3:13 ` Tian, Kevin
2022-09-13  6:01   ` Baolu Lu
2022-09-13  7:42     ` Tian, Kevin
2022-09-13  7:46 ` Ethan Zhao
2022-09-13  9:30   ` Baolu Lu
     [not found]     ` <e26efaee-d84a-3b60-8400-90d8e49a9b25@linux.intel.com>
2022-09-15  3:00       ` Baolu Lu
2022-09-16  2:40         ` Ethan Zhao
2022-09-16  3:05           ` Baolu Lu
2022-09-16  3:37             ` Ethan Zhao
     [not found]             ` <a6ac5953-7372-9894-58d4-d1ee2905d4dd@linux.intel.com>
2022-09-16  4:01               ` Baolu Lu
2022-09-13  8:01 ` Tian, Kevin [this message]
2022-09-13  9:25   ` Baolu Lu
2022-09-15  3:22     ` Tian, Kevin
2022-09-15  7:21       ` Baolu Lu

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=BN9PR11MB52766A868879689D55AE9DC68C479@BN9PR11MB5276.namprd11.prod.outlook.com \
    --to=kevin.tian@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@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).