ia64/xen-unstable
changeset 18540:1eeb3aecea57
x86/PCI-MSI: fix log 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@novell.com>
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@novell.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Sep 24 10:20:49 2008 +0100 (2008-09-24) |
parents | 981e4d7eb8a8 |
children | 7750906b06b3 |
files | xen/arch/x86/physdev.c |
line diff
1.1 --- a/xen/arch/x86/physdev.c Wed Sep 24 10:19:07 2008 +0100 1.2 +++ b/xen/arch/x86/physdev.c Wed Sep 24 10:20:49 2008 +0100 1.3 @@ -75,8 +75,8 @@ static int map_domain_pirq(struct domain 1.4 1.5 if ( pirq < 0 || pirq >= NR_PIRQS || vector < 0 || vector >= NR_VECTORS ) 1.6 { 1.7 - gdprintk(XENLOG_G_ERR, 1.8 - "invalid pirq %x or vector %x\n", pirq, vector); 1.9 + dprintk(XENLOG_G_ERR, "dom%d: invalid pirq %d or vector %d\n", 1.10 + d->domain_id, pirq, vector); 1.11 return -EINVAL; 1.12 } 1.13 1.14 @@ -86,8 +86,8 @@ static int map_domain_pirq(struct domain 1.15 if ( (old_vector && (old_vector != vector) ) || 1.16 (old_pirq && (old_pirq != pirq)) ) 1.17 { 1.18 - gdprintk(XENLOG_G_ERR, "remap pirq %x vector %x while not unmap\n", 1.19 - pirq, vector); 1.20 + dprintk(XENLOG_G_ERR, "dom%d: pirq %d or vector %d already mapped\n", 1.21 + d->domain_id, pirq, vector); 1.22 ret = -EINVAL; 1.23 goto done; 1.24 } 1.25 @@ -95,8 +95,8 @@ static int map_domain_pirq(struct domain 1.26 ret = irq_permit_access(d, pirq); 1.27 if ( ret ) 1.28 { 1.29 - gdprintk(XENLOG_G_ERR, "add irq permit access %x failed\n", pirq); 1.30 - ret = -EINVAL; 1.31 + dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n", 1.32 + d->domain_id, pirq); 1.33 goto done; 1.34 } 1.35 1.36 @@ -109,8 +109,8 @@ static int map_domain_pirq(struct domain 1.37 1.38 spin_lock_irqsave(&desc->lock, flags); 1.39 if ( desc->handler != &no_irq_type ) 1.40 - gdprintk(XENLOG_G_ERR, "Map vector %x to msi while it is in use\n", 1.41 - vector); 1.42 + dprintk(XENLOG_G_ERR, "dom%d: vector %d in use\n", 1.43 + d->domain_id, vector); 1.44 desc->handler = &pci_msi_type; 1.45 1.46 msi.bus = map->bus; 1.47 @@ -152,8 +152,8 @@ static int unmap_domain_pirq(struct doma 1.48 1.49 if ( !vector ) 1.50 { 1.51 - gdprintk(XENLOG_G_ERR, "domain %X: pirq %x not mapped still\n", 1.52 - d->domain_id, pirq); 1.53 + dprintk(XENLOG_G_ERR, "dom%d: pirq %d not mapped\n", 1.54 + d->domain_id, pirq); 1.55 ret = -EINVAL; 1.56 goto done; 1.57 } 1.58 @@ -175,7 +175,8 @@ static int unmap_domain_pirq(struct doma 1.59 1.60 ret = irq_deny_access(d, pirq); 1.61 if ( ret ) 1.62 - gdprintk(XENLOG_G_ERR, "deny irq %x access failed\n", pirq); 1.63 + dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n", 1.64 + d->domain_id, pirq); 1.65 1.66 done: 1.67 return ret; 1.68 @@ -207,19 +208,19 @@ static int physdev_map_pirq(struct physd 1.69 switch ( map->type ) 1.70 { 1.71 case MAP_PIRQ_TYPE_GSI: 1.72 - if ( map->index >= NR_IRQS ) 1.73 + if ( map->index < 0 || map->index >= NR_IRQS ) 1.74 { 1.75 + dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n", 1.76 + d->domain_id, map->index); 1.77 ret = -EINVAL; 1.78 - gdprintk(XENLOG_G_ERR, 1.79 - "map invalid irq %x\n", map->index); 1.80 goto free_domain; 1.81 } 1.82 vector = IO_APIC_VECTOR(map->index); 1.83 if ( !vector ) 1.84 { 1.85 + dprintk(XENLOG_G_ERR, "dom%d: map irq with no vector %d\n", 1.86 + d->domain_id, map->index); 1.87 ret = -EINVAL; 1.88 - gdprintk(XENLOG_G_ERR, 1.89 - "map irq with no vector %x\n", map->index); 1.90 goto free_domain; 1.91 } 1.92 break; 1.93 @@ -230,17 +231,16 @@ static int physdev_map_pirq(struct physd 1.94 1.95 if ( vector < 0 || vector >= NR_VECTORS ) 1.96 { 1.97 + dprintk(XENLOG_G_ERR, "dom%d: map irq with wrong vector %d\n", 1.98 + d->domain_id, map->index); 1.99 ret = -EINVAL; 1.100 - gdprintk(XENLOG_G_ERR, 1.101 - "map_pirq with wrong vector %x\n", map->index); 1.102 goto free_domain; 1.103 } 1.104 break; 1.105 default: 1.106 + dprintk(XENLOG_G_ERR, "dom%d: wrong map_pirq type %x\n", d->domain_id, map->type); 1.107 ret = -EINVAL; 1.108 - gdprintk(XENLOG_G_ERR, "wrong map_pirq type %x\n", map->type); 1.109 goto free_domain; 1.110 - break; 1.111 } 1.112 1.113 spin_lock_irqsave(&d->arch.irq_lock, flags); 1.114 @@ -248,9 +248,9 @@ static int physdev_map_pirq(struct physd 1.115 { 1.116 if ( d->arch.vector_pirq[vector] ) 1.117 { 1.118 - gdprintk(XENLOG_G_ERR, "%x %x mapped already%x\n", 1.119 - map->index, map->pirq, 1.120 - d->arch.vector_pirq[vector]); 1.121 + dprintk(XENLOG_G_ERR, "dom%d: %d:%d already mapped to %d\n", 1.122 + d->domain_id, map->index, map->pirq, 1.123 + d->arch.vector_pirq[vector]); 1.124 pirq = d->arch.vector_pirq[vector]; 1.125 } 1.126 else 1.127 @@ -258,8 +258,8 @@ static int physdev_map_pirq(struct physd 1.128 pirq = get_free_pirq(d, map->type, map->index); 1.129 if ( pirq < 0 ) 1.130 { 1.131 + dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_id); 1.132 ret = pirq; 1.133 - gdprintk(XENLOG_G_ERR, "No free pirq\n"); 1.134 goto done; 1.135 } 1.136 } 1.137 @@ -269,8 +269,8 @@ static int physdev_map_pirq(struct physd 1.138 if ( d->arch.vector_pirq[vector] && 1.139 d->arch.vector_pirq[vector] != map->pirq ) 1.140 { 1.141 - gdprintk(XENLOG_G_ERR, "%x conflict with %x\n", 1.142 - map->index, map->pirq); 1.143 + dprintk(XENLOG_G_ERR, "dom%d: vector %d conflicts with irq %d\n", 1.144 + d->domain_id, map->index, map->pirq); 1.145 ret = -EEXIST; 1.146 goto done; 1.147 }