WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Fix grant table debug key.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix grant table debug key.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 09 Mar 2010 04:40:22 -0800
Delivery-date: Tue, 09 Mar 2010 04:41:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1268137924 0
# Node ID 83a8e561f3ffc7916ecb156f6cbc6fe9ec719b7b
# Parent  94bfa095929728de61da1c31357faccdbc1d4111
Fix grant table debug key.

Must skip domains with gt_version==0.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/grant_table.c |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diff -r 94bfa0959297 -r 83a8e561f3ff xen/common/grant_table.c
--- a/xen/common/grant_table.c  Tue Mar 09 12:29:10 2010 +0000
+++ b/xen/common/grant_table.c  Tue Mar 09 12:32:04 2010 +0000
@@ -2551,13 +2551,17 @@ void gnttab_usage_print(struct domain *r
 {
     int first = 1;
     grant_ref_t ref;
+    struct grant_table *gt = rd->grant_table;
 
     printk("      -------- active --------       -------- shared --------\n");
     printk("[ref] localdom mfn      pin          localdom gmfn     flags\n");
 
-    spin_lock(&rd->grant_table->lock);
-
-    for ( ref = 0; ref != nr_grant_entries(rd->grant_table); ref++ )
+    spin_lock(&gt->lock);
+
+    if ( gt->gt_version == 0 )
+        goto out;
+
+    for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
     {
         struct active_grant_entry *act;
         struct grant_entry_header *sha;
@@ -2566,31 +2570,31 @@ void gnttab_usage_print(struct domain *r
         uint16_t status;
         uint64_t frame;
 
-        act = &active_entry(rd->grant_table, ref);
+        act = &active_entry(gt, ref);
         if ( !act->pin )
             continue;
 
-        sha = shared_entry_header(rd->grant_table, ref);
-
-        if ( rd->grant_table->gt_version == 1 )
-        {
-            sha1 = &shared_entry_v1(rd->grant_table, ref);
+        sha = shared_entry_header(gt, ref);
+
+        if ( gt->gt_version == 1 )
+        {
+            sha1 = &shared_entry_v1(gt, ref);
             sha2 = NULL;
             status = sha->flags;
             frame = sha1->frame;
         }
         else
         {
-            sha2 = &shared_entry_v2(rd->grant_table, ref);
+            sha2 = &shared_entry_v2(gt, ref);
             sha1 = NULL;
             frame = sha2->full_page.frame;
-            status = status_entry(rd->grant_table, ref);
+            status = status_entry(gt, ref);
         }
 
         if ( first )
         {
             printk("grant-table for remote domain:%5d (v%d)\n",
-                   rd->domain_id, rd->grant_table->gt_version);
+                   rd->domain_id, gt->gt_version);
             first = 0;
         }
 
@@ -2600,7 +2604,8 @@ void gnttab_usage_print(struct domain *r
                sha->domid, frame, status);
     }
 
-    spin_unlock(&rd->grant_table->lock);
+ out:
+    spin_unlock(&gt->lock);
 
     if ( first )
         printk("grant-table for remote domain:%5d ... "

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix grant table debug key., Xen patchbot-unstable <=