xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests
@ 2015-08-28 16:10 Jan Beulich
  2015-08-28 16:13 ` Andrew Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jan Beulich @ 2015-08-28 16:10 UTC (permalink / raw)
  To: xen-devel
  Cc: George Dunlap, Andrew Cooper, Malcolm Crossley, Keir Fraser,
	tiejun.chen@intel.com

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
mapping") having removed the creation of such mappings for non-
translated guests.

Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -957,7 +957,11 @@ int set_identity_p2m_entry(struct domain
     int ret;
 
     if ( !paging_mode_translate(p2m->domain) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
 
     gfn_lock(p2m, gfn, 0);
 
@@ -1028,7 +1032,11 @@ int clear_identity_p2m_entry(struct doma
     int ret;
 
     if ( !paging_mode_translate(d) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_unmap_page(d, gfn);
+    }
 
     gfn_lock(p2m, gfn, 0);
 




[-- Attachment #2: x86-PV-IOMMU-identmap.patch --]
[-- Type: text/plain, Size: 1021 bytes --]

x86/mm: make {set,clear}_identity_p2m_mapping() work for PV guests

Namely Dom0 suffers from commit 5ae03990c1 ("xen/vtd: create RMRR
mapping") having removed the creation of such mappings for non-
translated guests.

Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -957,7 +957,11 @@ int set_identity_p2m_entry(struct domain
     int ret;
 
     if ( !paging_mode_translate(p2m->domain) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
+    }
 
     gfn_lock(p2m, gfn, 0);
 
@@ -1028,7 +1032,11 @@ int clear_identity_p2m_entry(struct doma
     int ret;
 
     if ( !paging_mode_translate(d) )
-        return 0;
+    {
+        if ( !need_iommu(d) )
+            return 0;
+        return iommu_unmap_page(d, gfn);
+    }
 
     gfn_lock(p2m, gfn, 0);
 

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-01 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28 16:10 [PATCH] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests Jan Beulich
2015-08-28 16:13 ` Andrew Cooper
2015-09-01 13:45 ` George Dunlap
2015-09-01 13:53 ` Jan Beulich
2015-09-01 14:01   ` Wei Liu

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).