ia64/xen-unstable

changeset 13846:d3f08d39e695

[IA64] Clean up error messages from lookup_domain_mpa()

Guest I/O port accesses aren't very interesting, so reduce their log level

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild2.aw
date Wed Feb 07 10:14:41 2007 -0700 (2007-02-07)
parents 7efb3a06c56a
children fbc233a1dc53
files xen/arch/ia64/xen/mm.c xen/include/asm-ia64/linux-xen/asm/io.h
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Tue Feb 06 15:20:26 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Wed Feb 07 10:14:41 2007 -0700
     1.3 @@ -525,7 +525,9 @@ u64 translate_domain_pte(u64 pteval, u64
     1.4  			   This can happen when domU tries to touch i/o
     1.5  			   port space.  Also prevents possible address
     1.6  			   aliasing issues.  */
     1.7 -			printk("Warning: UC to WB for mpaddr=%lx\n", mpaddr);
     1.8 +			if (!(mpaddr - IO_PORTS_PADDR < IO_PORTS_SIZE))
     1.9 +				gdprintk(XENLOG_WARNING, "Warning: UC to WB "
    1.10 +				         "for mpaddr=%lx\n", mpaddr);
    1.11  			pteval = (pteval & ~_PAGE_MA_MASK) | _PAGE_MA_WB;
    1.12  		}
    1.13  		break;
    1.14 @@ -690,7 +692,6 @@ unsigned long lookup_domain_mpa(struct d
    1.15      if (pte != NULL) {
    1.16          pte_t tmp_pte = *pte;// pte is volatile. copy the value.
    1.17          if (pte_present(tmp_pte)) {
    1.18 -//printk("lookup_domain_page: found mapping for %lx, pte=%lx\n",mpaddr,pte_val(*pte));
    1.19              if (entry != NULL)
    1.20                  p2m_entry_set(entry, pte, tmp_pte);
    1.21              return pte_val(tmp_pte);
    1.22 @@ -698,14 +699,20 @@ unsigned long lookup_domain_mpa(struct d
    1.23              return GPFN_INV_MASK;
    1.24      }
    1.25  
    1.26 -    printk("%s: d 0x%p id %d current 0x%p id %d\n",
    1.27 -           __func__, d, d->domain_id, current, current->vcpu_id);
    1.28 -    if (mpaddr < d->arch.convmem_end)
    1.29 -        printk("%s: non-allocated mpa 0x%lx (< 0x%lx)\n", __func__,
    1.30 -               mpaddr, d->arch.convmem_end);
    1.31 -    else
    1.32 -        printk("%s: bad mpa 0x%lx (=> 0x%lx)\n", __func__,
    1.33 -               mpaddr, d->arch.convmem_end);
    1.34 +    if (mpaddr < d->arch.convmem_end) {
    1.35 +        gdprintk(XENLOG_WARNING, "vcpu %d iip 0x%016lx: non-allocated mpa "
    1.36 +                 "0x%lx (< 0x%lx)\n", current->vcpu_id, PSCB(current, iip),
    1.37 +                 mpaddr, d->arch.convmem_end);
    1.38 +    } else if (mpaddr - IO_PORTS_PADDR < IO_PORTS_SIZE) {
    1.39 +        /* Log I/O port probing, but complain less loudly about it */
    1.40 +        gdprintk(XENLOG_INFO, "vcpu %d iip 0x%016lx: bad I/O port access "
    1.41 +                 "0x%lx\n ", current->vcpu_id, PSCB(current, iip),
    1.42 +                 IO_SPACE_SPARSE_DECODING(mpaddr - IO_PORTS_PADDR));
    1.43 +    } else {
    1.44 +        gdprintk(XENLOG_WARNING, "vcpu %d iip 0x%016lx: bad mpa 0x%lx "
    1.45 +                 "(=> 0x%lx)\n", current->vcpu_id, PSCB(current, iip),
    1.46 +                 mpaddr, d->arch.convmem_end);
    1.47 +    }
    1.48  
    1.49      if (entry != NULL)
    1.50          p2m_entry_set(entry, NULL, __pte(0));
     2.1 --- a/xen/include/asm-ia64/linux-xen/asm/io.h	Tue Feb 06 15:20:26 2007 -0700
     2.2 +++ b/xen/include/asm-ia64/linux-xen/asm/io.h	Wed Feb 07 10:14:41 2007 -0700
     2.3 @@ -49,7 +49,7 @@
     2.4  
     2.5  #ifdef XEN
     2.6  /* Offset to IO port; do not catch error.  */
     2.7 -#define IO_SPACE_SPARSE_DECODING(off)	((((off) >> 12) << 2) | (off & 0x3))
     2.8 +#define IO_SPACE_SPARSE_DECODING(off)	((((off) >> 12) << 2) | ((off) & 0x3))
     2.9  #define IO_SPACE_SPARSE_PORTS_PER_PAGE	(0x4 << (PAGE_SHIFT - 12))
    2.10  #endif
    2.11