From: Lu Baolu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>, David Woodhouse <dwmw2@infradead.org>
Cc: ashok.raj@intel.com, sanjay.k.kumar@intel.com,
jacob.jun.pan@intel.com, kevin.tian@intel.com,
yi.l.liu@intel.com, yi.y.sun@intel.com, peterx@redhat.com,
Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
Lu Baolu <baolu.lu@linux.intel.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>
Subject: [PATCH v6 08/12] iommu/vt-d: Pass pasid table to context mapping
Date: Mon, 10 Dec 2018 09:59:02 +0800 [thread overview]
Message-ID: <20181210015906.27929-9-baolu.lu@linux.intel.com> (raw)
In-Reply-To: <20181210015906.27929-1-baolu.lu@linux.intel.com>
So that the pasid related info, such as the pasid table and the
maximum of pasid could be used during setting up scalable mode
context.
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Liu Yi L <yi.l.liu@intel.com>
Cc: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
---
drivers/iommu/intel-iommu.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a077ff3f67a6..55c4ffda1246 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1920,6 +1920,7 @@ static void domain_exit(struct dmar_domain *domain)
static int domain_context_mapping_one(struct dmar_domain *domain,
struct intel_iommu *iommu,
+ struct pasid_table *table,
u8 bus, u8 devfn)
{
u16 did = domain->iommu_did[iommu->seq_id];
@@ -2042,6 +2043,7 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
struct domain_context_mapping_data {
struct dmar_domain *domain;
struct intel_iommu *iommu;
+ struct pasid_table *table;
};
static int domain_context_mapping_cb(struct pci_dev *pdev,
@@ -2050,25 +2052,31 @@ static int domain_context_mapping_cb(struct pci_dev *pdev,
struct domain_context_mapping_data *data = opaque;
return domain_context_mapping_one(data->domain, data->iommu,
- PCI_BUS_NUM(alias), alias & 0xff);
+ data->table, PCI_BUS_NUM(alias),
+ alias & 0xff);
}
static int
domain_context_mapping(struct dmar_domain *domain, struct device *dev)
{
+ struct domain_context_mapping_data data;
+ struct pasid_table *table;
struct intel_iommu *iommu;
u8 bus, devfn;
- struct domain_context_mapping_data data;
iommu = device_to_iommu(dev, &bus, &devfn);
if (!iommu)
return -ENODEV;
+ table = intel_pasid_get_table(dev);
+
if (!dev_is_pci(dev))
- return domain_context_mapping_one(domain, iommu, bus, devfn);
+ return domain_context_mapping_one(domain, iommu, table,
+ bus, devfn);
data.domain = domain;
data.iommu = iommu;
+ data.table = table;
return pci_for_each_dma_alias(to_pci_dev(dev),
&domain_context_mapping_cb, &data);
--
2.17.1
next prev parent reply other threads:[~2018-12-10 1:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 1:58 [PATCH v6 00/12] iommu/vt-d: Add scalable mode support Lu Baolu
2018-12-10 1:58 ` Lu Baolu
2018-12-10 1:58 ` [PATCH v6 02/12] iommu/vt-d: Manage scalalble mode PASID tables Lu Baolu
2018-12-10 1:58 ` [PATCH v6 03/12] iommu/vt-d: Move page table helpers into header Lu Baolu
2018-12-10 1:58 ` [PATCH v6 04/12] iommu/vt-d: Add 256-bit invalidation descriptor support Lu Baolu
2018-12-10 1:59 ` [PATCH v6 06/12] iommu/vt-d: Add second level page table interface Lu Baolu
2018-12-10 1:59 ` [PATCH v6 07/12] iommu/vt-d: Setup pasid entry for RID2PASID support Lu Baolu
2018-12-10 1:59 ` Lu Baolu [this message]
2018-12-10 1:59 ` [PATCH v6 09/12] iommu/vt-d: Setup context and enable " Lu Baolu
2018-12-10 1:59 ` [PATCH v6 10/12] iommu/vt-d: Add first level page table interface Lu Baolu
2018-12-10 1:59 ` [PATCH v6 11/12] iommu/vt-d: Shared virtual address in scalable mode Lu Baolu
2018-12-10 1:59 ` [PATCH v6 12/12] iommu/vt-d: Remove deferred invalidation Lu Baolu
[not found] ` <20181210015906.27929-1-baolu.lu-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2018-12-10 1:58 ` [PATCH v6 01/12] iommu/vt-d: Enumerate the scalable mode capability Lu Baolu
2018-12-10 1:58 ` Lu Baolu
2018-12-10 1:58 ` [PATCH v6 05/12] iommu/vt-d: Reserve a domain id for FL and PT modes Lu Baolu
2018-12-10 1:58 ` Lu Baolu
2018-12-11 9:46 ` [PATCH v6 00/12] iommu/vt-d: Add scalable mode support Joerg Roedel
2018-12-11 9:46 ` Joerg Roedel
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=20181210015906.27929-9-baolu.lu@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=ashok.raj@intel.com \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jacob.jun.pan@intel.com \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jean-philippe.brucker@arm.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=sanjay.k.kumar@intel.com \
--cc=yi.l.liu@intel.com \
--cc=yi.y.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.