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

Re: [Xen-devel] [PATCH v2 6/8] xen: Use the typesafe mfn and gfn in map_mmio_regions...





On 20/06/16 14:37, Julien Grall wrote:
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index a3add21..2710ce8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2214,9 +2214,9 @@ static unsigned int mmio_order(const struct domain *d,
  #define MAP_MMIO_MAX_ITER 64 /* pretty arbitrary */

  int map_mmio_regions(struct domain *d,
-                     unsigned long start_gfn,
+                     gfn_t start_gfn,
                       unsigned long nr,
-                     unsigned long mfn)
+                     mfn_t mfn)
  {
      int ret = 0;
      unsigned long i;
@@ -2229,10 +2229,11 @@ int map_mmio_regions(struct domain *d,
            i += 1UL << order, ++iter )
      {
          /* OR'ing gfn and mfn values will return an order suitable to both. */
-        for ( order = mmio_order(d, (start_gfn + i) | (mfn + i), nr - i); ;
+        for ( order = mmio_order(d, (gfn_x(start_gfn) + i) | (mfn_x(mfn) + i), 
nr - i); ;
                order = ret - 1 )
          {
-            ret = set_mmio_p2m_entry(d, start_gfn + i, _mfn(mfn + i), order,
+            ret = set_mmio_p2m_entry(d, gfn_x(start_gfn) + i,
+                                     _mfn(mfn_x(mfn) + i), order,

Hmm I forgot to convert this one to mfn_add(mfn, i).


--
Julien Grall

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

 


Rackspace

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