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

[Xen-devel] [RFC PATCH 17/84] xxx fixup: avoid shadowing mfn



From: Wei Liu <wei.liu2@xxxxxxxxxx>

---
 xen/arch/x86/mm.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 0616666221..267e4ceef5 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5185,7 +5185,7 @@ int map_pages_to_xen(
             unsigned int flush_flags =
                 FLUSH_TLB | FLUSH_ORDER(2 * PAGETABLE_ORDER);
             l2_pgentry_t *l2t;
-            mfn_t mfn;
+            mfn_t l2t_mfn;
 
             /* Skip this PTE if there is no change. */
             if ( ((l3e_get_pfn(ol3e) & ~(L2_PAGETABLE_ENTRIES *
@@ -5207,14 +5207,14 @@ int map_pages_to_xen(
                 goto end_of_loop;
             }
 
-            mfn = alloc_xen_pagetable_new();
-            if ( mfn_eq(mfn, INVALID_MFN) )
+            l2t_mfn = alloc_xen_pagetable_new();
+            if ( mfn_eq(l2t_mfn, INVALID_MFN) )
             {
                 ASSERT(rc == -ENOMEM);
                 goto out;
             }
 
-            l2t = map_xen_pagetable_new(mfn);
+            l2t = map_xen_pagetable_new(l2t_mfn);
 
             for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ )
                 l2e_write(l2t + i,
@@ -5230,7 +5230,8 @@ int map_pages_to_xen(
             if ( (l3e_get_flags(*pl3e) & _PAGE_PRESENT) &&
                  (l3e_get_flags(*pl3e) & _PAGE_PSE) )
             {
-                l3e_write_atomic(pl3e, l3e_from_mfn(mfn, __PAGE_HYPERVISOR));
+                l3e_write_atomic(pl3e,
+                                 l3e_from_mfn(l2t_mfn, __PAGE_HYPERVISOR));
                 UNMAP_XEN_PAGETABLE_NEW(l2t);
                 l2t = NULL;
             }
@@ -5240,7 +5241,7 @@ int map_pages_to_xen(
             if ( l2t )
             {
                 UNMAP_XEN_PAGETABLE_NEW(l2t);
-                free_xen_pagetable_new(mfn);
+                free_xen_pagetable_new(l2t_mfn);
             }
         }
 
@@ -5304,7 +5305,7 @@ int map_pages_to_xen(
                 unsigned int flush_flags =
                     FLUSH_TLB | FLUSH_ORDER(PAGETABLE_ORDER);
                 l1_pgentry_t *l1t;
-                mfn_t mfn;
+                mfn_t l1t_mfn;
 
                 /* Skip this PTE if there is no change. */
                 if ( (((l2e_get_pfn(*pl2e) & ~(L1_PAGETABLE_ENTRIES - 1)) +
@@ -5324,14 +5325,14 @@ int map_pages_to_xen(
                     goto check_l3;
                 }
 
-                mfn = alloc_xen_pagetable_new();
-                if ( mfn_eq(mfn, INVALID_MFN) )
+                l1t_mfn = alloc_xen_pagetable_new();
+                if ( mfn_eq(l1t_mfn, INVALID_MFN) )
                 {
                     ASSERT(rc == -ENOMEM);
                     goto out;
                 }
 
-                l1t = map_xen_pagetable_new(mfn);
+                l1t = map_xen_pagetable_new(l1t_mfn);
 
                 for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                     l1e_write(&l1t[i],
@@ -5346,7 +5347,7 @@ int map_pages_to_xen(
                 if ( (l2e_get_flags(*pl2e) & _PAGE_PRESENT) &&
                      (l2e_get_flags(*pl2e) & _PAGE_PSE) )
                 {
-                    l2e_write_atomic(pl2e, l2e_from_mfn(mfn,
+                    l2e_write_atomic(pl2e, l2e_from_mfn(l1t_mfn,
                                                         __PAGE_HYPERVISOR));
                     UNMAP_XEN_PAGETABLE_NEW(l1t);
                     l1t = NULL;
@@ -5357,7 +5358,7 @@ int map_pages_to_xen(
                 if ( l1t )
                 {
                     UNMAP_XEN_PAGETABLE_NEW(l1t);
-                    free_xen_pagetable_new(mfn);
+                    free_xen_pagetable_new(l1t_mfn);
                 }
             }
 
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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