ia64/xen-unstable

changeset 12038:36679b74e24a

[XEN] Some cleanups to the log-level stuff. Largely this
is a rename and slight interface change to DPRINTK (now
replaced by dprintk() and gdprintk()). Also shuffle some
log-level definitions around and tweak the semantics of
the upper threshold.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Fri Oct 27 23:47:30 2006 +0100 (2006-10-27)
parents d60b709724f4
children b3d94f4ddffe
files xen/arch/ia64/vmx/vlsapic.c xen/arch/ia64/vmx/vmx_hypercall.c xen/arch/ia64/vmx/vmx_init.c xen/arch/ia64/xen/dom0_ops.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/irq.c xen/arch/ia64/xen/mm.c xen/arch/ia64/xen/tlb_track.c xen/arch/ia64/xen/vcpu.c xen/arch/powerpc/mm.c xen/arch/powerpc/shadow.c xen/arch/x86/domain.c xen/arch/x86/extable.c xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/i8259.c xen/arch/x86/hvm/instrlen.c xen/arch/x86/hvm/platform.c xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/vioapic.c xen/arch/x86/hvm/vmx/vmcs.c xen/arch/x86/hvm/vmx/vmx.c xen/arch/x86/io_apic.c xen/arch/x86/irq.c xen/arch/x86/mm.c xen/arch/x86/mm/shadow/common.c xen/arch/x86/platform_hypercall.c xen/arch/x86/traps.c xen/arch/x86/x86_32/seg_fixup.c xen/arch/x86/x86_64/traps.c xen/arch/x86/x86_emulate.c xen/common/domain.c xen/common/event_channel.c xen/common/grant_table.c xen/common/memory.c xen/common/multicall.c xen/common/page_alloc.c xen/common/schedule.c xen/common/trace.c xen/drivers/char/console.c xen/include/asm-ia64/mm.h xen/include/asm-x86/mm.h xen/include/xen/config.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/vlsapic.c	Fri Oct 27 19:15:48 2006 +0100
     1.2 +++ b/xen/arch/ia64/vmx/vlsapic.c	Fri Oct 27 23:47:30 2006 +0100
     1.3 @@ -95,7 +95,7 @@ static int vmx_vcpu_unpend_interrupt(VCP
     1.4      int ret;
     1.5  
     1.6      if (vector & ~0xff) {
     1.7 -        DPRINTK("vmx_vcpu_pend_interrupt: bad vector\n");
     1.8 +        dprintk(XENLOG_WARNING, "vmx_vcpu_pend_interrupt: bad vector\n");
     1.9          return -1;
    1.10      }
    1.11  
    1.12 @@ -410,7 +410,7 @@ void vlsapic_reset(VCPU *vcpu)
    1.13      vcpu->arch.arch_vmx.vlapic.vcpu = vcpu;
    1.14      hvm_vioapic_add_lapic(&vcpu->arch.arch_vmx.vlapic, vcpu);
    1.15  #endif
    1.16 -    DPRINTK(XENLOG_INFO "VLSAPIC inservice base=%p\n", &VLSAPIC_INSVC(vcpu,0) );
    1.17 +    dprintk(XENLOG_INFO, "VLSAPIC inservice base=%p\n", &VLSAPIC_INSVC(vcpu,0) );
    1.18  }
    1.19  
    1.20  /*
    1.21 @@ -539,7 +539,7 @@ int vmx_vcpu_pend_interrupt(VCPU *vcpu, 
    1.22      int ret;
    1.23  
    1.24      if (vector & ~0xff) {
    1.25 -        DPRINTK(XENLOG_G_INFO "vmx_vcpu_pend_interrupt: bad vector\n");
    1.26 +        gdprintk(XENLOG_INFO, "vmx_vcpu_pend_interrupt: bad vector\n");
    1.27          return -1;
    1.28      }
    1.29      local_irq_save(spsr);
     2.1 --- a/xen/arch/ia64/vmx/vmx_hypercall.c	Fri Oct 27 19:15:48 2006 +0100
     2.2 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c	Fri Oct 27 23:47:30 2006 +0100
     2.3 @@ -79,7 +79,7 @@ do_hvm_op(unsigned long op, XEN_GUEST_HA
     2.4      }
     2.5  
     2.6      default:
     2.7 -        DPRINTK(XENLOG_G_INFO "Bad HVM op %ld.\n", op);
     2.8 +        gdprintk(XENLOG_INFO, "Bad HVM op %ld.\n", op);
     2.9          rc = -ENOSYS;
    2.10      }
    2.11      return rc;
     3.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Fri Oct 27 19:15:48 2006 +0100
     3.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Fri Oct 27 23:47:30 2006 +0100
     3.3 @@ -277,7 +277,7 @@ static void vmx_create_event_channels(st
     3.4  			p = get_vio(v->domain, o->vcpu_id);
     3.5  			o->arch.arch_vmx.xen_port = p->vp_eport =
     3.6  			                alloc_unbound_xen_event_channel(o, 0);
     3.7 -			DPRINTK(XENLOG_G_INFO "Allocated port %d for hvm.\n",
     3.8 +			gdprintk(XENLOG_INFO, "Allocated port %d for hvm.\n",
     3.9  			        o->arch.arch_vmx.xen_port);
    3.10  		}
    3.11  	}
     4.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Fri Oct 27 19:15:48 2006 +0100
     4.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Fri Oct 27 23:47:30 2006 +0100
     4.3 @@ -320,7 +320,7 @@ do_dom0vp_op(unsigned long cmd,
     4.4      case IA64_DOM0VP_phystomach:
     4.5          ret = ____lookup_domain_mpa(d, arg0 << PAGE_SHIFT);
     4.6          if (ret == INVALID_MFN) {
     4.7 -            DPRINTK(XENLOG_INFO "%s: INVALID_MFN ret: 0x%lx\n",
     4.8 +            dprintk(XENLOG_INFO, "%s: INVALID_MFN ret: 0x%lx\n",
     4.9                       __func__, ret);
    4.10          } else {
    4.11              ret = (ret & _PFN_MASK) >> PAGE_SHIFT;//XXX pte_pfn()
     5.1 --- a/xen/arch/ia64/xen/domain.c	Fri Oct 27 19:15:48 2006 +0100
     5.2 +++ b/xen/arch/ia64/xen/domain.c	Fri Oct 27 23:47:30 2006 +0100
     5.3 @@ -412,7 +412,7 @@ int arch_domain_create(struct domain *d)
     5.4  
     5.5  #ifdef CONFIG_XEN_IA64_PERVCPU_VHPT
     5.6  	d->arch.has_pervcpu_vhpt = opt_pervcpu_vhpt;
     5.7 -	DPRINTK("%s:%d domain %d pervcpu_vhpt %d\n",
     5.8 +	dprintk(XENLOG_WARNING, "%s:%d domain %d pervcpu_vhpt %d\n",
     5.9  	        __func__, __LINE__, d->domain_id, d->arch.has_pervcpu_vhpt);
    5.10  #endif
    5.11  	if (tlb_track_create(d) < 0)
    5.12 @@ -682,7 +682,7 @@ int shadow_mode_control(struct domain *d
    5.13  	//struct vcpu *v;
    5.14  
    5.15  	if (unlikely(d == current->domain)) {
    5.16 -		DPRINTK(XENLOG_G_INFO
    5.17 +		gdprintk(XENLOG_INFO,
    5.18                          "Don't try to do a shadow op on yourself!\n");
    5.19  		return -EINVAL;
    5.20  	}   
     6.1 --- a/xen/arch/ia64/xen/irq.c	Fri Oct 27 19:15:48 2006 +0100
     6.2 +++ b/xen/arch/ia64/xen/irq.c	Fri Oct 27 23:47:30 2006 +0100
     6.3 @@ -377,7 +377,7 @@ int pirq_guest_bind(struct vcpu *v, int 
     6.4      {
     6.5          if ( desc->action != NULL )
     6.6          {
     6.7 -            DPRINTK(XENLOG_G_INFO
     6.8 +            gdprintk(XENLOG_INFO,
     6.9                      "Cannot bind IRQ %d to guest. In use by '%s'.\n",
    6.10                      irq, desc->action->name);
    6.11              rc = -EBUSY;
    6.12 @@ -387,7 +387,7 @@ int pirq_guest_bind(struct vcpu *v, int 
    6.13          action = xmalloc(irq_guest_action_t);
    6.14          if ( (desc->action = (struct irqaction *)action) == NULL )
    6.15          {
    6.16 -            DPRINTK(XENLOG_G_INFO
    6.17 +            gdprintk(XENLOG_INFO,
    6.18                      "Cannot bind IRQ %d to guest. Out of memory.\n",
    6.19                      irq);
    6.20              rc = -ENOMEM;
    6.21 @@ -413,7 +413,7 @@ int pirq_guest_bind(struct vcpu *v, int 
    6.22      }
    6.23      else if ( !will_share || !action->shareable )
    6.24      {
    6.25 -        DPRINTK(XENLOG_G_INFO
    6.26 +        gdprintk(XENLOG_INFO,
    6.27                  "Cannot bind IRQ %d to guest. Will not share with others.\n",
    6.28                  irq);
    6.29          rc = -EBUSY;
    6.30 @@ -422,7 +422,7 @@ int pirq_guest_bind(struct vcpu *v, int 
    6.31  
    6.32      if ( action->nr_guests == IRQ_MAX_GUESTS )
    6.33      {
    6.34 -        DPRINTK(XENLOG_G_INFO
    6.35 +        gdprintk(XENLOG_INFO,
    6.36                  "Cannot bind IRQ %d to guest. Already at max share.\n",
    6.37                  irq);
    6.38          rc = -EBUSY;
     7.1 --- a/xen/arch/ia64/xen/mm.c	Fri Oct 27 19:15:48 2006 +0100
     7.2 +++ b/xen/arch/ia64/xen/mm.c	Fri Oct 27 23:47:30 2006 +0100
     7.3 @@ -229,7 +229,7 @@ try_to_clear_PGC_allocate(struct domain*
     7.4          if (unlikely(!(x & PGC_allocated)) || unlikely(_nd != _d)) {
     7.5              struct domain* nd = unpickle_domptr(_nd);
     7.6              if (nd == NULL) {
     7.7 -                DPRINTK(XENLOG_G_INFO "gnttab_transfer: "
     7.8 +                gdprintk(XENLOG_INFO, "gnttab_transfer: "
     7.9                          "Bad page %p: ed=%p(%u) 0x%x, "
    7.10                          "sd=%p 0x%x,"
    7.11                          " caf=%016lx, taf=%" PRtype_info "\n",
    7.12 @@ -445,7 +445,8 @@ u64 translate_domain_pte(u64 pteval, u64
    7.13  	arflags2 = pteval2 & _PAGE_AR_MASK;
    7.14  	if (arflags != _PAGE_AR_R && arflags2 == _PAGE_AR_R) {
    7.15  #if 0
    7.16 -		DPRINTK("%s:%d "
    7.17 +		dprintk(XENLOG_WARNING,
    7.18 +                "%s:%d "
    7.19  		        "pteval 0x%lx arflag 0x%lx address 0x%lx itir 0x%lx "
    7.20  		        "pteval2 0x%lx arflags2 0x%lx mpaddr 0x%lx\n",
    7.21  		        __func__, __LINE__,
    7.22 @@ -979,7 +980,7 @@ efi_mmio(unsigned long physaddr, unsigne
    7.23  
    7.24          if (start <= physaddr && physaddr < end) {
    7.25              if ((physaddr + size) > end) {
    7.26 -                DPRINTK(XENLOG_G_INFO "%s: physaddr 0x%lx size = 0x%lx\n",
    7.27 +                gdprintk(XENLOG_INFO, "%s: physaddr 0x%lx size = 0x%lx\n",
    7.28                          __func__, physaddr, size);
    7.29                  return 0;
    7.30              }
    7.31 @@ -1014,12 +1015,12 @@ assign_domain_mmio_page(struct domain *d
    7.32                          unsigned long mpaddr, unsigned long size)
    7.33  {
    7.34      if (size == 0) {
    7.35 -        DPRINTK(XENLOG_G_INFO "%s: domain %p mpaddr 0x%lx size = 0x%lx\n",
    7.36 +        gdprintk(XENLOG_INFO, "%s: domain %p mpaddr 0x%lx size = 0x%lx\n",
    7.37                  __func__, d, mpaddr, size);
    7.38      }
    7.39      if (!efi_mmio(mpaddr, size)) {
    7.40  #ifndef NDEBUG
    7.41 -        DPRINTK(XENLOG_G_INFO "%s: domain %p mpaddr 0x%lx size = 0x%lx\n",
    7.42 +        gdprintk(XENLOG_INFO, "%s: domain %p mpaddr 0x%lx size = 0x%lx\n",
    7.43                  __func__, d, mpaddr, size);
    7.44  #endif
    7.45          return -EINVAL;
    7.46 @@ -1109,7 +1110,7 @@ assign_domain_page_cmpxchg_rel(struct do
    7.47      old_mfn = page_to_mfn(old_page);
    7.48      old_pte = pfn_pte(old_mfn, __pgprot(old_prot));
    7.49      if (!pte_present(old_pte)) {
    7.50 -        DPRINTK(XENLOG_G_INFO
    7.51 +        gdprintk(XENLOG_INFO,
    7.52                  "%s: old_pte 0x%lx old_prot 0x%lx old_mfn 0x%lx\n",
    7.53                  __func__, pte_val(old_pte), old_prot, old_mfn);
    7.54          return -EINVAL;
    7.55 @@ -1126,7 +1127,7 @@ assign_domain_page_cmpxchg_rel(struct do
    7.56              goto again;
    7.57          }
    7.58  
    7.59 -        DPRINTK(XENLOG_G_INFO
    7.60 +        gdprintk(XENLOG_INFO,
    7.61                  "%s: old_pte 0x%lx old_prot 0x%lx old_mfn 0x%lx "
    7.62                  "ret_pte 0x%lx ret_mfn 0x%lx\n",
    7.63                  __func__,
    7.64 @@ -1187,7 +1188,7 @@ zap_domain_page_one(struct domain *d, un
    7.65                  goto again;
    7.66              }
    7.67  
    7.68 -            DPRINTK(XENLOG_G_INFO "%s: old_pte 0x%lx old_arflags 0x%lx mfn 0x%lx "
    7.69 +            gdprintk(XENLOG_INFO, "%s: old_pte 0x%lx old_arflags 0x%lx mfn 0x%lx "
    7.70                      "ret_pte 0x%lx ret_mfn 0x%lx\n",
    7.71                      __func__,
    7.72                      pte_val(old_pte), old_arflags, mfn,
    7.73 @@ -1255,7 +1256,7 @@ dom0vp_add_physmap(struct domain* d, uns
    7.74              rd = dom_io;
    7.75              break;
    7.76          default:
    7.77 -            DPRINTK(XENLOG_G_INFO "d 0x%p domid %d "
    7.78 +            gdprintk(XENLOG_INFO, "d 0x%p domid %d "
    7.79                      "pgfn 0x%lx mfn 0x%lx flags 0x%lx domid %d\n",
    7.80                      d, d->domain_id, gpfn, mfn, flags, domid);
    7.81              return -ESRCH;
    7.82 @@ -1328,7 +1329,7 @@ dom0vp_expose_p2m(struct domain* d,
    7.83          (conv_start_gpfn % granule_pfn) != 0 ||
    7.84          (assign_start_gpfn % granule_pfn) != 0 ||
    7.85          (expose_num_pfn % granule_pfn) != 0) {
    7.86 -        DPRINTK(XENLOG_G_INFO
    7.87 +        gdprintk(XENLOG_INFO,
    7.88                  "%s conv_start_gpfn 0x%016lx assign_start_gpfn 0x%016lx "
    7.89                  "expose_size 0x%016lx granulte_pfn 0x%016lx\n", __func__, 
    7.90                  conv_start_gpfn, assign_start_gpfn, expose_size, granule_pfn);
    7.91 @@ -1336,7 +1337,7 @@ dom0vp_expose_p2m(struct domain* d,
    7.92      }
    7.93  
    7.94      if (granule_pfn != PTRS_PER_PTE) {
    7.95 -        DPRINTK(XENLOG_G_INFO
    7.96 +        gdprintk(XENLOG_INFO,
    7.97                  "%s granule_pfn 0x%016lx PTRS_PER_PTE 0x%016lx\n",
    7.98                  __func__, granule_pfn, PTRS_PER_PTE);
    7.99          return -ENOSYS;
   7.100 @@ -1355,7 +1356,7 @@ dom0vp_expose_p2m(struct domain* d,
   7.101          assign_pte = lookup_alloc_domain_pte(d, (assign_start_gpfn <<
   7.102                                               PAGE_SHIFT) + i * sizeof(pte_t));
   7.103          if (assign_pte == NULL) {
   7.104 -            DPRINTK(XENLOG_G_INFO "%s failed to allocate pte page\n", __func__);
   7.105 +            gdprintk(XENLOG_INFO, "%s failed to allocate pte page\n", __func__);
   7.106              return -ENOMEM;
   7.107          }
   7.108  
   7.109 @@ -1376,7 +1377,7 @@ dom0vp_expose_p2m(struct domain* d,
   7.110  
   7.111          if (expose_p2m_page(d, (assign_start_gpfn << PAGE_SHIFT) +
   7.112                              i * sizeof(pte_t), virt_to_page(conv_pte)) < 0) {
   7.113 -            DPRINTK(XENLOG_G_INFO "%s failed to assign page\n", __func__);
   7.114 +            gdprintk(XENLOG_INFO, "%s failed to assign page\n", __func__);
   7.115              return -EAGAIN;
   7.116          }
   7.117  
   7.118 @@ -1395,7 +1396,7 @@ dom0vp_expose_p2m(struct domain* d,
   7.119          }
   7.120          if (expose_p2m_page(d, (assign_start_gpfn + i) << PAGE_SHIFT,
   7.121                              p2m_pte_zero_page) < 0) {
   7.122 -            DPRINTK(XENLOG_G_INFO "%s failed to assign zero-pte page\n", __func__);
   7.123 +            gdprintk(XENLOG_INFO, "%s failed to assign zero-pte page\n", __func__);
   7.124              return -EAGAIN;
   7.125          }
   7.126      }
   7.127 @@ -1418,7 +1419,7 @@ create_grant_host_mapping(unsigned long 
   7.128  
   7.129      if (flags & (GNTMAP_device_map |
   7.130                   GNTMAP_application_map | GNTMAP_contains_pte)) {
   7.131 -        DPRINTK(XENLOG_G_INFO "%s: flags 0x%x\n", __func__, flags);
   7.132 +        gdprintk(XENLOG_INFO, "%s: flags 0x%x\n", __func__, flags);
   7.133          return GNTST_general_error;
   7.134      }
   7.135  
   7.136 @@ -1452,13 +1453,13 @@ destroy_grant_host_mapping(unsigned long
   7.137      struct page_info* page;
   7.138  
   7.139      if (flags & (GNTMAP_application_map | GNTMAP_contains_pte)) {
   7.140 -        DPRINTK(XENLOG_G_INFO "%s: flags 0x%x\n", __func__, flags);
   7.141 +        gdprintk(XENLOG_INFO, "%s: flags 0x%x\n", __func__, flags);
   7.142          return GNTST_general_error;
   7.143      }
   7.144  
   7.145      pte = lookup_noalloc_domain_pte(d, gpaddr);
   7.146      if (pte == NULL) {
   7.147 -        DPRINTK(XENLOG_G_INFO "%s: gpaddr 0x%lx mfn 0x%lx\n",
   7.148 +        gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx\n",
   7.149                  __func__, gpaddr, mfn);
   7.150          return GNTST_general_error;
   7.151      }
   7.152 @@ -1467,7 +1468,7 @@ destroy_grant_host_mapping(unsigned long
   7.153      cur_arflags = pte_val(*pte) & ~_PAGE_PPN_MASK;
   7.154      cur_pte = pfn_pte(mfn, __pgprot(cur_arflags));
   7.155      if (!pte_present(cur_pte)) {
   7.156 -        DPRINTK(XENLOG_G_INFO "%s: gpaddr 0x%lx mfn 0x%lx cur_pte 0x%lx\n",
   7.157 +        gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx cur_pte 0x%lx\n",
   7.158                  __func__, gpaddr, mfn, pte_val(cur_pte));
   7.159          return GNTST_general_error;
   7.160      }
   7.161 @@ -1475,7 +1476,7 @@ destroy_grant_host_mapping(unsigned long
   7.162  
   7.163      old_pte = ptep_cmpxchg_rel(&d->arch.mm, gpaddr, pte, cur_pte, new_pte);
   7.164      if (unlikely(!pte_present(old_pte))) {
   7.165 -        DPRINTK(XENLOG_G_INFO "%s: gpaddr 0x%lx mfn 0x%lx"
   7.166 +        gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx"
   7.167                           " cur_pte 0x%lx old_pte 0x%lx\n",
   7.168                  __func__, gpaddr, mfn, pte_val(cur_pte), pte_val(old_pte));
   7.169          return GNTST_general_error;
   7.170 @@ -1484,7 +1485,7 @@ destroy_grant_host_mapping(unsigned long
   7.171          if (pte_pfn(old_pte) == mfn) {
   7.172              goto again;
   7.173          }
   7.174 -        DPRINTK(XENLOG_G_INFO "%s gpaddr 0x%lx mfn 0x%lx cur_pte "
   7.175 +        gdprintk(XENLOG_INFO, "%s gpaddr 0x%lx mfn 0x%lx cur_pte "
   7.176                  "0x%lx old_pte 0x%lx\n",
   7.177                  __func__, gpaddr, mfn, pte_val(cur_pte), pte_val(old_pte));
   7.178          return GNTST_general_error;
   7.179 @@ -1517,7 +1518,7 @@ steal_page(struct domain *d, struct page
   7.180      u64 x, nx, y;
   7.181  
   7.182      if (page_get_owner(page) != d) {
   7.183 -        DPRINTK(XENLOG_G_INFO "%s d 0x%p owner 0x%p\n",
   7.184 +        gdprintk(XENLOG_INFO, "%s d 0x%p owner 0x%p\n",
   7.185                  __func__, d, page_get_owner(page));
   7.186          return -1;
   7.187      }
   7.188 @@ -1530,7 +1531,7 @@ steal_page(struct domain *d, struct page
   7.189  
   7.190          new = alloc_domheap_page(d);
   7.191          if (new == NULL) {
   7.192 -            DPRINTK(XENLOG_G_INFO "alloc_domheap_page() failed\n");
   7.193 +            gdprintk(XENLOG_INFO, "alloc_domheap_page() failed\n");
   7.194              return -1;
   7.195          }
   7.196          // zero out pages for security reasons
   7.197 @@ -1554,7 +1555,7 @@ steal_page(struct domain *d, struct page
   7.198          ret = assign_domain_page_cmpxchg_rel(d, gpfn << PAGE_SHIFT, page, new,
   7.199                                               ASSIGN_writable);
   7.200          if (ret < 0) {
   7.201 -            DPRINTK(XENLOG_G_INFO "assign_domain_page_cmpxchg_rel failed %d\n",
   7.202 +            gdprintk(XENLOG_INFO, "assign_domain_page_cmpxchg_rel failed %d\n",
   7.203                      ret);
   7.204              set_gpfn_from_mfn(new_mfn, INVALID_M2P_ENTRY);
   7.205              free_domheap_page(new);
   7.206 @@ -1592,7 +1593,7 @@ steal_page(struct domain *d, struct page
   7.207              unlikely(_nd != _d)) {
   7.208              struct domain* nd = unpickle_domptr(_nd);
   7.209              if (nd == NULL) {
   7.210 -                DPRINTK(XENLOG_G_INFO "gnttab_transfer: "
   7.211 +                gdprintk(XENLOG_INFO, "gnttab_transfer: "
   7.212                          "Bad page %p: ed=%p(%u) 0x%x, "
   7.213                          "sd=%p 0x%x,"
   7.214                          " caf=%016lx, taf=%" PRtype_info
   7.215 @@ -1604,7 +1605,7 @@ steal_page(struct domain *d, struct page
   7.216                          page->u.inuse.type_info,
   7.217                          memflags);
   7.218              } else {
   7.219 -                DPRINTK(XENLOG_G_WARNING "gnttab_transfer: "
   7.220 +                gdprintk(XENLOG_WARNING, "gnttab_transfer: "
   7.221                          "Bad page %p: ed=%p(%u) 0x%x, "
   7.222                          "sd=%p(%u) 0x%x,"
   7.223                          " caf=%016lx, taf=%" PRtype_info
   7.224 @@ -1682,24 +1683,24 @@ domain_page_flush(struct domain* d, unsi
   7.225      switch (tlb_track_search_and_remove(d->arch.tlb_track,
   7.226                                          ptep, old_pte, &entry)) {
   7.227      case TLB_TRACK_NOT_TRACKED:
   7.228 -        // DPRINTK("%s TLB_TRACK_NOT_TRACKED\n", __func__);
   7.229 +        // dprintk(XENLOG_WARNING, "%s TLB_TRACK_NOT_TRACKED\n", __func__);
   7.230          domain_flush_vtlb_all();
   7.231          break;
   7.232      case TLB_TRACK_NOT_FOUND:
   7.233          /* do nothing */
   7.234 -        // DPRINTK("%s TLB_TRACK_NOT_FOUND\n", __func__);
   7.235 +        // dprintk(XENLOG_WARNING, "%s TLB_TRACK_NOT_FOUND\n", __func__);
   7.236          break;
   7.237      case TLB_TRACK_FOUND:
   7.238 -        // DPRINTK("%s TLB_TRACK_FOUND\n", __func__);
   7.239 +        // dprintk(XENLOG_WARNING, "%s TLB_TRACK_FOUND\n", __func__);
   7.240          domain_flush_vtlb_track_entry(d, entry);
   7.241          tlb_track_free_entry(d->arch.tlb_track, entry);
   7.242          break;
   7.243      case TLB_TRACK_MANY:
   7.244 -        DPRINTK(XENLOG_G_INFO "%s TLB_TRACK_MANY\n", __func__);
   7.245 +        gdprintk(XENLOG_INFO, "%s TLB_TRACK_MANY\n", __func__);
   7.246          domain_flush_vtlb_all();
   7.247          break;
   7.248      case TLB_TRACK_AGAIN:
   7.249 -        DPRINTK(XENLOG_G_ERR "%s TLB_TRACK_AGAIN\n", __func__);
   7.250 +        gdprintk(XENLOG_ERR, "%s TLB_TRACK_AGAIN\n", __func__);
   7.251          BUG();
   7.252          break;
   7.253      }
     8.1 --- a/xen/arch/ia64/xen/tlb_track.c	Fri Oct 27 19:15:48 2006 +0100
     8.2 +++ b/xen/arch/ia64/xen/tlb_track.c	Fri Oct 27 23:47:30 2006 +0100
     8.3 @@ -44,13 +44,14 @@ tlb_track_allocate_entries(struct tlb_tr
     8.4  
     8.5      BUG_ON(tlb_track->num_free > 0);
     8.6      if (tlb_track->num_entries >= tlb_track->limit) {
     8.7 -        DPRINTK("%s: num_entries %d limit %d\n",
     8.8 +        dprintk(XENLOG_WARNING, "%s: num_entries %d limit %d\n",
     8.9                  __func__, tlb_track->num_entries, tlb_track->limit);
    8.10          return -ENOMEM;
    8.11      }
    8.12      entry_page = alloc_domheap_page(NULL);
    8.13      if (entry_page == NULL) {
    8.14 -        DPRINTK("%s: domheap page failed. num_entries %d limit %d\n",
    8.15 +        dprintk(XENLOG_WARNING,
    8.16 +                "%s: domheap page failed. num_entries %d limit %d\n",
    8.17                  __func__, tlb_track->num_entries, tlb_track->limit);
    8.18          return -ENOMEM;
    8.19      }
     9.1 --- a/xen/arch/ia64/xen/vcpu.c	Fri Oct 27 19:15:48 2006 +0100
     9.2 +++ b/xen/arch/ia64/xen/vcpu.c	Fri Oct 27 23:47:30 2006 +0100
     9.3 @@ -1544,8 +1544,9 @@ vcpu_get_domain_bundle(VCPU * vcpu, REGS
     9.4  		// Last itc.i value is cached to PSCBX(vcpu, itlb).
     9.5  		tr = PSCBX(vcpu, itlb);
     9.6  		if (vcpu_match_tr_entry(&tr, gip, rid)) {
     9.7 -			//DPRINTK("%s gip 0x%lx gpip 0x%lx\n", __func__,
     9.8 -			//	gip, gpip);
     9.9 +			//dprintk(XENLOG_WARNING,
    9.10 +			//        "%s gip 0x%lx gpip 0x%lx\n", __func__,
    9.11 +			//	  gip, gpip);
    9.12  			goto found;
    9.13  		}
    9.14  		trp = vcpu_tr_lookup(vcpu, gip, rid, 1);
    9.15 @@ -1571,7 +1572,7 @@ vcpu_get_domain_bundle(VCPU * vcpu, REGS
    9.16  			set_metaphysical_rr0();
    9.17  		}
    9.18  		if (bundle->i64[0] == 0 && bundle->i64[1] == 0) {
    9.19 -			DPRINTK(XENLOG_INFO "%s gip 0x%lx\n", __func__, gip);
    9.20 +			dprintk(XENLOG_INFO, "%s gip 0x%lx\n", __func__, gip);
    9.21  			return 0;
    9.22  		}
    9.23  		return 1;
    10.1 --- a/xen/arch/powerpc/mm.c	Fri Oct 27 19:15:48 2006 +0100
    10.2 +++ b/xen/arch/powerpc/mm.c	Fri Oct 27 23:47:30 2006 +0100
    10.3 @@ -268,7 +268,7 @@ int allocate_rma(struct domain *d, unsig
    10.4  
    10.5      d->arch.rma_page = alloc_domheap_pages(d, order, 0);
    10.6      if (d->arch.rma_page == NULL) {
    10.7 -        DPRINTK(XENLOG_G_INFO "Could not allocate order=%d RMA for domain %u\n",
    10.8 +        gdprintk(XENLOG_INFO, "Could not allocate order=%d RMA for domain %u\n",
    10.9                  order, d->domain_id);
   10.10          return -ENOMEM;
   10.11      }
    11.1 --- a/xen/arch/powerpc/shadow.c	Fri Oct 27 19:15:48 2006 +0100
    11.2 +++ b/xen/arch/powerpc/shadow.c	Fri Oct 27 23:47:30 2006 +0100
    11.3 @@ -120,14 +120,14 @@ int shadow_domctl(struct domain *d,
    11.4  {
    11.5      if ( unlikely(d == current->domain) )
    11.6      {
    11.7 -        DPRINTK(XENLOG_G_INFO "Don't try to do a shadow op on yourself!\n");
    11.8 +        gdprintk(XENLOG_INFO, "Don't try to do a shadow op on yourself!\n");
    11.9          return -EINVAL;
   11.10      }
   11.11  
   11.12      switch ( sc->op )
   11.13      {
   11.14      case XEN_DOMCTL_SHADOW_OP_OFF:
   11.15 -         DPRINTK(XENLOG_G_INFO "Shadow is mandatory!\n");
   11.16 +         gdprintk(XENLOG_INFO, "Shadow is mandatory!\n");
   11.17           return -EINVAL;
   11.18  
   11.19      case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
    12.1 --- a/xen/arch/x86/domain.c	Fri Oct 27 19:15:48 2006 +0100
    12.2 +++ b/xen/arch/x86/domain.c	Fri Oct 27 23:47:30 2006 +0100
    12.3 @@ -564,7 +564,7 @@ static void load_segments(struct vcpu *n
    12.4               put_user(regs->r11,           rsp-10) |
    12.5               put_user(regs->rcx,           rsp-11) )
    12.6          {
    12.7 -            DPRINTK(XENLOG_G_ERR "Error while creating failsafe "
    12.8 +            gdprintk(XENLOG_ERR, "Error while creating failsafe "
    12.9                      "callback frame.\n");
   12.10              domain_crash(n->domain);
   12.11          }
    13.1 --- a/xen/arch/x86/extable.c	Fri Oct 27 19:15:48 2006 +0100
    13.2 +++ b/xen/arch/x86/extable.c	Fri Oct 27 23:47:30 2006 +0100
    13.3 @@ -74,7 +74,7 @@ search_pre_exception_table(struct cpu_us
    13.4      unsigned long addr = (unsigned long)regs->eip;
    13.5      unsigned long fixup = search_one_table(
    13.6          __start___pre_ex_table, __stop___pre_ex_table-1, addr);
    13.7 -    DPRINTK(XENLOG_INFO "Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
    13.8 +    dprintk(XENLOG_INFO, "Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
    13.9  #ifdef PERF_COUNTERS
   13.10      if ( fixup )
   13.11          perfc_incrc(exception_fixed);
    14.1 --- a/xen/arch/x86/hvm/hvm.c	Fri Oct 27 19:15:48 2006 +0100
    14.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri Oct 27 23:47:30 2006 +0100
    14.3 @@ -194,7 +194,7 @@ void hvm_create_event_channels(struct vc
    14.4              p = get_vio(v->domain, o->vcpu_id);
    14.5              o->arch.hvm_vcpu.xen_port = p->vp_eport =
    14.6                  alloc_unbound_xen_event_channel(o, 0);
    14.7 -            DPRINTK(XENLOG_INFO "Allocated port %d for hvm.\n",
    14.8 +            dprintk(XENLOG_INFO, "Allocated port %d for hvm.\n",
    14.9                      o->arch.hvm_vcpu.xen_port);
   14.10          }
   14.11      }
   14.12 @@ -356,7 +356,7 @@ static void hvm_vcpu_down(void)
   14.13      struct domain *d = v->domain;
   14.14      int online_count = 0;
   14.15  
   14.16 -    DPRINTK(XENLOG_G_INFO "DOM%d/VCPU%d: going offline.\n",
   14.17 +    gdprintk(XENLOG_INFO, "DOM%d/VCPU%d: going offline.\n",
   14.18             d->domain_id, v->vcpu_id);
   14.19  
   14.20      /* Doesn't halt us immediately, but we'll never return to guest context. */
   14.21 @@ -373,7 +373,7 @@ static void hvm_vcpu_down(void)
   14.22      /* ... Shut down the domain if not. */
   14.23      if ( online_count == 0 )
   14.24      {
   14.25 -        DPRINTK(XENLOG_G_INFO "DOM%d: all CPUs offline -- powering off.\n",
   14.26 +        gdprintk(XENLOG_INFO, "DOM%d: all CPUs offline -- powering off.\n",
   14.27                  d->domain_id);
   14.28          domain_shutdown(d, SHUTDOWN_poweroff);
   14.29      }
   14.30 @@ -514,7 +514,7 @@ void hvm_do_hypercall(struct cpu_user_re
   14.31  
   14.32      if ( (pregs->eax >= NR_hypercalls) || !hvm_hypercall_table[pregs->eax] )
   14.33      {
   14.34 -        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %d.\n",
   14.35 +        gdprintk(XENLOG_INFO, "HVM vcpu %d:%d did a bad hypercall %d.\n",
   14.36                  current->domain->domain_id, current->vcpu_id,
   14.37                  pregs->eax);
   14.38          pregs->eax = -ENOSYS;
   14.39 @@ -560,7 +560,7 @@ static long do_memory_op_compat32(int cm
   14.40      }
   14.41  
   14.42      default:
   14.43 -        DPRINTK(XENLOG_G_INFO "memory_op %d.\n", cmd);
   14.44 +        gdprintk(XENLOG_INFO, "memory_op %d.\n", cmd);
   14.45          rc = -ENOSYS;
   14.46          break;
   14.47      }
   14.48 @@ -593,7 +593,7 @@ void hvm_do_hypercall(struct cpu_user_re
   14.49      pregs->rax = (uint32_t)pregs->eax; /* mask in case compat32 caller */
   14.50      if ( (pregs->rax >= NR_hypercalls) || !hvm_hypercall64_table[pregs->rax] )
   14.51      {
   14.52 -        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %ld.\n",
   14.53 +        gdprintk(XENLOG_INFO, "HVM vcpu %d:%d did a bad hypercall %ld.\n",
   14.54                  current->domain->domain_id, current->vcpu_id,
   14.55                  pregs->rax);
   14.56          pregs->rax = -ENOSYS;
   14.57 @@ -644,7 +644,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
   14.58  
   14.59      if ( bsp->vcpu_id != 0 )
   14.60      {
   14.61 -        DPRINTK(XENLOG_G_ERR "Not calling hvm_bringup_ap from BSP context.\n");
   14.62 +        gdprintk(XENLOG_ERR, "Not calling hvm_bringup_ap from BSP context.\n");
   14.63          domain_crash_synchronous();
   14.64      }
   14.65  
   14.66 @@ -653,7 +653,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
   14.67  
   14.68      if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
   14.69      {
   14.70 -        DPRINTK(XENLOG_G_INFO
   14.71 +        gdprintk(XENLOG_INFO,
   14.72                  "Failed to allocate memory in hvm_bringup_ap.\n");
   14.73          return -ENOMEM;
   14.74      }
   14.75 @@ -668,14 +668,14 @@ int hvm_bringup_ap(int vcpuid, int tramp
   14.76  
   14.77      if ( rc != 0 )
   14.78      {
   14.79 -        DPRINTK(XENLOG_G_INFO
   14.80 +        gdprintk(XENLOG_INFO,
   14.81                 "AP %d bringup failed in boot_vcpu %x.\n", vcpuid, rc);
   14.82          goto out;
   14.83      }
   14.84  
   14.85      if ( test_and_clear_bit(_VCPUF_down, &d->vcpu[vcpuid]->vcpu_flags) )
   14.86          vcpu_wake(d->vcpu[vcpuid]);
   14.87 -    DPRINTK(XENLOG_G_INFO "AP %d bringup suceeded.\n", vcpuid);
   14.88 +    gdprintk(XENLOG_INFO, "AP %d bringup suceeded.\n", vcpuid);
   14.89  
   14.90   out:
   14.91      xfree(ctxt);
   14.92 @@ -734,7 +734,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
   14.93  
   14.94      default:
   14.95      {
   14.96 -        DPRINTK(XENLOG_G_INFO "Bad HVM op %ld.\n", op);
   14.97 +        gdprintk(XENLOG_INFO, "Bad HVM op %ld.\n", op);
   14.98          rc = -ENOSYS;
   14.99          break;
  14.100      }
    15.1 --- a/xen/arch/x86/hvm/i8259.c	Fri Oct 27 19:15:48 2006 +0100
    15.2 +++ b/xen/arch/x86/hvm/i8259.c	Fri Oct 27 23:47:30 2006 +0100
    15.3 @@ -140,10 +140,8 @@ void pic_set_xen_irq(void *opaque, int i
    15.4  
    15.5      /* Set it on the 8259s */
    15.6      ps = &s->pics[irq >> 3];
    15.7 -    if (!(ps->elcr & (1 << (irq & 7)))) {
    15.8 -	DPRINTK("edge-triggered override IRQ?\n");
    15.9 -	domain_crash(current->domain);
   15.10 -    }
   15.11 +    if (!(ps->elcr & (1 << (irq & 7))))
   15.12 +	gdprintk(XENLOG_WARNING, "edge-triggered override IRQ?\n");
   15.13      if (level) {
   15.14  	ps->irr_xen |= 1 << (irq & 7);
   15.15      } else {
    16.1 --- a/xen/arch/x86/hvm/instrlen.c	Fri Oct 27 19:15:48 2006 +0100
    16.2 +++ b/xen/arch/x86/hvm/instrlen.c	Fri Oct 27 23:47:30 2006 +0100
    16.3 @@ -317,7 +317,7 @@ done_prefixes:
    16.4  
    16.5          if ( modrm_mod == 3 )
    16.6          {
    16.7 -            DPRINTK(XENLOG_G_WARNING "Cannot parse ModRM.mod == 3.\n");
    16.8 +            gdprintk(XENLOG_WARNING, "Cannot parse ModRM.mod == 3.\n");
    16.9              goto cannot_emulate;
   16.10          }
   16.11  
   16.12 @@ -444,7 +444,7 @@ done:
   16.13      return length;
   16.14  
   16.15  cannot_emulate:
   16.16 -    DPRINTK(XENLOG_G_WARNING
   16.17 +    gdprintk(XENLOG_WARNING,
   16.18              "Cannot emulate %02x at address %lx (eip %lx, mode %d)\n",
   16.19              b, (unsigned long)_regs.eip, (unsigned long)regs->eip, mode);
   16.20      return -1;
    17.1 --- a/xen/arch/x86/hvm/platform.c	Fri Oct 27 19:15:48 2006 +0100
    17.2 +++ b/xen/arch/x86/hvm/platform.c	Fri Oct 27 23:47:30 2006 +0100
    17.3 @@ -956,7 +956,8 @@ void handle_mmio(unsigned long gpa)
    17.4          }
    17.5  
    17.6          if ( addr & (size - 1) )
    17.7 -            DPRINTK("Unaligned ioport access: %lx, %d\n", addr, size);
    17.8 +            gdprintk(XENLOG_WARNING,
    17.9 +                     "Unaligned ioport access: %lx, %d\n", addr, size);
   17.10  
   17.11          /*
   17.12           * In case of a movs spanning multiple pages, we break the accesses
   17.13 @@ -971,7 +972,8 @@ void handle_mmio(unsigned long gpa)
   17.14          if ( (addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK) ) {
   17.15              unsigned long value = 0;
   17.16  
   17.17 -            DPRINTK("Single io request in a movs crossing page boundary.\n");
   17.18 +            gdprintk(XENLOG_WARNING,
   17.19 +                     "Single io request in a movs crossing page boundary.\n");
   17.20              mmio_op->flags |= OVERLAP;
   17.21  
   17.22              if ( dir == IOREQ_WRITE ) {
    18.1 --- a/xen/arch/x86/hvm/svm/svm.c	Fri Oct 27 19:15:48 2006 +0100
    18.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Fri Oct 27 23:47:30 2006 +0100
    18.3 @@ -805,7 +805,7 @@ static void svm_final_setup_guest(struct
    18.4  
    18.5      if ( !shadow_mode_external(d) )
    18.6      {
    18.7 -        DPRINTK(XENLOG_G_ERR "Can't init HVM for dom %u vcpu %u: "
    18.8 +        gdprintk(XENLOG_ERR, "Can't init HVM for dom %u vcpu %u: "
    18.9                  "not in shadow external mode\n", d->domain_id, v->vcpu_id);
   18.10          domain_crash(d);
   18.11      }
    19.1 --- a/xen/arch/x86/hvm/vioapic.c	Fri Oct 27 19:15:48 2006 +0100
    19.2 +++ b/xen/arch/x86/hvm/vioapic.c	Fri Oct 27 23:47:30 2006 +0100
    19.3 @@ -556,10 +556,8 @@ void hvm_vioapic_set_xen_irq(struct doma
    19.4  	s->redirtbl[irq].RedirForm.mask)
    19.5          return;
    19.6  
    19.7 -    if (s->redirtbl[irq].RedirForm.trigmod != IOAPIC_LEVEL_TRIGGER) {
    19.8 -	DPRINTK("Forcing edge triggered APIC irq %d?\n", irq);
    19.9 -	domain_crash(d);
   19.10 -    }
   19.11 +    if (s->redirtbl[irq].RedirForm.trigmod != IOAPIC_LEVEL_TRIGGER)
   19.12 +	gdprintk(XENLOG_WARNING, "Forcing edge triggered APIC irq %d?\n", irq);
   19.13  
   19.14      if (level)
   19.15  	s->irr_xen |= 1 << irq;
    20.1 --- a/xen/arch/x86/hvm/vmx/vmcs.c	Fri Oct 27 19:15:48 2006 +0100
    20.2 +++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Oct 27 23:47:30 2006 +0100
    20.3 @@ -145,7 +145,7 @@ static struct vmcs_struct *vmx_alloc_vmc
    20.4  
    20.5      if ( (vmcs = alloc_xenheap_page()) == NULL )
    20.6      {
    20.7 -        DPRINTK(XENLOG_G_WARNING "Failed to allocate VMCS.\n");
    20.8 +        gdprintk(XENLOG_WARNING, "Failed to allocate VMCS.\n");
    20.9          return NULL;
   20.10      }
   20.11  
    21.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Oct 27 19:15:48 2006 +0100
    21.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Oct 27 23:47:30 2006 +0100
    21.3 @@ -71,7 +71,7 @@ static int vmx_initialize_guest_resource
    21.4  
    21.5      if ( !shadow_mode_external(d) )
    21.6      {
    21.7 -        DPRINTK(XENLOG_ERR "Can't init HVM for dom %u vcpu %u: "
    21.8 +        dprintk(XENLOG_ERR, "Can't init HVM for dom %u vcpu %u: "
    21.9                  "not in shadow external mode\n", 
   21.10                  d->domain_id, v->vcpu_id);
   21.11          domain_crash(d);
   21.12 @@ -83,7 +83,7 @@ static int vmx_initialize_guest_resource
   21.13  
   21.14          if ( (rc = vmx_create_vmcs(vc)) != 0 )
   21.15          {
   21.16 -            DPRINTK(XENLOG_WARNING
   21.17 +            dprintk(XENLOG_WARNING,
   21.18                      "Failed to create VMCS for vcpu %d: err=%d.\n",
   21.19                      vc->vcpu_id, rc);
   21.20              return 0;
   21.21 @@ -93,7 +93,7 @@ static int vmx_initialize_guest_resource
   21.22  
   21.23          if ( (io_bitmap_a = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
   21.24          {
   21.25 -            DPRINTK(XENLOG_WARNING
   21.26 +            dprintk(XENLOG_WARNING,
   21.27                     "Failed to allocate io bitmap b for vcpu %d.\n",
   21.28                      vc->vcpu_id);
   21.29              return 0;
   21.30 @@ -101,7 +101,7 @@ static int vmx_initialize_guest_resource
   21.31  
   21.32          if ( (io_bitmap_b = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
   21.33          {
   21.34 -            DPRINTK(XENLOG_WARNING
   21.35 +            dprintk(XENLOG_WARNING,
   21.36                      "Failed to allocate io bitmap b for vcpu %d.\n",
   21.37                      vc->vcpu_id);
   21.38              return 0;
   21.39 @@ -940,7 +940,7 @@ static void vmx_do_cpuid(struct cpu_user
   21.40          unsigned long mfn = get_mfn_from_gpfn(value >> PAGE_SHIFT);
   21.41          char *p;
   21.42  
   21.43 -        DPRINTK(XENLOG_G_INFO "Input address is 0x%"PRIx64".\n", value);
   21.44 +        gdprintk(XENLOG_INFO, "Input address is 0x%"PRIx64".\n", value);
   21.45  
   21.46          /* 8-byte aligned valid pseudophys address from vmxassist, please. */
   21.47          if ( (value & 7) || (mfn == INVALID_MFN) ||
   21.48 @@ -951,7 +951,7 @@ static void vmx_do_cpuid(struct cpu_user
   21.49          value = *((uint64_t *)(p + (value & (PAGE_SIZE - 1))));
   21.50          unmap_domain_page(p);
   21.51  
   21.52 -        DPRINTK(XENLOG_G_INFO "Output value is 0x%"PRIx64".\n", value);
   21.53 +        gdprintk(XENLOG_INFO, "Output value is 0x%"PRIx64".\n", value);
   21.54          ecx = (u32)(value >>  0);
   21.55          edx = (u32)(value >> 32);
   21.56      }
    22.1 --- a/xen/arch/x86/io_apic.c	Fri Oct 27 19:15:48 2006 +0100
    22.2 +++ b/xen/arch/x86/io_apic.c	Fri Oct 27 23:47:30 2006 +0100
    22.3 @@ -1980,7 +1980,7 @@ int ioapic_guest_read(unsigned long phys
    22.4  }
    22.5  
    22.6  #define WARN_BOGUS_WRITE(f, a...)                                       \
    22.7 -    DPRINTK(XENLOG_INFO "\n%s: "                                        \
    22.8 +    dprintk(XENLOG_INFO, "\n%s: "                                        \
    22.9              "apic=%d, pin=%d, old_irq=%d, new_irq=%d\n"                 \
   22.10              "%s: old_entry=%08x, new_entry=%08x\n"                      \
   22.11              "%s: " f, __FUNCTION__, apic, pin, old_irq, new_irq,        \
    23.1 --- a/xen/arch/x86/irq.c	Fri Oct 27 19:15:48 2006 +0100
    23.2 +++ b/xen/arch/x86/irq.c	Fri Oct 27 23:47:30 2006 +0100
    23.3 @@ -432,7 +432,7 @@ int pirq_guest_bind(struct vcpu *v, int 
    23.4      {
    23.5          if ( desc->action != NULL )
    23.6          {
    23.7 -            DPRINTK(XENLOG_G_INFO
    23.8 +            gdprintk(XENLOG_INFO,
    23.9                      "Cannot bind IRQ %d to guest. In use by '%s'.\n",
   23.10                      irq, desc->action->name);
   23.11              rc = -EBUSY;
   23.12 @@ -442,7 +442,7 @@ int pirq_guest_bind(struct vcpu *v, int 
   23.13          action = xmalloc(irq_guest_action_t);
   23.14          if ( (desc->action = (struct irqaction *)action) == NULL )
   23.15          {
   23.16 -            DPRINTK(XENLOG_G_INFO
   23.17 +            gdprintk(XENLOG_INFO,
   23.18                      "Cannot bind IRQ %d to guest. Out of memory.\n",
   23.19                      irq);
   23.20              rc = -ENOMEM;
   23.21 @@ -467,7 +467,7 @@ int pirq_guest_bind(struct vcpu *v, int 
   23.22      }
   23.23      else if ( !will_share || !action->shareable )
   23.24      {
   23.25 -        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
   23.26 +        gdprintk(XENLOG_INFO, "Cannot bind IRQ %d to guest. "
   23.27                 "Will not share with others.\n",
   23.28                  irq);
   23.29          rc = -EBUSY;
   23.30 @@ -488,7 +488,7 @@ int pirq_guest_bind(struct vcpu *v, int 
   23.31  
   23.32      if ( action->nr_guests == IRQ_MAX_GUESTS )
   23.33      {
   23.34 -        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
   23.35 +        gdprintk(XENLOG_INFO, "Cannot bind IRQ %d to guest. "
   23.36                 "Already at max share.\n", irq);
   23.37          rc = -EBUSY;
   23.38          goto out;
    24.1 --- a/xen/arch/x86/mm.c	Fri Oct 27 19:15:48 2006 +0100
    24.2 +++ b/xen/arch/x86/mm.c	Fri Oct 27 23:47:30 2006 +0100
    24.3 @@ -108,16 +108,7 @@
    24.4  #include <asm/e820.h>
    24.5  #include <public/memory.h>
    24.6  
    24.7 -#ifdef VERBOSE
    24.8 -#define MEM_LOG(_f, _a...)                                          \
    24.9 -    do {                                                            \
   24.10 -        if ( printk_ratelimit() )                                   \
   24.11 -            printk("DOM%u: (file=mm.c, line=%d) " _f "\n",          \
   24.12 -                   current->domain->domain_id , __LINE__ , ## _a ); \
   24.13 -    } while (0)
   24.14 -#else
   24.15 -#define MEM_LOG(_f, _a...) ((void)0)
   24.16 -#endif
   24.17 +#define MEM_LOG(_f, _a...) gdprintk(XENLOG_WARNING , _f , ## _a)
   24.18  
   24.19  /*
   24.20   * PTE updates can be done with ordinary writes except:
   24.21 @@ -2261,8 +2252,7 @@ int do_mmu_update(
   24.22              {
   24.23                  if ( shadow_mode_refcounts(d) )
   24.24                  {
   24.25 -                    DPRINTK(XENLOG_INFO
   24.26 -                            "mmu update on shadow-refcounted domain!");
   24.27 +                    MEM_LOG("mmu update on shadow-refcounted domain!");
   24.28                      break;
   24.29                  }
   24.30  
   24.31 @@ -2626,8 +2616,7 @@ int steal_page(
   24.32          x = y;
   24.33          if (unlikely((x & (PGC_count_mask|PGC_allocated)) !=
   24.34                       (1 | PGC_allocated)) || unlikely(_nd != _d)) { 
   24.35 -            DPRINTK(XENLOG_G_WARNING
   24.36 -                    "gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
   24.37 +            MEM_LOG("gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
   24.38                      " caf=%08x, taf=%" PRtype_info "\n", 
   24.39                      (void *) page_to_mfn(page),
   24.40                      d, d->domain_id, unpickle_domptr(_nd), x, 
    25.1 --- a/xen/arch/x86/mm/shadow/common.c	Fri Oct 27 19:15:48 2006 +0100
    25.2 +++ b/xen/arch/x86/mm/shadow/common.c	Fri Oct 27 23:47:30 2006 +0100
    25.3 @@ -3072,7 +3072,7 @@ int shadow_domctl(struct domain *d,
    25.4  
    25.5      if ( unlikely(d == current->domain) )
    25.6      {
    25.7 -        DPRINTK(XENLOG_G_INFO "Don't try to do a shadow op on yourself!\n");
    25.8 +        gdprintk(XENLOG_INFO, "Don't try to do a shadow op on yourself!\n");
    25.9          return -EINVAL;
   25.10      }
   25.11  
    26.1 --- a/xen/arch/x86/platform_hypercall.c	Fri Oct 27 19:15:48 2006 +0100
    26.2 +++ b/xen/arch/x86/platform_hypercall.c	Fri Oct 27 23:47:30 2006 +0100
    26.3 @@ -125,7 +125,7 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
    26.4          case QUIRK_IOAPIC_GOOD_REGSEL:
    26.5  #ifndef sis_apic_bug
    26.6              sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
    26.7 -            DPRINTK(XENLOG_INFO "Domain 0 says that IO-APIC REGSEL is %s\n",
    26.8 +            dprintk(XENLOG_INFO, "Domain 0 says that IO-APIC REGSEL is %s\n",
    26.9                      sis_apic_bug ? "bad" : "good");
   26.10  #else
   26.11              BUG_ON(sis_apic_bug != (quirk_id == QUIRK_IOAPIC_BAD_REGSEL));
    27.1 --- a/xen/arch/x86/traps.c	Fri Oct 27 19:15:48 2006 +0100
    27.2 +++ b/xen/arch/x86/traps.c	Fri Oct 27 23:47:30 2006 +0100
    27.3 @@ -407,7 +407,7 @@ static inline int do_trap(int trapnr, ch
    27.4  
    27.5      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    27.6      {
    27.7 -        DPRINTK(XENLOG_ERR "Trap %d: %p -> %p\n",
    27.8 +        dprintk(XENLOG_ERR, "Trap %d: %p -> %p\n",
    27.9                  trapnr, _p(regs->eip), _p(fixup));
   27.10          regs->eip = fixup;
   27.11          return 0;
   27.12 @@ -476,7 +476,7 @@ int wrmsr_hypervisor_regs(
   27.13  
   27.14          if ( idx > 0 )
   27.15          {
   27.16 -            DPRINTK(XENLOG_G_WARNING
   27.17 +            gdprintk(XENLOG_WARNING,
   27.18                      "Dom%d: Out of range index %u to MSR %08x\n",
   27.19                      d->domain_id, idx, 0x40000000);
   27.20              return 0;
   27.21 @@ -487,7 +487,7 @@ int wrmsr_hypervisor_regs(
   27.22          if ( !mfn_valid(mfn) ||
   27.23               !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
   27.24          {
   27.25 -            DPRINTK(XENLOG_G_WARNING
   27.26 +            gdprintk(XENLOG_WARNING,
   27.27                      "Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
   27.28                      d->domain_id, gmfn, mfn, 0x40000000);
   27.29              return 0;
   27.30 @@ -835,18 +835,18 @@ static int __spurious_page_fault(
   27.31          return 0;
   27.32  
   27.33   spurious:
   27.34 -    DPRINTK(XENLOG_WARNING "Spurious fault in domain %u:%u "
   27.35 +    dprintk(XENLOG_WARNING, "Spurious fault in domain %u:%u "
   27.36              "at addr %lx, e/c %04x\n",
   27.37              current->domain->domain_id, current->vcpu_id,
   27.38              addr, regs->error_code);
   27.39  #if CONFIG_PAGING_LEVELS >= 4
   27.40 -    DPRINTK(XENLOG_WARNING " l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
   27.41 +    dprintk(XENLOG_WARNING, " l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
   27.42  #endif
   27.43  #if CONFIG_PAGING_LEVELS >= 3
   27.44 -    DPRINTK(XENLOG_WARNING " l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
   27.45 +    dprintk(XENLOG_WARNING, " l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
   27.46  #endif
   27.47 -    DPRINTK(XENLOG_WARNING " l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
   27.48 -    DPRINTK(XENLOG_WARNING " l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
   27.49 +    dprintk(XENLOG_WARNING, " l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
   27.50 +    dprintk(XENLOG_WARNING, " l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
   27.51  #ifndef NDEBUG
   27.52      show_registers(regs);
   27.53  #endif
   27.54 @@ -1317,7 +1317,7 @@ static int emulate_privileged_op(struct 
   27.55          case 0: /* Write CR0 */
   27.56              if ( (*reg ^ read_cr0()) & ~X86_CR0_TS )
   27.57              {
   27.58 -                DPRINTK(XENLOG_G_WARNING
   27.59 +                gdprintk(XENLOG_WARNING,
   27.60                          "Attempt to change unmodifiable CR0 flags.\n");
   27.61                  goto fail;
   27.62              }
   27.63 @@ -1338,7 +1338,7 @@ static int emulate_privileged_op(struct 
   27.64          case 4:
   27.65              if ( *reg != (read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE)) )
   27.66              {
   27.67 -                DPRINTK(XENLOG_G_WARNING "Attempt to change CR4 flags.\n");
   27.68 +                gdprintk(XENLOG_WARNING, "Attempt to change CR4 flags.\n");
   27.69                  goto fail;
   27.70              }
   27.71              break;
   27.72 @@ -1386,7 +1386,7 @@ static int emulate_privileged_op(struct 
   27.73  
   27.74              if ( (rdmsr_safe(regs->ecx, l, h) != 0) ||
   27.75                   (regs->eax != l) || (regs->edx != h) )
   27.76 -                DPRINTK(XENLOG_G_WARNING "Domain attempted WRMSR %p from "
   27.77 +                gdprintk(XENLOG_WARNING, "Domain attempted WRMSR %p from "
   27.78                          "%08x:%08x to %08lx:%08lx.\n",
   27.79                          _p(regs->ecx), h, l, (long)regs->edx, (long)regs->eax);
   27.80              break;
   27.81 @@ -1422,7 +1422,8 @@ static int emulate_privileged_op(struct 
   27.82                  break;
   27.83              }
   27.84              /* Everyone can read the MSR space. */
   27.85 -            /*DPRINTK("Domain attempted RDMSR %p.\n", _p(regs->ecx));*/
   27.86 +            /* gdprintk(XENLOG_WARNING,"Domain attempted RDMSR %p.\n",
   27.87 +                        _p(regs->ecx));*/
   27.88              if ( rdmsr_safe(regs->ecx, regs->eax, regs->edx) )
   27.89                  goto fail;
   27.90              break;
   27.91 @@ -1515,7 +1516,7 @@ asmlinkage int do_general_protection(str
   27.92  
   27.93      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   27.94      {
   27.95 -        DPRINTK(XENLOG_WARNING "GPF (%04x): %p -> %p\n",
   27.96 +        dprintk(XENLOG_WARNING, "GPF (%04x): %p -> %p\n",
   27.97                  regs->error_code, _p(regs->eip), _p(fixup));
   27.98          regs->eip = fixup;
   27.99          return 0;
    28.1 --- a/xen/arch/x86/x86_32/seg_fixup.c	Fri Oct 27 19:15:48 2006 +0100
    28.2 +++ b/xen/arch/x86/x86_32/seg_fixup.c	Fri Oct 27 23:47:30 2006 +0100
    28.3 @@ -181,7 +181,7 @@ int fixup_seg(u16 seg, unsigned long off
    28.4          table = (unsigned long *)LDT_VIRT_START(d);
    28.5          if ( idx >= d->arch.guest_context.ldt_ents )
    28.6          {
    28.7 -            DPRINTK(XENLOG_DEBUG "Segment %04x out of LDT range (%ld)\n",
    28.8 +            dprintk(XENLOG_DEBUG, "Segment %04x out of LDT range (%ld)\n",
    28.9                      seg, d->arch.guest_context.ldt_ents);
   28.10              goto fail;
   28.11          }
   28.12 @@ -191,7 +191,7 @@ int fixup_seg(u16 seg, unsigned long off
   28.13          table = (unsigned long *)GDT_VIRT_START(d);
   28.14          if ( idx >= d->arch.guest_context.gdt_ents )
   28.15          {
   28.16 -            DPRINTK(XENLOG_DEBUG "Segment %04x out of GDT range (%ld)\n",
   28.17 +            dprintk(XENLOG_DEBUG, "Segment %04x out of GDT range (%ld)\n",
   28.18                      seg, d->arch.guest_context.gdt_ents);
   28.19              goto fail;
   28.20          }
   28.21 @@ -201,7 +201,7 @@ int fixup_seg(u16 seg, unsigned long off
   28.22      if ( __get_user(a, &table[2*idx+0]) ||
   28.23           __get_user(b, &table[2*idx+1]) )
   28.24      {
   28.25 -        DPRINTK(XENLOG_DEBUG "Fault while reading segment %04x\n", seg);
   28.26 +        dprintk(XENLOG_DEBUG, "Fault while reading segment %04x\n", seg);
   28.27          goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
   28.28      }
   28.29  
   28.30 @@ -210,7 +210,7 @@ int fixup_seg(u16 seg, unsigned long off
   28.31                 _SEGMENT_G|_SEGMENT_CODE|_SEGMENT_DPL)) != 
   28.32           (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|_SEGMENT_G|_SEGMENT_DPL) )
   28.33      {
   28.34 -        DPRINTK(XENLOG_DEBUG "Bad segment %08lx:%08lx\n", a, b);
   28.35 +        dprintk(XENLOG_DEBUG, "Bad segment %08lx:%08lx\n", a, b);
   28.36          goto fail;
   28.37      }
   28.38  
   28.39 @@ -240,7 +240,7 @@ int fixup_seg(u16 seg, unsigned long off
   28.40          }
   28.41      }
   28.42  
   28.43 -    DPRINTK(XENLOG_DEBUG "None of the above! "
   28.44 +    dprintk(XENLOG_DEBUG, "None of the above! "
   28.45              "(%08lx:%08lx, %08lx, %08lx, %08lx)\n",
   28.46              a, b, base, limit, base+limit);
   28.47  
   28.48 @@ -279,13 +279,13 @@ int gpf_emulate_4gb(struct cpu_user_regs
   28.49      /* WARNING: We only work for ring-3 segments. */
   28.50      if ( unlikely(vm86_mode(regs)) || unlikely(!ring_3(regs)) )
   28.51      {
   28.52 -        DPRINTK(XENLOG_DEBUG "Taken fault at bad CS %04x\n", regs->cs);
   28.53 +        dprintk(XENLOG_DEBUG, "Taken fault at bad CS %04x\n", regs->cs);
   28.54          goto fail;
   28.55      }
   28.56  
   28.57      if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
   28.58      {
   28.59 -        DPRINTK(XENLOG_DEBUG "Cannot linearise %04x:%08x\n",
   28.60 +        dprintk(XENLOG_DEBUG, "Cannot linearise %04x:%08x\n",
   28.61                  regs->cs, regs->eip);
   28.62          goto fail;
   28.63      }
   28.64 @@ -295,7 +295,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
   28.65      {
   28.66          if ( get_user(b, pb) )
   28.67          {
   28.68 -            DPRINTK(XENLOG_DEBUG
   28.69 +            dprintk(XENLOG_DEBUG,
   28.70                      "Fault while accessing byte %d of instruction\n",
   28.71                      pb-eip);
   28.72              goto page_fault;
   28.73 @@ -303,7 +303,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
   28.74  
   28.75          if ( (pb - eip) >= 15 )
   28.76          {
   28.77 -            DPRINTK(XENLOG_DEBUG "Too many instruction prefixes for a "
   28.78 +            dprintk(XENLOG_DEBUG, "Too many instruction prefixes for a "
   28.79                      "legal instruction\n");
   28.80              goto fail;
   28.81          }
   28.82 @@ -316,7 +316,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
   28.83          case 0x26: /* ES override */
   28.84          case 0x64: /* FS override */
   28.85          case 0x36: /* SS override */
   28.86 -            DPRINTK(XENLOG_DEBUG "Unhandled prefix %02x\n", b);
   28.87 +            dprintk(XENLOG_DEBUG, "Unhandled prefix %02x\n", b);
   28.88              goto fail;
   28.89          case 0x66: /* Operand-size override */
   28.90          case 0xf0: /* LOCK */
   28.91 @@ -334,7 +334,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
   28.92  
   28.93      if ( !gs_override )
   28.94      {
   28.95 -        DPRINTK(XENLOG_DEBUG "Only instructions with GS override\n");
   28.96 +        dprintk(XENLOG_DEBUG, "Only instructions with GS override\n");
   28.97          goto fail;
   28.98      }
   28.99  
  28.100 @@ -342,7 +342,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.101      pb++;
  28.102      if ( decode == 0 )
  28.103      {
  28.104 -        DPRINTK(XENLOG_DEBUG "Unsupported opcode %02x\n", b);
  28.105 +        dprintk(XENLOG_DEBUG, "Unsupported opcode %02x\n", b);
  28.106          goto fail;
  28.107      }
  28.108      
  28.109 @@ -354,7 +354,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.110  
  28.111          if ( get_user(offset, (u32 *)pb) )
  28.112          {
  28.113 -            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp32>.\n");
  28.114 +            dprintk(XENLOG_DEBUG, "Fault while extracting <disp32>.\n");
  28.115              goto page_fault;
  28.116          }
  28.117          pb += 4;
  28.118 @@ -368,7 +368,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.119  
  28.120      if ( get_user(modrm, pb) )
  28.121      {
  28.122 -        DPRINTK(XENLOG_DEBUG "Fault while extracting modrm byte\n");
  28.123 +        dprintk(XENLOG_DEBUG, "Fault while extracting modrm byte\n");
  28.124          goto page_fault;
  28.125      }
  28.126  
  28.127 @@ -380,7 +380,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.128  
  28.129      if ( rm == 4 )
  28.130      {
  28.131 -        DPRINTK(XENLOG_DEBUG "FIXME: Add decoding for the SIB byte.\n");
  28.132 +        dprintk(XENLOG_DEBUG, "FIXME: Add decoding for the SIB byte.\n");
  28.133          goto fixme;
  28.134      }
  28.135  
  28.136 @@ -398,7 +398,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.137              memreg = NULL;
  28.138              if ( get_user(disp32, (u32 *)pb) )
  28.139              {
  28.140 -                DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  28.141 +                dprintk(XENLOG_DEBUG, "Fault while extracting <disp8>.\n");
  28.142                  goto page_fault;
  28.143              }
  28.144              pb += 4;
  28.145 @@ -408,7 +408,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.146      case 1:
  28.147          if ( get_user(disp8, pb) )
  28.148          {
  28.149 -            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  28.150 +            dprintk(XENLOG_DEBUG, "Fault while extracting <disp8>.\n");
  28.151              goto page_fault;
  28.152          }
  28.153          pb++;
  28.154 @@ -418,14 +418,14 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.155      case 2:
  28.156          if ( get_user(disp32, (u32 *)pb) )
  28.157          {
  28.158 -            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  28.159 +            dprintk(XENLOG_DEBUG, "Fault while extracting <disp8>.\n");
  28.160              goto page_fault;
  28.161          }
  28.162          pb += 4;
  28.163          break;
  28.164  
  28.165      case 3:
  28.166 -        DPRINTK(XENLOG_DEBUG "Not a memory operand!\n");
  28.167 +        dprintk(XENLOG_DEBUG, "Not a memory operand!\n");
  28.168          goto fail;
  28.169      }
  28.170  
  28.171 @@ -456,7 +456,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  28.172      return EXCRET_fault_fixed;
  28.173  
  28.174   fixme:
  28.175 -    DPRINTK(XENLOG_DEBUG "Undecodable instruction "
  28.176 +    dprintk(XENLOG_DEBUG, "Undecodable instruction "
  28.177              "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
  28.178              "caused GPF(0) at %04x:%08x\n",
  28.179              eip[0], eip[1], eip[2], eip[3],
    29.1 --- a/xen/arch/x86/x86_64/traps.c	Fri Oct 27 19:15:48 2006 +0100
    29.2 +++ b/xen/arch/x86/x86_64/traps.c	Fri Oct 27 23:47:30 2006 +0100
    29.3 @@ -206,7 +206,7 @@ unsigned long do_iret(void)
    29.4      if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp,
    29.5                                   sizeof(iret_saved))) )
    29.6      {
    29.7 -        DPRINTK(XENLOG_G_ERR "Fault while reading IRET context from "
    29.8 +        gdprintk(XENLOG_ERR, "Fault while reading IRET context from "
    29.9                  "guest stack\n");
   29.10          domain_crash_synchronous();
   29.11      }
   29.12 @@ -216,7 +216,7 @@ unsigned long do_iret(void)
   29.13      {
   29.14          if ( unlikely(pagetable_is_null(v->arch.guest_table_user)) )
   29.15          {
   29.16 -            DPRINTK(XENLOG_G_ERR "Guest switching to user mode with no "
   29.17 +            gdprintk(XENLOG_ERR, "Guest switching to user mode with no "
   29.18                      "user page tables\n");
   29.19              domain_crash_synchronous();
   29.20          }
    30.1 --- a/xen/arch/x86/x86_emulate.c	Fri Oct 27 19:15:48 2006 +0100
    30.2 +++ b/xen/arch/x86/x86_emulate.c	Fri Oct 27 23:47:30 2006 +0100
    30.3 @@ -10,14 +10,14 @@
    30.4  #include <stdio.h>
    30.5  #include <stdint.h>
    30.6  #include <public/xen.h>
    30.7 -#define DPRINTF(_f, _a...) printf( _f , ## _a )
    30.8 +#define dprintf(_f, _a...) printf( _f , ## _a )
    30.9  #else
   30.10  #include <xen/config.h>
   30.11  #include <xen/types.h>
   30.12  #include <xen/lib.h>
   30.13  #include <xen/mm.h>
   30.14  #include <asm/regs.h>
   30.15 -#define DPRINTF DPRINTK
   30.16 +#define dprintf(_f, _a...) gdprintk(XENLOG_WARNING, _f , ## _a )
   30.17  #endif
   30.18  #include <asm-x86/x86_emulate.h>
   30.19  
   30.20 @@ -560,7 +560,7 @@ x86_emulate_memop(
   30.21  
   30.22          if ( modrm_mod == 3 )
   30.23          {
   30.24 -            DPRINTF("Cannot parse ModRM.mod == 3.\n");
   30.25 +            dprintf("Cannot parse ModRM.mod == 3.\n");
   30.26              goto cannot_emulate;
   30.27          }
   30.28  
   30.29 @@ -970,7 +970,7 @@ x86_emulate_memop(
   30.30              _regs.edi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
   30.31          break;
   30.32      case 0xa6 ... 0xa7: /* cmps */
   30.33 -        DPRINTF("Urk! I don't handle CMPS.\n");
   30.34 +        dprintf("Urk! I don't handle CMPS.\n");
   30.35          goto cannot_emulate;
   30.36      case 0xaa ... 0xab: /* stos */
   30.37          dst.type  = OP_MEM;
   30.38 @@ -990,7 +990,7 @@ x86_emulate_memop(
   30.39              _regs.esi, (_regs.eflags & EFLG_DF) ? -dst.bytes : dst.bytes);
   30.40          break;
   30.41      case 0xae ... 0xaf: /* scas */
   30.42 -        DPRINTF("Urk! I don't handle SCAS.\n");
   30.43 +        dprintf("Urk! I don't handle SCAS.\n");
   30.44          goto cannot_emulate;
   30.45      }
   30.46      goto writeback;
   30.47 @@ -1149,7 +1149,7 @@ x86_emulate_memop(
   30.48      goto writeback;
   30.49  
   30.50   cannot_emulate:
   30.51 -    DPRINTF("Cannot emulate %02x\n", b);
   30.52 +    dprintf("Cannot emulate %02x\n", b);
   30.53      return -1;
   30.54  }
   30.55  
    31.1 --- a/xen/common/domain.c	Fri Oct 27 19:15:48 2006 +0100
    31.2 +++ b/xen/common/domain.c	Fri Oct 27 23:47:30 2006 +0100
    31.3 @@ -35,6 +35,11 @@ struct domain *dom0;
    31.4  
    31.5  struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
    31.6  
    31.7 +int current_domain_id(void)
    31.8 +{
    31.9 +    return current->domain->domain_id;
   31.10 +}
   31.11 +
   31.12  struct domain *alloc_domain(domid_t domid)
   31.13  {
   31.14      struct domain *d;
   31.15 @@ -54,7 +59,6 @@ struct domain *alloc_domain(domid_t domi
   31.16      return d;
   31.17  }
   31.18  
   31.19 -
   31.20  void free_domain(struct domain *d)
   31.21  {
   31.22      struct vcpu *v;
   31.23 @@ -69,7 +73,6 @@ void free_domain(struct domain *d)
   31.24      xfree(d);
   31.25  }
   31.26  
   31.27 -
   31.28  struct vcpu *alloc_vcpu(
   31.29      struct domain *d, unsigned int vcpu_id, unsigned int cpu_id)
   31.30  {
    32.1 --- a/xen/common/event_channel.c	Fri Oct 27 19:15:48 2006 +0100
    32.2 +++ b/xen/common/event_channel.c	Fri Oct 27 23:47:30 2006 +0100
    32.3 @@ -40,7 +40,7 @@
    32.4  
    32.5  #define ERROR_EXIT(_errno)                                          \
    32.6      do {                                                            \
    32.7 -        DPRINTK(XENLOG_G_WARNING                                    \
    32.8 +        gdprintk(XENLOG_WARNING,                                    \
    32.9                  "EVTCHNOP failure: domain %d, error %d, line %d\n", \
   32.10                  current->domain->domain_id, (_errno), __LINE__);    \
   32.11          rc = (_errno);                                              \
    33.1 --- a/xen/common/grant_table.c	Fri Oct 27 19:15:48 2006 +0100
    33.2 +++ b/xen/common/grant_table.c	Fri Oct 27 23:47:30 2006 +0100
    33.3 @@ -47,7 +47,7 @@ union grant_combo {
    33.4  
    33.5  #define PIN_FAIL(_lbl, _rc, _f, _a...)          \
    33.6      do {                                        \
    33.7 -        DPRINTK( XENLOG_G_WARNING _f, ## _a );  \
    33.8 +        gdprintk(XENLOG_WARNING, _f, ## _a );   \
    33.9          rc = (_rc);                             \
   33.10          goto _lbl;                              \
   33.11      } while ( 0 )
   33.12 @@ -109,7 +109,7 @@ static void
   33.13      if ( unlikely(op->ref >= NR_GRANT_ENTRIES) ||
   33.14           unlikely((op->flags & (GNTMAP_device_map|GNTMAP_host_map)) == 0) )
   33.15      {
   33.16 -        DPRINTK(XENLOG_G_INFO "Bad ref (%d) or flags (%x).\n",
   33.17 +        gdprintk(XENLOG_INFO, "Bad ref (%d) or flags (%x).\n",
   33.18                  op->ref, op->flags);
   33.19          op->status = GNTST_bad_gntref;
   33.20          return;
   33.21 @@ -125,7 +125,7 @@ static void
   33.22      {
   33.23          if ( rd != NULL )
   33.24              put_domain(rd);
   33.25 -        DPRINTK(XENLOG_G_INFO "Could not find domain %d\n", op->dom);
   33.26 +        gdprintk(XENLOG_INFO, "Could not find domain %d\n", op->dom);
   33.27          op->status = GNTST_bad_domain;
   33.28          return;
   33.29      }
   33.30 @@ -140,7 +140,7 @@ static void
   33.31          if ( (lgt->maptrack_limit << 1) > MAPTRACK_MAX_ENTRIES )
   33.32          {
   33.33              put_domain(rd);
   33.34 -            DPRINTK(XENLOG_G_INFO "Maptrack table is at maximum size.\n");
   33.35 +            gdprintk(XENLOG_INFO, "Maptrack table is at maximum size.\n");
   33.36              op->status = GNTST_no_device_space;
   33.37              return;
   33.38          }
   33.39 @@ -150,7 +150,7 @@ static void
   33.40          if ( new_mt == NULL )
   33.41          {
   33.42              put_domain(rd);
   33.43 -            DPRINTK(XENLOG_G_INFO "No more map handles available.\n");
   33.44 +            gdprintk(XENLOG_INFO, "No more map handles available.\n");
   33.45              op->status = GNTST_no_device_space;
   33.46              return;
   33.47          }
   33.48 @@ -167,7 +167,7 @@ static void
   33.49          lgt->maptrack_order   += 1;
   33.50          lgt->maptrack_limit  <<= 1;
   33.51  
   33.52 -        DPRINTK(XENLOG_G_INFO "Doubled maptrack size\n");
   33.53 +        gdprintk(XENLOG_INFO, "Doubled maptrack size\n");
   33.54          handle = get_maptrack_handle(ld->grant_table);
   33.55      }
   33.56  
   33.57 @@ -354,7 +354,7 @@ static void
   33.58      if ( unlikely(op->handle >= ld->grant_table->maptrack_limit) ||
   33.59           unlikely(!map->flags) )
   33.60      {
   33.61 -        DPRINTK(XENLOG_G_INFO "Bad handle (%d).\n", op->handle);
   33.62 +        gdprintk(XENLOG_INFO, "Bad handle (%d).\n", op->handle);
   33.63          op->status = GNTST_bad_handle;
   33.64          return;
   33.65      }
   33.66 @@ -367,7 +367,7 @@ static void
   33.67      {
   33.68          if ( rd != NULL )
   33.69              put_domain(rd);
   33.70 -        DPRINTK(XENLOG_G_INFO "Could not find domain %d\n", dom);
   33.71 +        gdprintk(XENLOG_INFO, "Could not find domain %d\n", dom);
   33.72          op->status = GNTST_bad_domain;
   33.73          return;
   33.74      }
   33.75 @@ -487,13 +487,13 @@ gnttab_setup_table(
   33.76  
   33.77      if ( unlikely(copy_from_guest(&op, uop, 1) != 0) )
   33.78      {
   33.79 -        DPRINTK(XENLOG_G_INFO "Fault while reading gnttab_setup_table_t.\n");
   33.80 +        gdprintk(XENLOG_INFO, "Fault while reading gnttab_setup_table_t.\n");
   33.81          return -EFAULT;
   33.82      }
   33.83  
   33.84      if ( unlikely(op.nr_frames > NR_GRANT_FRAMES) )
   33.85      {
   33.86 -        DPRINTK(XENLOG_G_INFO "Xen only supports up to %d grant-table frames"
   33.87 +        gdprintk(XENLOG_INFO, "Xen only supports up to %d grant-table frames"
   33.88                  " per domain.\n",
   33.89                  NR_GRANT_FRAMES);
   33.90          op.status = GNTST_general_error;
   33.91 @@ -513,7 +513,7 @@ gnttab_setup_table(
   33.92  
   33.93      if ( unlikely((d = find_domain_by_id(dom)) == NULL) )
   33.94      {
   33.95 -        DPRINTK(XENLOG_G_INFO "Bad domid %d.\n", dom);
   33.96 +        gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
   33.97          op.status = GNTST_bad_domain;
   33.98          goto out;
   33.99      }
  33.100 @@ -551,7 +551,7 @@ gnttab_prepare_for_transfer(
  33.101      if ( unlikely((rgt = rd->grant_table) == NULL) ||
  33.102           unlikely(ref >= NR_GRANT_ENTRIES) )
  33.103      {
  33.104 -        DPRINTK(XENLOG_G_INFO "Dom %d has no g.t., or ref is bad (%d).\n",
  33.105 +        gdprintk(XENLOG_INFO, "Dom %d has no g.t., or ref is bad (%d).\n",
  33.106                  rd->domain_id, ref);
  33.107          return 0;
  33.108      }
  33.109 @@ -567,7 +567,7 @@ gnttab_prepare_for_transfer(
  33.110          if ( unlikely(scombo.shorts.flags != GTF_accept_transfer) ||
  33.111               unlikely(scombo.shorts.domid != ld->domain_id) )
  33.112          {
  33.113 -            DPRINTK(XENLOG_G_INFO "Bad flags (%x) or dom (%d). "
  33.114 +            gdprintk(XENLOG_INFO, "Bad flags (%x) or dom (%d). "
  33.115                      "(NB. expected dom %d)\n",
  33.116                      scombo.shorts.flags, scombo.shorts.domid,
  33.117                      ld->domain_id);
  33.118 @@ -584,7 +584,7 @@ gnttab_prepare_for_transfer(
  33.119  
  33.120          if ( retries++ == 4 )
  33.121          {
  33.122 -            DPRINTK(XENLOG_G_WARNING "Shared grant entry is unstable.\n");
  33.123 +            gdprintk(XENLOG_WARNING, "Shared grant entry is unstable.\n");
  33.124              goto fail;
  33.125          }
  33.126  
  33.127 @@ -616,7 +616,7 @@ gnttab_transfer(
  33.128          /* Read from caller address space. */
  33.129          if ( unlikely(__copy_from_guest_offset(&gop, uop, i, 1)) )
  33.130          {
  33.131 -            DPRINTK(XENLOG_G_INFO "gnttab_transfer: error reading req %d/%d\n",
  33.132 +            gdprintk(XENLOG_INFO, "gnttab_transfer: error reading req %d/%d\n",
  33.133                      i, count);
  33.134              return -EFAULT;
  33.135          }
  33.136 @@ -626,7 +626,7 @@ gnttab_transfer(
  33.137          /* Check the passed page frame for basic validity. */
  33.138          if ( unlikely(!mfn_valid(mfn)) )
  33.139          { 
  33.140 -            DPRINTK(XENLOG_G_INFO "gnttab_transfer: out-of-range %lx\n",
  33.141 +            gdprintk(XENLOG_INFO, "gnttab_transfer: out-of-range %lx\n",
  33.142                      (unsigned long)gop.mfn);
  33.143              gop.status = GNTST_bad_page;
  33.144              goto copyback;
  33.145 @@ -635,7 +635,7 @@ gnttab_transfer(
  33.146          page = mfn_to_page(mfn);
  33.147          if ( unlikely(IS_XEN_HEAP_FRAME(page)) )
  33.148          { 
  33.149 -            DPRINTK(XENLOG_G_INFO "gnttab_transfer: xen frame %lx\n",
  33.150 +            gdprintk(XENLOG_INFO, "gnttab_transfer: xen frame %lx\n",
  33.151                      (unsigned long)gop.mfn);
  33.152              gop.status = GNTST_bad_page;
  33.153              goto copyback;
  33.154 @@ -650,7 +650,7 @@ gnttab_transfer(
  33.155          /* Find the target domain. */
  33.156          if ( unlikely((e = find_domain_by_id(gop.domid)) == NULL) )
  33.157          {
  33.158 -            DPRINTK(XENLOG_G_INFO "gnttab_transfer: can't find domain %d\n",
  33.159 +            gdprintk(XENLOG_INFO, "gnttab_transfer: can't find domain %d\n",
  33.160                      gop.domid);
  33.161              page->count_info &= ~(PGC_count_mask|PGC_allocated);
  33.162              free_domheap_page(page);
  33.163 @@ -670,7 +670,7 @@ gnttab_transfer(
  33.164               unlikely(!gnttab_prepare_for_transfer(e, d, gop.ref)) )
  33.165          {
  33.166              if ( !test_bit(_DOMF_dying, &e->domain_flags) )
  33.167 -                DPRINTK(XENLOG_G_INFO "gnttab_transfer: "
  33.168 +                gdprintk(XENLOG_INFO, "gnttab_transfer: "
  33.169                          "Transferee has no reservation "
  33.170                          "headroom (%d,%d) or provided a bad grant ref (%08x) "
  33.171                          "or is dying (%lx)\n",
  33.172 @@ -707,7 +707,7 @@ gnttab_transfer(
  33.173      copyback:
  33.174          if ( unlikely(__copy_to_guest_offset(uop, i, &gop, 1)) )
  33.175          {
  33.176 -            DPRINTK(XENLOG_G_INFO "gnttab_transfer: error writing resp %d/%d\n",
  33.177 +            gdprintk(XENLOG_INFO, "gnttab_transfer: error writing resp %d/%d\n",
  33.178                      i, count);
  33.179              return -EFAULT;
  33.180          }
  33.181 @@ -1097,7 +1097,7 @@ gnttab_release_mappings(
  33.182  
  33.183          ref = map->ref;
  33.184  
  33.185 -        DPRINTK(XENLOG_G_INFO "Grant release (%hu) ref:(%hu) "
  33.186 +        gdprintk(XENLOG_INFO, "Grant release (%hu) ref:(%hu) "
  33.187                  "flags:(%x) dom:(%hu)\n",
  33.188                  handle, ref, map->flags, map->domid);
  33.189  
    34.1 --- a/xen/common/memory.c	Fri Oct 27 19:15:48 2006 +0100
    34.2 +++ b/xen/common/memory.c	Fri Oct 27 23:47:30 2006 +0100
    34.3 @@ -63,7 +63,7 @@ increase_reservation(
    34.4          if ( unlikely((page = __alloc_domheap_pages( d, cpu, 
    34.5              extent_order, memflags )) == NULL) ) 
    34.6          {
    34.7 -            DPRINTK(XENLOG_G_INFO "Could not allocate order=%d extent: "
    34.8 +            gdprintk(XENLOG_INFO, "Could not allocate order=%d extent: "
    34.9                      "id=%d memflags=%x (%ld of %d)\n",
   34.10                      extent_order, d->domain_id, memflags, i, nr_extents);
   34.11              return i;
   34.12 @@ -118,7 +118,7 @@ populate_physmap(
   34.13          if ( unlikely((page = __alloc_domheap_pages( d, cpu, 
   34.14              extent_order, memflags )) == NULL) ) 
   34.15          {
   34.16 -            DPRINTK(XENLOG_G_INFO "Could not allocate order=%d extent: "
   34.17 +            gdprintk(XENLOG_INFO, "Could not allocate order=%d extent: "
   34.18                      "id=%d memflags=%x (%ld of %d)\n",
   34.19                      extent_order, d->domain_id, memflags, i, nr_extents);
   34.20              goto out;
   34.21 @@ -157,7 +157,7 @@ guest_remove_page(
   34.22      mfn = gmfn_to_mfn(d, gmfn);
   34.23      if ( unlikely(!mfn_valid(mfn)) )
   34.24      {
   34.25 -        DPRINTK(XENLOG_G_INFO "Domain %u page number %lx invalid\n",
   34.26 +        gdprintk(XENLOG_INFO, "Domain %u page number %lx invalid\n",
   34.27                  d->domain_id, gmfn);
   34.28          return 0;
   34.29      }
   34.30 @@ -165,7 +165,7 @@ guest_remove_page(
   34.31      page = mfn_to_page(mfn);
   34.32      if ( unlikely(!get_page(page, d)) )
   34.33      {
   34.34 -        DPRINTK(XENLOG_G_INFO "Bad page free for domain %u\n", d->domain_id);
   34.35 +        gdprintk(XENLOG_INFO, "Bad page free for domain %u\n", d->domain_id);
   34.36          return 0;
   34.37      }
   34.38  
   34.39 @@ -178,7 +178,7 @@ guest_remove_page(
   34.40      if ( unlikely(!page_is_removable(page)) )
   34.41      {
   34.42          /* We'll make this a guest-visible error in future, so take heed! */
   34.43 -        DPRINTK(XENLOG_G_INFO "Dom%d freeing in-use page %lx (pseudophys %lx):"
   34.44 +        gdprintk(XENLOG_INFO, "Dom%d freeing in-use page %lx (pseudophys %lx):"
   34.45                  " count=%lx type=%lx\n",
   34.46                  d->domain_id, mfn, get_gpfn_from_mfn(mfn),
   34.47                  (unsigned long)page->count_info, page->u.inuse.type_info);
    35.1 --- a/xen/common/multicall.c	Fri Oct 27 19:15:48 2006 +0100
    35.2 +++ b/xen/common/multicall.c	Fri Oct 27 23:47:30 2006 +0100
    35.3 @@ -24,7 +24,7 @@ do_multicall(
    35.4  
    35.5      if ( unlikely(__test_and_set_bit(_MCSF_in_multicall, &mcs->flags)) )
    35.6      {
    35.7 -        DPRINTK(XENLOG_G_INFO "Multicall reentry is disallowed.\n");
    35.8 +        gdprintk(XENLOG_INFO, "Multicall reentry is disallowed.\n");
    35.9          return -EINVAL;
   35.10      }
   35.11  
    36.1 --- a/xen/common/page_alloc.c	Fri Oct 27 19:15:48 2006 +0100
    36.2 +++ b/xen/common/page_alloc.c	Fri Oct 27 23:47:30 2006 +0100
    36.3 @@ -599,7 +599,7 @@ int assign_pages(
    36.4  
    36.5      if ( unlikely(test_bit(_DOMF_dying, &d->domain_flags)) )
    36.6      {
    36.7 -        DPRINTK(XENLOG_G_INFO "Cannot assign page to domain%d -- dying.\n",
    36.8 +        gdprintk(XENLOG_INFO, "Cannot assign page to domain%d -- dying.\n",
    36.9                  d->domain_id);
   36.10          goto fail;
   36.11      }
   36.12 @@ -608,7 +608,7 @@ int assign_pages(
   36.13      {
   36.14          if ( unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
   36.15          {
   36.16 -            DPRINTK(XENLOG_G_INFO "Over-allocation for domain %u: %u > %u\n",
   36.17 +            gdprintk(XENLOG_INFO, "Over-allocation for domain %u: %u > %u\n",
   36.18                      d->domain_id, d->tot_pages + (1 << order), d->max_pages);
   36.19              goto fail;
   36.20          }
    37.1 --- a/xen/common/schedule.c	Fri Oct 27 19:15:48 2006 +0100
    37.2 +++ b/xen/common/schedule.c	Fri Oct 27 23:47:30 2006 +0100
    37.3 @@ -468,7 +468,7 @@ long do_set_timer_op(s_time_t timeout)
    37.4           * timeout in this case can burn a lot of CPU. We therefore go for a
    37.5           * reasonable middleground of triggering a timer event in 100ms.
    37.6           */
    37.7 -        DPRINTK(XENLOG_G_INFO "Warning: huge timeout set by domain %d (vcpu %d):"
    37.8 +        gdprintk(XENLOG_INFO, "Warning: huge timeout set by domain %d (vcpu %d):"
    37.9                  " %"PRIx64"\n",
   37.10                  v->domain->domain_id, v->vcpu_id, (uint64_t)timeout);
   37.11          set_timer(&v->timer, NOW() + MILLISECS(100));
    38.1 --- a/xen/common/trace.c	Fri Oct 27 19:15:48 2006 +0100
    38.2 +++ b/xen/common/trace.c	Fri Oct 27 23:47:30 2006 +0100
    38.3 @@ -131,7 +131,7 @@ static int tb_set_size(int size)
    38.4       */
    38.5      if ( (opt_tbuf_size != 0) || (size <= 0) )
    38.6      {
    38.7 -        DPRINTK(XENLOG_G_INFO "tb_set_size from %d to %d not implemented\n",
    38.8 +        gdprintk(XENLOG_INFO, "tb_set_size from %d to %d not implemented\n",
    38.9                  opt_tbuf_size, size);
   38.10          return -EINVAL;
   38.11      }
    39.1 --- a/xen/drivers/char/console.c	Fri Oct 27 19:15:48 2006 +0100
    39.2 +++ b/xen/drivers/char/console.c	Fri Oct 27 23:47:30 2006 +0100
    39.3 @@ -58,6 +58,30 @@ static int sercon_handle = -1;
    39.4  
    39.5  static DEFINE_SPINLOCK(console_lock);
    39.6  
    39.7 +/*
    39.8 + * To control the amount of printing, thresholds are added.
    39.9 + * These thresholds correspond to the XENLOG logging levels.
   39.10 + * There's an upper and lower threshold for non-guest messages and for
   39.11 + * guest-provoked messages.  This works as follows, for a given log level L:
   39.12 + *
   39.13 + * L < lower_threshold                     : always logged
   39.14 + * lower_threshold <= L < upper_threshold  : rate-limited logging
   39.15 + * upper_threshold <= L                    : never logged
   39.16 + *
   39.17 + * Note, in the above algorithm, to disable rate limiting simply make
   39.18 + * the lower threshold equal to the upper.
   39.19 + */
   39.20 +#define XENLOG_UPPER_THRESHOLD       2 /* Do not print INFO and DEBUG  */
   39.21 +#define XENLOG_LOWER_THRESHOLD       2 /* Always print ERR and WARNING */
   39.22 +#define XENLOG_GUEST_UPPER_THRESHOLD 2 /* Do not print INFO and DEBUG  */
   39.23 +#define XENLOG_GUEST_LOWER_THRESHOLD 0 /* Rate-limit ERR and WARNING   */
   39.24 +/*
   39.25 + * The XENLOG_DEFAULT is the default given to printks that
   39.26 + * do not have any print level associated with them.
   39.27 + */
   39.28 +#define XENLOG_DEFAULT       1 /* XENLOG_WARNING */
   39.29 +#define XENLOG_GUEST_DEFAULT 1 /* XENLOG_WARNING */
   39.30 +
   39.31  int xenlog_upper_thresh = XENLOG_UPPER_THRESHOLD;
   39.32  int xenlog_lower_thresh = XENLOG_LOWER_THRESHOLD;
   39.33  int xenlog_guest_upper_thresh = XENLOG_GUEST_UPPER_THRESHOLD;
   39.34 @@ -346,7 +370,7 @@ void printk(const char *fmt, ...)
   39.35  
   39.36      if ( !print_regardless )
   39.37      {
   39.38 -        if ( level > upper_thresh )
   39.39 +        if ( level >= upper_thresh )
   39.40              goto out;
   39.41          if ( (level >= lower_thresh) && (!printk_ratelimit()) )
   39.42              goto out;
    40.1 --- a/xen/include/asm-ia64/mm.h	Fri Oct 27 19:15:48 2006 +0100
    40.2 +++ b/xen/include/asm-ia64/mm.h	Fri Oct 27 23:47:30 2006 +0100
    40.3 @@ -175,7 +175,7 @@ static inline int get_page(struct page_i
    40.4  	    unlikely((nx & PGC_count_mask) == 0) ||	/* Count overflow? */
    40.5  	    unlikely((x >> 32) != _domain)) {		/* Wrong owner? */
    40.6  
    40.7 -	    DPRINTK(XENLOG_G_INFO "Error pfn %lx: rd=%p, od=%p, caf=%016lx, taf=%"
    40.8 +	    gdprintk(XENLOG_INFO, "Error pfn %lx: rd=%p, od=%p, caf=%016lx, taf=%"
    40.9  		PRtype_info "\n", page_to_mfn(page), domain,
   40.10  		unpickle_domptr(x >> 32), x, page->u.inuse.type_info);
   40.11  	    return 0;
    41.1 --- a/xen/include/asm-x86/mm.h	Fri Oct 27 19:15:48 2006 +0100
    41.2 +++ b/xen/include/asm-x86/mm.h	Fri Oct 27 23:47:30 2006 +0100
    41.3 @@ -213,7 +213,7 @@ static inline int get_page(struct page_i
    41.4               unlikely(d != _domain) )                /* Wrong owner? */
    41.5          {
    41.6              if ( !_shadow_mode_refcounts(domain) )
    41.7 -                DPRINTK(XENLOG_G_INFO
    41.8 +                gdprintk(XENLOG_INFO,
    41.9                          "Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%"
   41.10                          PRtype_info "\n",
   41.11                          page_to_mfn(page), domain, unpickle_domptr(d),
    42.1 --- a/xen/include/xen/config.h	Fri Oct 27 19:15:48 2006 +0100
    42.2 +++ b/xen/include/xen/config.h	Fri Oct 27 23:47:30 2006 +0100
    42.3 @@ -29,7 +29,7 @@
    42.4   * it to allow for DoS by causing the HV to print out a lot of
    42.5   * info, so where ever the guest has control of what is printed
    42.6   * we use the XENLOG_GUEST to distinguish that the output is
    42.7 - * controled by the Guest.
    42.8 + * controlled by the guest.
    42.9   *
   42.10   * To make it easier on the typing, the above log levels all
   42.11   * have a corresponding _G_ equivalent that appends the
   42.12 @@ -51,65 +51,8 @@
   42.13  #define XENLOG_MAX 3
   42.14  
   42.15  /*
   42.16 - * To control the amount of printing, thresholds are added.
   42.17 - * These thresholds correspond to the above log levels.
   42.18 - * There's an upper and lower threshold for non-guests
   42.19 - * and Guest.  This works as follows:
   42.20 - *
   42.21 - * If printk log level > upper threshold
   42.22 - *   don't print anything
   42.23 - *
   42.24 - * If printk log level >= lower threshold
   42.25 - *   rate limit the print (keep the amount down)
   42.26 - *
   42.27 - * Otherwise, just print.
   42.28 - *
   42.29 - * Note, in the above algorithm, to never rate limit
   42.30 - * simply make the lower threshold greater than the upper.
   42.31 - * This way the output will never be rate limited.
   42.32 - *
   42.33 - * For example:
   42.34 - *   lower = 2; upper = 1;
   42.35 - *  This will always print ERR and WARNING messages
   42.36 - *  but will not print anything else.  Nothing is
   42.37 - *  rate limited.
   42.38 - */
   42.39 -/*
   42.40 - * Defaults:
   42.41 - *   For the HV, always print ERR and WARNING
   42.42 - *   but nothing for INFO and DEBUG.
   42.43 - *
   42.44 - *   For Guests, always rate limit ERR and WARNING
   42.45 - *   but never print for INFO and DEBUG.
   42.46 - */
   42.47 -#ifndef XENLOG_UPPER_THRESHOLD
   42.48 -#define XENLOG_UPPER_THRESHOLD 1
   42.49 -#endif
   42.50 -#ifndef XENLOG_LOWER_THRESHOLD
   42.51 -#define XENLOG_LOWER_THRESHOLD 2
   42.52 -#endif
   42.53 -#ifndef XENLOG_GUEST_UPPER_THRESHOLD
   42.54 -#define XENLOG_GUEST_UPPER_THRESHOLD 1
   42.55 -#endif
   42.56 -#ifndef XENLOG_GUEST_LOWER_THRESHOLD
   42.57 -#define XENLOG_GUEST_LOWER_THRESHOLD 0
   42.58 -#endif
   42.59 -
   42.60 -/*
   42.61 - * The XENLOG_DEFAULT is the default given to printks that
   42.62 - * do not have any print level associated to it.
   42.63 - */
   42.64 -#ifndef XENLOG_DEFAULT
   42.65 -#define XENLOG_DEFAULT 1 /* Warning */
   42.66 -#endif
   42.67 -#ifndef XENLOG_GUEST_DEFAULT
   42.68 -#define XENLOG_GUEST_DEFAULT 1 /* Warning */
   42.69 -#endif
   42.70 -
   42.71 -/*
   42.72   * Some code is copied directly from Linux.
   42.73   * Match some of the Linux log levels to Xen.
   42.74 - *  (Should these be Guest logs?? - SDR)
   42.75   */
   42.76  #define KERN_ERR       XENLOG_ERR
   42.77  #define KERN_CRIT      XENLOG_ERR
   42.78 @@ -123,12 +66,18 @@
   42.79  #define __iomem
   42.80  #define __user
   42.81  
   42.82 -#define DPRINTK(_f, _a...) printk("(file=%s, line=%d) " _f, \
   42.83 -                           __FILE__ , __LINE__ , ## _a )
   42.84 +#ifndef __ASSEMBLY__
   42.85  
   42.86 -#ifndef __ASSEMBLY__
   42.87 +int current_domain_id(void);
   42.88 +#define dprintk(_l, _f, _a...)                              \
   42.89 +    printk(_l "%s:%d: " _f, __FILE__ , __LINE__ , ## _a )
   42.90 +#define gdprintk(_l, _f, _a...)                             \
   42.91 +    printk(XENLOG_GUEST _l "%s:%d:d%d " _f, __FILE__,       \
   42.92 +           __LINE__, current_domain_id() , ## _a )
   42.93 +
   42.94  #include <xen/compiler.h>
   42.95 -#endif
   42.96 +
   42.97 +#endif /* !__ASSEMBLY__ */
   42.98  
   42.99  #define __STR(...) #__VA_ARGS__
  42.100  #define STR(...) __STR(__VA_ARGS__)