x86: serialize page table population in map_domain_page_global()
authorTim Deegan <tim@xen.org>
Tue, 9 Apr 2013 08:30:33 +0000 (10:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 9 Apr 2013 08:30:33 +0000 (10:30 +0200)
Looking at map_domain_page_global, there doesn't seem to be any locking
preventing two CPUs from populating a page of global-map l1es at the
same time.

Signed-off-by: Tim Deegan <tim@xen.org>
xen/arch/x86/domain_page.c

index 7421e033583ee79574a3988640e820163643d5f8..efda6afd8bbeddc3d42b9fc3bbea50142e003aba 100644 (file)
@@ -354,9 +354,10 @@ void *map_domain_page_global(unsigned long mfn)
     set_bit(idx, inuse);
     inuse_cursor = idx + 1;
 
+    pl1e = virt_to_xen_l1e(va);
+
     spin_unlock(&globalmap_lock);
 
-    pl1e = virt_to_xen_l1e(va);
     if ( !pl1e )
         return NULL;
     l1e_write(pl1e, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));