From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] x86/PCI-MSI: fix messages Date: Wed, 24 Sep 2008 10:01:10 +0100 Message-ID: <48DA1DF6.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 Index: 2008-09-19/xen/arch/x86/physdev.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2008-09-19.orig/xen/arch/x86/physdev.c 2008-09-24 09:19:57.0000000= 00 +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 =20 if ( pirq < 0 || pirq >=3D NR_PIRQS || vector < 0 || vector >=3D = 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; } =20 @@ -84,8 +84,8 @@ static int map_domain_pirq(struct domain if ( (old_vector && (old_vector !=3D vector) ) || (old_pirq && (old_pirq !=3D 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 =3D -EINVAL; goto done; } @@ -93,8 +93,8 @@ static int map_domain_pirq(struct domain ret =3D irq_permit_access(d, pirq); if ( ret ) { - gdprintk(XENLOG_G_ERR, "add irq permit access %x failed\n", = pirq); - ret =3D -EINVAL; + dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq = %d\n", + d->domain_id, pirq); goto done; } =20 @@ -107,8 +107,8 @@ static int map_domain_pirq(struct domain =20 spin_lock_irqsave(&desc->lock, flags); if ( desc->handler !=3D &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 =3D &pci_msi_type; =20 msi.bus =3D map->bus; @@ -150,8 +150,8 @@ static int unmap_domain_pirq(struct doma =20 if ( vector <=3D 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 =3D -EINVAL; goto done; } @@ -185,7 +185,8 @@ static int unmap_domain_pirq(struct doma =20 ret =3D 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); =20 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 >=3D NR_IRQS ) + if ( map->index < 0 || map->index >=3D NR_IRQS ) { + dprintk(XENLOG_G_ERR, "dom%d: map invalid irq %d\n", + d->domain_id, map->index); ret =3D -EINVAL; - gdprintk(XENLOG_G_ERR, - "map invalid irq %x\n", map->index); goto free_domain; } vector =3D 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 =3D -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 =20 if ( vector < 0 || vector >=3D NR_VECTORS ) { + dprintk(XENLOG_G_ERR, "dom%d: map irq with wrong vector = %d\n", + d->domain_id, map->index); ret =3D -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 =3D -EINVAL; - gdprintk(XENLOG_G_ERR, "wrong map_pirq type %x\n", map->type);= goto free_domain; - break; } =20 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 =3D d->arch.vector_pirq[vector]; if ( pirq < 0 ) { @@ -273,8 +273,8 @@ static int physdev_map_pirq(struct physd pirq =3D get_free_pirq(d, map->type, map->index); if ( pirq < 0 ) { + dprintk(XENLOG_G_ERR, "dom%d: no free pirq\n", d->domain_i= d); ret =3D 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] !=3D 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 =3D -EEXIST; goto done; }