]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
xxx modify_xen_mappings
authorWei Liu <wei.liu2@citrix.com>
Tue, 5 Feb 2019 12:21:48 +0000 (12:21 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 5 Feb 2019 14:32:54 +0000 (14:32 +0000)
xen/arch/x86/mm.c

index 4a6f2998dc2335e1d0b48a85da3f958640406d73..61656c73e87e81e83775a087a20ee42eacf75900 100644 (file)
@@ -5554,6 +5554,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
         else
         {
             l1_pgentry_t nl1e, *l1t, *pl1e;
+            mfn_t l1t_mfn;
 
             /*
              * Ordinary 4kB mapping: The L2 entry has been verified to be
@@ -5602,10 +5603,12 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 goto end_of_loop;
             }
 
-            l1t = l2e_to_l1e(*pl2e);
+            l1t_mfn = l2e_get_mfn(*pl2e);
+            l1t = map_xen_pagetable_new(l1t_mfn);
             for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ )
                 if ( l1e_get_intpte(l1t[i]) != 0 )
                     break;
+            unmap_xen_pagetable_new(l1t);
             if ( i == L1_PAGETABLE_ENTRIES )
             {
                 /* Empty: zap the L2E and free the L1 page. */
@@ -5613,7 +5616,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
                 if ( locking )
                     spin_unlock(&map_pgdir_lock);
                 flush_area(NULL, FLUSH_TLB_GLOBAL); /* flush before free */
-                free_xen_pagetable(l1t);
+                free_xen_pagetable_new(l1t_mfn);
             }
             else if ( locking )
                 spin_unlock(&map_pgdir_lock);