]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86/mem-paging: further adjustments to p2m_mem_paging_prep()'s error handling
authorJan Beulich <jbeulich@suse.com>
Wed, 20 May 2020 10:49:28 +0000 (12:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 May 2020 10:49:28 +0000 (12:49 +0200)
Address late comments on ecb913be4aaa ("x86/mem-paging: correct
p2m_mem_paging_prep()'s error handling"):
- insert a gprintk() ahead of domain_crash(),
- add a comment.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm/mem_paging.c

index 6aa1bffa650671e04f71dfee076d0fd1a3535dd9..01281f786ee05e83d1860340bcf7486f47914d4d 100644 (file)
@@ -385,6 +385,9 @@ static int prepare(struct domain *d, gfn_t gfn,
              * The domain can't possibly know about this page yet, so failure
              * here is a clear indication of something fishy going on.
              */
+            gprintk(XENLOG_ERR,
+                    "%pd: fresh page for GFN %"PRI_gfn" in unexpected state\n",
+                    d, gfn_x(gfn));
             domain_crash(d);
             page = NULL;
             goto out;
@@ -423,6 +426,10 @@ static int prepare(struct domain *d, gfn_t gfn,
 
     if ( page )
     {
+        /*
+         * Free the page on error.  Drop our temporary reference in all
+         * cases.
+         */
         if ( ret )
             put_page_alloc_ref(page);
         put_page(page);