iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooks <acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	jgarzik-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org,
	Joerg-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	Roedel-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
	Justin-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	Piszcz-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	jpiszcz-BP4nVm5VUdNhbmWW9KSYcQ@public.gmane.org,
	Robert-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	Hancock-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org,
	hancockrwd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	YingChu <xjtuychu-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
Cc: "open list:INTEL IOMMU VT-d"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH 4/4] create context mapping entries for devices that use phantom functions.
Date: Mon,  3 Dec 2012 19:16:27 +0800	[thread overview]
Message-ID: <1354533387-4110-5-git-send-email-acooks@gmail.com> (raw)
In-Reply-To: <1354533387-4110-1-git-send-email-acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Create context mapping for phantom functions.

Signed-off-by: Andrew Cooks <acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/iommu/intel-iommu.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 554e6ac..b3c9b55 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1673,6 +1673,32 @@ static int domain_context_mapping_one(struct dmar_domain *domain, int segment,
 }
 
 static int
+context_map_phantoms(struct dmar_domain *domain, struct pci_dev *pdev,
+			int translation)
+{
+	unsigned fn;
+	int ret;
+
+	if (!pdev->phantoms_enabled)
+		return 0;
+
+	pr_debug("context_map_phantoms()\n");
+
+	for (fn = 1 ; fn < 8 ; fn++) {
+		ret = domain_context_mapping_one(domain,
+					pci_domain_nr(pdev->bus),
+					pdev->bus->number,
+					fn,
+					translation);
+		if (ret) {
+			pr_info("function %d phantom mapping failed.\n", fn);
+			return ret;
+		}
+	}
+	return 0;
+}
+
+static int
 domain_context_mapping(struct dmar_domain *domain, struct pci_dev *pdev,
 			int translation)
 {
@@ -1685,6 +1711,10 @@ domain_context_mapping(struct dmar_domain *domain, struct pci_dev *pdev,
 	if (ret)
 		return ret;
 
+	ret = context_map_phantoms(domain, pdev, translation);
+	if (ret)
+		return ret;
+
 	/* dependent device mapping */
 	tmp = pci_find_upstream_pcie_bridge(pdev);
 	if (!tmp)
-- 
1.7.1

       reply	other threads:[~2012-12-03 11:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1354533387-4110-1-git-send-email-acooks@gmail.com>
     [not found] ` <1354533387-4110-1-git-send-email-acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-03 11:16   ` Andrew Cooks [this message]
2012-12-19 10:58   ` [RFC PATCH] Fix Intel IOMMU support for Marvell 88SE91xx SATA controllers Andrew Cooks
2012-12-19 13:41     ` Chu Ying
     [not found]       ` <A1185FFE-6B90-4B44-BF8C-082E487AA73D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-19 15:07         ` Andrew Cooks
     [not found]           ` <CAJtEV7ZmgkJMhFL_2Qzt1YsKnZ40gNi0yHgixVW3yJEfi4QzfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-20  2:55             ` Ying Chu
     [not found]     ` <1355914703-28576-1-git-send-email-acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-22 19:29       ` Stijn Tintel
     [not found]         ` <5127C716.6050903-VfPWfsRibaPZj6PxcwrBaQ@public.gmane.org>
2013-02-25  8:37           ` Andrew Cooks
2013-03-01  8:26     ` [PATCH] Quirk to support Marvell 88SE91xx SATA controllers with Intel IOMMU Andrew Cooks
     [not found]       ` <1362126373-32318-1-git-send-email-acooks-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-03-01 17:51         ` Justin Piszcz
2013-03-01 22:19           ` Andrew Cooks
     [not found]             ` <CAJtEV7Zs2BiwJ9jdDeoceh9hiVXvVaSvj=9H+4+vEzhY72AS9g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-01 23:18               ` Justin Piszcz
2013-03-04  1:35                 ` Andrew Cooks
     [not found]                   ` <CAJtEV7bvPORPoXgQY2OahNVMj+SY5z=xxQ=nueX7=kLVfpyF_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-04 11:32                     ` Justin Piszcz
2013-03-29 14:36                     ` Justin Piszcz
2013-03-06  4:04         ` Alex Williamson
     [not found]           ` <1362542675.22132.86.camel-xdHQ/5r00wBBDLzU/O5InQ@public.gmane.org>
2013-03-06  6:59             ` Andrew Cooks
2013-03-01 17:54       ` Justin Piszcz

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=1354533387-4110-5-git-send-email-acooks@gmail.com \
    --to=acooks-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Hancock-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=Joerg-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=Justin-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=Piszcz-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=Robert-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=Roedel-i9wRM+HIrmnmtl4Z8vJ8Kg761KYD1DLY@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=hancockrwd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jgarzik-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org \
    --cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
    --cc=jpiszcz-BP4nVm5VUdNhbmWW9KSYcQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=xjtuychu-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.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).