WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2 of 4] ept p2m: replace unsigned long with mfn_t for

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2 of 4] ept p2m: replace unsigned long with mfn_t for mfns
From: Patrick Colp <Patrick.Colp@xxxxxxxxxx>
Date: Wed, 5 Aug 2009 15:00:48 +0100
Delivery-date: Wed, 05 Aug 2009 07:03:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1249480846@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1249480846@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Patrick Colp <Patrick.Colp@xxxxxxxxxx>
# Date 1249480778 -3600
# Node ID a77221fe874c17b6a4ac3dc0ca40ab91949d8afa
# Parent  86486ebbb5f0bd4f94b42492b7e00110971a4078
ept p2m: replace unsigned long with mfn_t for mfns.

Signed-off-by: Patrick Colp <Patrick.Colp@xxxxxxxxxx>

diff -r 86486ebbb5f0 -r a77221fe874c xen/arch/x86/mm/hap/p2m-ept.c
--- a/xen/arch/x86/mm/hap/p2m-ept.c     Wed Aug 05 14:59:38 2009 +0100
+++ b/xen/arch/x86/mm/hap/p2m-ept.c     Wed Aug 05 14:59:38 2009 +0100
@@ -402,11 +402,11 @@
  * return 1 to not to reset ept entry.
  */
 static int need_modify_ept_entry(struct domain *d, unsigned long gfn,
-                                    unsigned long mfn, uint8_t o_igmt,
+                                    mfn_t mfn, uint8_t o_igmt,
                                     uint8_t o_emt, p2m_type_t p2mt)
 {
     uint8_t igmt, emt;
-    emt = epte_get_entry_emt(d, gfn, mfn, &igmt, 
+    emt = epte_get_entry_emt(d, gfn, mfn_x(mfn), &igmt, 
                                 (p2mt == p2m_mmio_direct));
     if ( (emt == o_emt) && (igmt == o_igmt) )
         return 0;
@@ -420,7 +420,7 @@
     p2m_type_t p2mt;
     uint64_t epte;
     int order = 0;
-    unsigned long mfn;
+    mfn_t mfn;
     uint8_t o_igmt, o_emt;
 
     for ( gfn = start_gfn; gfn <= end_gfn; gfn++ )
@@ -428,8 +428,8 @@
         epte = ept_get_entry_content(d, gfn);
         if ( epte == 0 )
             continue;
-        mfn = (epte & EPTE_MFN_MASK) >> PAGE_SHIFT;
-        if ( !mfn_valid(mfn) )
+        mfn = _mfn((epte & EPTE_MFN_MASK) >> PAGE_SHIFT);
+        if ( !mfn_valid(mfn_x(mfn)) )
             continue;
         p2mt = (epte & EPTE_AVAIL1_MASK) >> EPTE_AVAIL1_SHIFT;
         o_igmt = (epte & EPTE_IGMT_MASK) >> EPTE_IGMT_SHIFT;
@@ -447,7 +447,7 @@
                 order = EPT_TABLE_ORDER;
                 if ( need_modify_ept_entry(d, gfn, mfn, 
                                             o_igmt, o_emt, p2mt) )
-                    ept_set_entry(d, gfn, _mfn(mfn), order, p2mt);
+                    ept_set_entry(d, gfn, mfn, order, p2mt);
                 gfn += 0x1FF;
             }
             else
@@ -455,7 +455,7 @@
                 /* change emt for partial entries of the 2m area. */
                 if ( need_modify_ept_entry(d, gfn, mfn, 
                                             o_igmt, o_emt, p2mt) )
-                    ept_set_entry(d, gfn, _mfn(mfn), order, p2mt);
+                    ept_set_entry(d, gfn, mfn, order, p2mt);
                 gfn = ((gfn >> EPT_TABLE_ORDER) << EPT_TABLE_ORDER) + 0x1FF;
             }
         }
@@ -463,7 +463,7 @@
         {
             if ( need_modify_ept_entry(d, gfn, mfn, 
                                             o_igmt, o_emt, p2mt) )
-                ept_set_entry(d, gfn, _mfn(mfn), order, p2mt);
+                ept_set_entry(d, gfn, mfn, order, p2mt);
         }
     }
 }

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel