]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/mm: Provide more useful information in diagnostics
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 13 Apr 2019 21:03:05 +0000 (22:03 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 18 Jul 2019 15:49:28 +0000 (16:49 +0100)
 * alloc_l?_table() should identify the failure, not just state that there is
   one.
 * get_page() should use %pd for the two domains, to render system domains in
   a more obvious way.

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

index 3566c9ea2f6f41004fc71ce86528629bb9156120..334571d4455bdf74a8d6ca728298756f551d6b23 100644 (file)
@@ -1407,7 +1407,8 @@ static int alloc_l1_table(struct page_info *page)
     return 0;
 
  fail:
-    gdprintk(XENLOG_WARNING, "Failure in alloc_l1_table: slot %#x\n", i);
+    gdprintk(XENLOG_WARNING,
+             "Failure %d in alloc_l1_table: slot %#x\n", ret, i);
  out:
     while ( i-- > 0 )
         put_page_from_l1e(pl1e[i], d);
@@ -1505,7 +1506,8 @@ static int alloc_l2_table(struct page_info *page, unsigned long type)
         }
         else if ( rc < 0 && rc != -EINTR )
         {
-            gdprintk(XENLOG_WARNING, "Failure in alloc_l2_table: slot %#x\n", i);
+            gdprintk(XENLOG_WARNING,
+                     "Failure %d in alloc_l2_table: slot %#x\n", rc, i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
@@ -1599,7 +1601,8 @@ static int alloc_l3_table(struct page_info *page)
         rc = -EINVAL;
     if ( rc < 0 && rc != -ERESTART && rc != -EINTR )
     {
-        gdprintk(XENLOG_WARNING, "Failure in alloc_l3_table: slot %#x\n", i);
+        gdprintk(XENLOG_WARNING,
+                 "Failure %d in alloc_l3_table: slot %#x\n", rc, i);
         if ( i )
         {
             page->nr_validated_ptes = i;
@@ -1767,7 +1770,7 @@ static int alloc_l4_table(struct page_info *page)
         {
             if ( rc != -EINTR )
                 gdprintk(XENLOG_WARNING,
-                         "Failure in alloc_l4_table: slot %#x\n", i);
+                         "Failure %d in alloc_l4_table: slot %#x\n", rc, i);
             if ( i )
             {
                 page->nr_validated_ptes = i;
@@ -2482,9 +2485,8 @@ int get_page(struct page_info *page, struct domain *domain)
 
     if ( !paging_mode_refcounts(domain) && !domain->is_dying )
         gprintk(XENLOG_INFO,
-                "Error mfn %"PRI_mfn": rd=%d od=%d caf=%08lx taf=%" PRtype_info "\n",
-                mfn_x(page_to_mfn(page)), domain->domain_id,
-                owner ? owner->domain_id : DOMID_INVALID,
+                "Error mfn %"PRI_mfn": rd=%pd od=%pd caf=%08lx taf=%"PRtype_info"\n",
+                mfn_x(page_to_mfn(page)), domain, owner,
                 page->count_info - !!owner, page->u.inuse.type_info);
 
     if ( owner )