From: Tim Deegan Date: Tue, 9 Apr 2013 08:30:33 +0000 (+0200) Subject: x86: serialize page table population in map_domain_page_global() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7051 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=69b0fbfe6036516303a7058b0a182c925c3c56c8;p=xen.git x86: serialize page table population in map_domain_page_global() 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 --- diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c index 7421e03358..efda6afd8b 100644 --- a/xen/arch/x86/domain_page.c +++ b/xen/arch/x86/domain_page.c @@ -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));