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

[Xen-changelog] [xen-unstable] Handle IOMMU pagetable allocations when set_p2m_entry is called with



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1211364443 -3600
# Node ID 70ca37d228951e98fdf2b5f9bd5883a04321c2c8
# Parent  ff23c9a11085dce8c5b2e3b692cde86cd87698a7
Handle IOMMU pagetable allocations when set_p2m_entry is called with
non-zero page order.
Signed-off-by: Xin Xiaohui <xiaohui.xin@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -r ff23c9a11085 -r 70ca37d22895 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Wed May 21 11:02:51 2008 +0100
+++ b/xen/arch/x86/mm/p2m.c     Wed May 21 11:07:23 2008 +0100
@@ -250,7 +250,7 @@ p2m_set_entry(struct domain *d, unsigned
     // XXX -- this might be able to be faster iff current->domain == d
     mfn_t table_mfn = pagetable_get_mfn(d->arch.phys_table);
     void *table =map_domain_page(mfn_x(table_mfn));
-    unsigned long gfn_remainder = gfn;
+    unsigned long i, gfn_remainder = gfn;
     l1_pgentry_t *p2m_entry;
     l1_pgentry_t entry_content;
     l2_pgentry_t l2e_content;
@@ -328,9 +328,11 @@ p2m_set_entry(struct domain *d, unsigned
     if ( iommu_enabled && is_hvm_domain(d) )
     {
         if ( p2mt == p2m_ram_rw )
-            iommu_map_page(d, gfn, mfn_x(mfn));
+            for ( i = 0; i < (1UL << page_order); i++ )
+                iommu_map_page(d, gfn+i, mfn_x(mfn)+i );
         else
-            iommu_unmap_page(d, gfn);
+            for ( int i = 0; i < (1UL << page_order); i++ )
+                iommu_unmap_page(d, gfn+i);
     }
 
     /* Success */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.