[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] x86/PCI-MSI: fix messages



XENLOG_G_* should not be used in invocations of gdprintk().

Also change the wording in a few places and consistently print the
target domain. It remains questionable whether the code should be this
verbose in the first place, especially now that MSI is on by default.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2008-09-19/xen/arch/x86/physdev.c
===================================================================
--- 2008-09-19.orig/xen/arch/x86/physdev.c      2008-09-24 09:19:57.000000000 
+0200
+++ 2008-09-19/xen/arch/x86/physdev.c   2008-09-24 09:22:04.000000000 +0200
@@ -73,8 +73,8 @@ static int map_domain_pirq(struct domain
 
     if ( pirq < 0 || pirq >= NR_PIRQS || vector < 0 || vector >= NR_VECTORS )
     {
-        gdprintk(XENLOG_G_ERR,
-                 "invalid pirq %x or vector %x\n", pirq, vector);
+        dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or vector %d\n",
+                d->domain_id, pirq, vector);
         return -EINVAL;
     }
 
@@ -84,8 +84,8 @@ static int map_domain_pirq(struct domain
     if ( (old_vector && (old_vector != vector) ) ||
          (old_pirq && (old_pirq != pirq)) )
     {
-        gdprintk(XENLOG_G_ERR, "remap pirq %x vector %x while not unmap\n",
-                 pirq, vector);
+        dprintk(XENLOG_G_ERR, "dom%d: pirq %d or vector %d already mapped\n",
+                d->domain_id, pirq, vector);
         ret = -EINVAL;
         goto done;
     }
@@ -93,8 +93,8 @@ static int map_domain_pirq(struct domain
     ret = irq_permit_access(d, pirq);
     if ( ret )
     {
-        gdprintk(XENLOG_G_ERR, "add irq permit access %x failed\n", pirq);
-        ret = -EINVAL;
+        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
+                d->domain_id, pirq);
         goto done;
     }
 
@@ -107,8 +107,8 @@ static int map_domain_pirq(struct domain
 
         spin_lock_irqsave(&desc->lock, flags);
         if ( desc->handler != &no_irq_type )
-            gdprintk(XENLOG_G_ERR, "Map vector %x to msi while it is in use\n",
-                     vector);
+            dprintk(XENLOG_G_ERR, "dom%d: vector %d in use\n",
+                    d->domain_id, vector);
         desc->handler = &pci_msi_type;
 
         msi.bus = map->bus;
@@ -150,8 +150,8 @@ static int unmap_domain_pirq(struct doma
 
     if ( vector <= 0 )
     {
-        gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n",
-                 d->domain_id, pirq);
+        dprintk(XENLOG_G_ERR, "dom%d: pirq %d not mapped\n",
+                d->domain_id, pirq);
         ret = -EINVAL;
         goto done;
     }
@@ -185,7 +185,8 @@ static int unmap_domain_pirq(struct doma
 
     ret = irq_deny_access(d, pirq);
     if ( ret )
-        gdprintk(XENLOG_G_ERR, "deny irq %x access failed\n", pirq);
+        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
+                d->domain_id, pirq);
 
  done:
     return ret;
@@ -217,19 +218,19 @@ static int physdev_map_pirq(struct physd
     switch ( map->type )
     {
         case MAP_PIRQ_TYPE_GSI:
-            if ( map->index >= NR_IRQS )
+            if ( map->index < 0 || map->index >= NR_IRQS )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map invalid irq %x\n", map->index);
                 goto free_domain;
             }
             vector = IO_APIC_VECTOR(map->index);
             if ( !vector )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map irq with no vector %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map irq with no vector %x\n", map->index);
                 goto free_domain;
             }
             break;
@@ -240,17 +241,16 @@ static int physdev_map_pirq(struct physd
 
             if ( vector < 0 || vector >= NR_VECTORS )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: map irq with wrong vector %d\n",
+                        d->domain_id, map->index);
                 ret = -EINVAL;
-                gdprintk(XENLOG_G_ERR,
-                         "map_pirq with wrong vector %x\n", map->index);
                 goto free_domain;
             }
             break;
         default:
+            dprintk(XENLOG_G_ERR, "dom%d: wrong map_pirq type %x\n", 
d->domain_id, map->type);
             ret = -EINVAL;
-            gdprintk(XENLOG_G_ERR, "wrong map_pirq type %x\n", map->type);
             goto free_domain;
-            break;
     }
 
     spin_lock_irqsave(&d->arch.irq_lock, flags);
@@ -258,9 +258,9 @@ static int physdev_map_pirq(struct physd
     {
         if ( d->arch.vector_pirq[vector] )
         {
-            gdprintk(XENLOG_G_ERR, "%x %x mapped already%x\n",
-                                    map->index, map->pirq,
-                                    d->arch.vector_pirq[vector]);
+            dprintk(XENLOG_G_ERR, "dom%d: %d:%d already mapped to %d\n",
+                    d->domain_id, map->index, map->pirq,
+                    d->arch.vector_pirq[vector]);
             pirq = d->arch.vector_pirq[vector];
             if ( pirq < 0 )
             {
@@ -273,8 +273,8 @@ static int physdev_map_pirq(struct physd
             pirq = get_free_pirq(d, map->type, map->index);
             if ( pirq < 0 )
             {
+                dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_id);
                 ret = pirq;
-                gdprintk(XENLOG_G_ERR, "No free pirq\n");
                 goto done;
             }
         }
@@ -284,8 +284,8 @@ static int physdev_map_pirq(struct physd
         if ( d->arch.vector_pirq[vector] &&
              d->arch.vector_pirq[vector] != map->pirq )
         {
-            gdprintk(XENLOG_G_ERR, "%x conflict with %x\n",
-              map->index, map->pirq);
+            dprintk(XENLOG_G_ERR, "dom%d: vector %d conflicts with irq %d\n",
+                    d->domain_id, map->index, map->pirq);
             ret = -EEXIST;
             goto done;
         }



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.