]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/mem-paging: add minimal lock order enforcement to p2m_mem_paging_prep()
authorJan Beulich <jbeulich@suse.com>
Fri, 15 May 2020 14:02:39 +0000 (16:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 May 2020 14:02:39 +0000 (16:02 +0200)
While full checking is impossible (as the lock is being acquired/
released down the call tree), perform at least a lock level check.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/mm/p2m.c

index 60a061216a3016547dbb237847791f605c5828a6..9b7b0bf1035e6011a04195d93a5bd5d833cdcdfb 100644 (file)
@@ -1816,6 +1816,7 @@ int p2m_mem_paging_prep(struct domain *d, unsigned long gfn_l, uint64_t buffer)
             goto out;
         /* Get a free page */
         ret = -ENOMEM;
+        page_alloc_mm_pre_lock(d);
         page = alloc_domheap_page(d, 0);
         if ( unlikely(page == NULL) )
             goto out;