From: Tiejun Chen <tiejun.chen@intel.com>
To: JBeulich@suse.com, yang.z.zhang@intel.com, kevin.tian@intel.com
Cc: xen-devel@lists.xen.org
Subject: [v3][PATCH 1/1] xen:vtd: missing RMRR mapping while share EPT
Date: Thu, 24 Jul 2014 19:00:18 +0800 [thread overview]
Message-ID: <1406199618-21574-1-git-send-email-tiejun.chen@intel.com> (raw)
intel_iommu_map_page() does nothing if VT-d shares EPT page table.
So rmrr_identity_mapping() never create RMRR mapping but in some
cases like some GFX drivers it still need to access RMRR.
Here we will create those RMRR mappings even in shared EPT case.
Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
xen/drivers/passthrough/vtd/iommu.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
v3:
* Use set_mmio_p2m_entry() to replace p2m_set_entry()
* Use ASSERT to check
v2:
* Fix coding style.
* Still need to abide intel_iommu_map_page(), so we should do nothing
if dom0 and iommu supports pass thru.
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 042b882..f08a1fc 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1867,8 +1867,14 @@ static int rmrr_identity_mapping(struct domain *d,
while ( base_pfn < end_pfn )
{
- if ( intel_iommu_map_page(d, base_pfn, base_pfn,
- IOMMUF_readable|IOMMUF_writable) )
+ if ( iommu_use_hap_pt(d) )
+ {
+ ASSERT(!iommu_passthrough || !is_hardware_domain(d));
+ if ( set_mmio_p2m_entry(d, base_pfn, _mfn(base_pfn)) )
+ return -1;
+ }
+ else if ( intel_iommu_map_page(d, base_pfn, base_pfn,
+ IOMMUF_readable|IOMMUF_writable) )
return -1;
base_pfn++;
}
--
1.9.1
next reply other threads:[~2014-07-24 11:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-24 11:00 Tiejun Chen [this message]
2014-07-24 11:11 ` [v3][PATCH 1/1] xen:vtd: missing RMRR mapping while share EPT Tim Deegan
2014-07-24 11:25 ` Chen, Tiejun
2014-07-24 11:35 ` Tim Deegan
2014-07-24 11:51 ` Chen, Tiejun
2014-07-24 12:16 ` Jan Beulich
2014-07-25 6:48 ` Chen, Tiejun
2014-07-25 7:07 ` Jan Beulich
2014-07-25 7:53 ` Chen, Tiejun
2014-07-25 8:02 ` Jan Beulich
2014-07-25 12:22 ` Tim Deegan
2014-07-24 12:10 ` Jan Beulich
2014-07-25 0:56 ` Zhang, Yang Z
2014-07-25 6:58 ` Jan Beulich
2014-07-25 8:19 ` Zhang, Yang Z
2014-07-25 8:34 ` Jan Beulich
2014-07-25 6:47 ` Chen, Tiejun
2014-07-25 8:07 ` Jan Beulich
2014-07-25 8:45 ` Chen, Tiejun
2014-07-25 9:14 ` Jan Beulich
2014-07-24 17:12 ` Tian, Kevin
2014-07-25 8:15 ` Jan Beulich
2014-07-25 8:24 ` Zhang, Yang Z
2014-07-25 8:26 ` Chen, Tiejun
2014-07-25 8:28 ` Zhang, Yang Z
2014-07-25 8:30 ` Chen, Tiejun
2014-07-25 8:36 ` Jan Beulich
2014-07-25 8:43 ` Chen, Tiejun
2014-07-25 12:53 ` Tian, Kevin
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=1406199618-21574-1-git-send-email-tiejun.chen@intel.com \
--to=tiejun.chen@intel.com \
--cc=JBeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xen.org \
--cc=yang.z.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).