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 5/7] alias i/FPP(guest_width) as p2m_index and replac

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 5/7] alias i/FPP(guest_width) as p2m_index and replace every usage
From: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Date: Fri, 13 Nov 2009 23:43:05 +0000
Cc: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Delivery-date: Fri, 13 Nov 2009 15:38:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1258155787-28327-1-git-send-email-vincent.hanquez@xxxxxxxxxxxxx>
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: <1258155787-28327-1-git-send-email-vincent.hanquez@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
alias i/FPP(guest_width) as p2m_index and replace every usage
---
 tools/libxc/xc_domain_save.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 341b0e0..61cc589 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -753,24 +753,25 @@ static xen_pfn_t *map_and_save_p2m_table(int xc_handle,
     /* Canonicalise the pfn-to-mfn table frame-number list. */
     for ( i = 0; i < ctx->p2m_size; i += FPP(ctx->guest_width) )
     {
-        if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctx->max_mfn, 
p2m_frame_list[i/FPP(ctx->guest_width)]) )
+        uint32_t p2m_index = i / FPP(ctx->guest_width);
+        if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctx->max_mfn, 
p2m_frame_list[p2m_index]) )
         {
             ERROR("Frame# in pfn-to-mfn frame list is not in pseudophys");
             ERROR("entry %d: p2m_frame_list[%ld] is 0x%"PRIx64", max 0x%lx",
-                  i, i/FPP(ctx->guest_width), 
(uint64_t)p2m_frame_list[i/FPP(ctx->guest_width)], ctx->max_mfn);
-            if ( p2m_frame_list[i/FPP(ctx->guest_width)] < ctx->max_mfn ) 
+                  i, p2m_index, (uint64_t)p2m_frame_list[p2m_index], 
ctx->max_mfn);
+            if ( p2m_frame_list[p2m_index] < ctx->max_mfn )
             {
                 ERROR("m2p[0x%"PRIx64"] = 0x%"PRIx64, 
-                      (uint64_t)p2m_frame_list[i/FPP(ctx->guest_width)],
-                      
(uint64_t)ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]]);
+                      (uint64_t)p2m_frame_list[p2m_index],
+                      (uint64_t)ctx->live_m2p[p2m_frame_list[p2m_index]]);
                 ERROR("p2m[0x%"PRIx64"] = 0x%"PRIx64, 
-                      
(uint64_t)ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]],
-                      
(uint64_t)p2m[ctx->live_m2p[p2m_frame_list[i/FPP(ctx->guest_width)]]]);
+                      (uint64_t)ctx->live_m2p[p2m_frame_list[p2m_index]],
+                      (uint64_t)p2m[ctx->live_m2p[p2m_frame_list[p2m_index]]]);
 
             }
             goto out;
         }
-        p2m_frame_list[i/FPP(ctx->guest_width)] = 
mfn_to_pfn(p2m_frame_list[i/FPP(ctx->guest_width)]);
+        p2m_frame_list[p2m_index] = mfn_to_pfn(p2m_frame_list[p2m_index]);
     }
 
     if ( xc_vcpu_getcontext(xc_handle, dom, 0, &ctxt) )
-- 
1.6.5.2


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