From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
Xiantao Zhang <xiantao.zhang@intel.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH 2/3] amd-iommu: disable iommu_hap_pt_share with AMD IOMMUs
Date: Mon, 7 Apr 2014 18:02:03 +0200 [thread overview]
Message-ID: <1396886524-16921-3-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1396886524-16921-1-git-send-email-roger.pau@citrix.com>
According to the comment in p2m.h, AMD IOMMUs don't work correctly
with page types different than p2m_ram_rw when the p2m is shared
between HAP and IOMMU, so disable this sharing when using AMD IOMMUs
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Xiantao Zhang <xiantao.zhang@intel.com>
Cc: Jan Beulich <jbeulich@suse.com>
---
I have not tested this patch on AMD hardware, so I would like some
confirmation that this actually works.
---
xen/drivers/passthrough/amd/iommu_init.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 4686813..7f75b3e 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1255,6 +1255,13 @@ int __init amd_iommu_init(void)
if ( iterate_ivrs_mappings(amd_iommu_setup_device_table) != 0 )
goto error_out;
+ /*
+ * Disable sharing HAP page tables with AMD IOMMU,
+ * since it only supports p2m_ram_rw, and this would
+ * prevent doing IO to/from mapped grant frames.
+ */
+ iommu_hap_pt_share = 0;
+
/* per iommu initialization */
for_each_amd_iommu ( iommu )
if ( amd_iommu_init_one(iommu) != 0 )
--
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-04-07 16:03 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-07 16:02 [PATCH 0/3] Fix grant map/unmap with auto-translated guests Roger Pau Monne
2014-04-07 16:02 ` [PATCH 1/3] iommu: set correct IOMMU entries when iommu_hap_pt_share == 0 Roger Pau Monne
2014-04-07 16:49 ` Konrad Rzeszutek Wilk
2014-04-08 8:30 ` Jan Beulich
2014-04-08 9:19 ` Roger Pau Monné
2014-04-08 9:55 ` Jan Beulich
2014-04-08 14:12 ` Tim Deegan
2014-04-08 15:15 ` Roger Pau Monné
2014-04-08 15:29 ` Jan Beulich
2014-04-13 20:27 ` Tim Deegan
2014-04-16 14:36 ` Roger Pau Monné
2014-04-16 14:41 ` Jan Beulich
2014-04-07 16:02 ` Roger Pau Monne [this message]
2014-04-07 16:51 ` [PATCH 2/3] amd-iommu: disable iommu_hap_pt_share with AMD IOMMUs Konrad Rzeszutek Wilk
2014-04-07 16:54 ` George Dunlap
2014-04-08 7:29 ` Roger Pau Monné
2014-04-08 8:52 ` Jan Beulich
2014-04-08 14:16 ` Tim Deegan
2014-04-08 14:36 ` Jan Beulich
2014-04-08 15:39 ` Roger Pau Monné
2014-04-07 16:02 ` [PATCH 3/3] xen: expose that grant table mappings update the IOMMU Roger Pau Monne
2014-04-08 8:34 ` Ian Campbell
2014-04-08 8:56 ` Jan Beulich
2014-04-08 8:58 ` Ian Campbell
2014-04-08 9:53 ` Jan Beulich
2014-04-08 9:57 ` Ian Campbell
2014-04-08 10:05 ` Jan Beulich
2014-04-08 10:26 ` Ian Campbell
2014-04-08 10:31 ` Jan Beulich
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=1396886524-16921-3-git-send-email-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=jbeulich@suse.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=xen-devel@lists.xenproject.org \
--cc=xiantao.zhang@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;
as well as URLs for NNTP newsgroup(s).