[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/mm: make {set, clear}_identity_p2m_mapping() work for PV guests



commit 619ecf8400cbc1540d9f07c317a8e2d6782c5752
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Sep 1 16:51:44 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Sep 1 16:51:44 2015 +0200

    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@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: George Dunlap <george.dunlap@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8fa918b..b2726bd 100644
--- 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 *d, unsigned long 
gfn,
     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 domain *d, unsigned 
long gfn)
     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);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.