ia64/xen-unstable

changeset 12033:5c8c5925c7e2

[XEN] Logging parameters for x86 code.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
author kaf24@localhost.localdomain
date Fri Oct 27 18:56:24 2006 +0100 (2006-10-27)
parents 64100a77fd17
children b07487d91f93
files xen/arch/x86/domain.c xen/arch/x86/extable.c xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/instrlen.c xen/arch/x86/hvm/svm/svm.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/include/asm-x86/mm.h
line diff
     1.1 --- a/xen/arch/x86/domain.c	Fri Oct 27 18:55:16 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Fri Oct 27 18:56:24 2006 +0100
     1.3 @@ -564,7 +564,8 @@ static void load_segments(struct vcpu *n
     1.4               put_user(regs->r11,           rsp-10) |
     1.5               put_user(regs->rcx,           rsp-11) )
     1.6          {
     1.7 -            DPRINTK("Error while creating failsafe callback frame.\n");
     1.8 +            DPRINTK(XENLOG_G_ERR "Error while creating failsafe "
     1.9 +                    "callback frame.\n");
    1.10              domain_crash(n->domain);
    1.11          }
    1.12  
     2.1 --- a/xen/arch/x86/extable.c	Fri Oct 27 18:55:16 2006 +0100
     2.2 +++ b/xen/arch/x86/extable.c	Fri Oct 27 18:56:24 2006 +0100
     2.3 @@ -74,7 +74,7 @@ search_pre_exception_table(struct cpu_us
     2.4      unsigned long addr = (unsigned long)regs->eip;
     2.5      unsigned long fixup = search_one_table(
     2.6          __start___pre_ex_table, __stop___pre_ex_table-1, addr);
     2.7 -    DPRINTK("Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
     2.8 +    DPRINTK(XENLOG_INFO "Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
     2.9  #ifdef PERF_COUNTERS
    2.10      if ( fixup )
    2.11          perfc_incrc(exception_fixed);
     3.1 --- a/xen/arch/x86/hvm/hvm.c	Fri Oct 27 18:55:16 2006 +0100
     3.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri Oct 27 18:56:24 2006 +0100
     3.3 @@ -194,7 +194,8 @@ void hvm_create_event_channels(struct vc
     3.4              p = get_vio(v->domain, o->vcpu_id);
     3.5              o->arch.hvm_vcpu.xen_port = p->vp_eport =
     3.6                  alloc_unbound_xen_event_channel(o, 0);
     3.7 -            DPRINTK("Allocated port %d for hvm.\n", o->arch.hvm_vcpu.xen_port);
     3.8 +            DPRINTK(XENLOG_INFO "Allocated port %d for hvm.\n",
     3.9 +                    o->arch.hvm_vcpu.xen_port);
    3.10          }
    3.11      }
    3.12  }
    3.13 @@ -355,7 +356,8 @@ static void hvm_vcpu_down(void)
    3.14      struct domain *d = v->domain;
    3.15      int online_count = 0;
    3.16  
    3.17 -    DPRINTK("DOM%d/VCPU%d: going offline.\n", d->domain_id, v->vcpu_id);
    3.18 +    DPRINTK(XENLOG_G_INFO "DOM%d/VCPU%d: going offline.\n",
    3.19 +           d->domain_id, v->vcpu_id);
    3.20  
    3.21      /* Doesn't halt us immediately, but we'll never return to guest context. */
    3.22      set_bit(_VCPUF_down, &v->vcpu_flags);
    3.23 @@ -371,7 +373,8 @@ static void hvm_vcpu_down(void)
    3.24      /* ... Shut down the domain if not. */
    3.25      if ( online_count == 0 )
    3.26      {
    3.27 -        DPRINTK("DOM%d: all CPUs offline -- powering off.\n", d->domain_id);
    3.28 +        DPRINTK(XENLOG_G_INFO "DOM%d: all CPUs offline -- powering off.\n",
    3.29 +                d->domain_id);
    3.30          domain_shutdown(d, SHUTDOWN_poweroff);
    3.31      }
    3.32  }
    3.33 @@ -511,7 +514,7 @@ void hvm_do_hypercall(struct cpu_user_re
    3.34  
    3.35      if ( (pregs->eax >= NR_hypercalls) || !hvm_hypercall_table[pregs->eax] )
    3.36      {
    3.37 -        DPRINTK("HVM vcpu %d:%d did a bad hypercall %d.\n",
    3.38 +        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %d.\n",
    3.39                  current->domain->domain_id, current->vcpu_id,
    3.40                  pregs->eax);
    3.41          pregs->eax = -ENOSYS;
    3.42 @@ -557,7 +560,7 @@ static long do_memory_op_compat32(int cm
    3.43      }
    3.44  
    3.45      default:
    3.46 -        DPRINTK("memory_op %d.\n", cmd);
    3.47 +        DPRINTK(XENLOG_G_INFO "memory_op %d.\n", cmd);
    3.48          rc = -ENOSYS;
    3.49          break;
    3.50      }
    3.51 @@ -590,7 +593,7 @@ void hvm_do_hypercall(struct cpu_user_re
    3.52      pregs->rax = (uint32_t)pregs->eax; /* mask in case compat32 caller */
    3.53      if ( (pregs->rax >= NR_hypercalls) || !hvm_hypercall64_table[pregs->rax] )
    3.54      {
    3.55 -        DPRINTK("HVM vcpu %d:%d did a bad hypercall %ld.\n",
    3.56 +        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %ld.\n",
    3.57                  current->domain->domain_id, current->vcpu_id,
    3.58                  pregs->rax);
    3.59          pregs->rax = -ENOSYS;
    3.60 @@ -641,7 +644,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
    3.61  
    3.62      if ( bsp->vcpu_id != 0 )
    3.63      {
    3.64 -        DPRINTK("Not calling hvm_bringup_ap from BSP context.\n");
    3.65 +        DPRINTK(XENLOG_G_ERR "Not calling hvm_bringup_ap from BSP context.\n");
    3.66          domain_crash_synchronous();
    3.67      }
    3.68  
    3.69 @@ -650,7 +653,8 @@ int hvm_bringup_ap(int vcpuid, int tramp
    3.70  
    3.71      if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
    3.72      {
    3.73 -        DPRINTK("Failed to allocate memory in hvm_bringup_ap.\n");
    3.74 +        DPRINTK(XENLOG_G_INFO
    3.75 +                "Failed to allocate memory in hvm_bringup_ap.\n");
    3.76          return -ENOMEM;
    3.77      }
    3.78  
    3.79 @@ -664,13 +668,14 @@ int hvm_bringup_ap(int vcpuid, int tramp
    3.80  
    3.81      if ( rc != 0 )
    3.82      {
    3.83 -        DPRINTK("AP %d bringup failed in boot_vcpu %x.\n", vcpuid, rc);
    3.84 +        DPRINTK(XENLOG_G_INFO
    3.85 +               "AP %d bringup failed in boot_vcpu %x.\n", vcpuid, rc);
    3.86          goto out;
    3.87      }
    3.88  
    3.89      if ( test_and_clear_bit(_VCPUF_down, &d->vcpu[vcpuid]->vcpu_flags) )
    3.90          vcpu_wake(d->vcpu[vcpuid]);
    3.91 -    DPRINTK("AP %d bringup suceeded.\n", vcpuid);
    3.92 +    DPRINTK(XENLOG_G_INFO "AP %d bringup suceeded.\n", vcpuid);
    3.93  
    3.94   out:
    3.95      xfree(ctxt);
    3.96 @@ -729,7 +734,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
    3.97  
    3.98      default:
    3.99      {
   3.100 -        DPRINTK("Bad HVM op %ld.\n", op);
   3.101 +        DPRINTK(XENLOG_G_INFO "Bad HVM op %ld.\n", op);
   3.102          rc = -ENOSYS;
   3.103          break;
   3.104      }
     4.1 --- a/xen/arch/x86/hvm/instrlen.c	Fri Oct 27 18:55:16 2006 +0100
     4.2 +++ b/xen/arch/x86/hvm/instrlen.c	Fri Oct 27 18:56:24 2006 +0100
     4.3 @@ -317,7 +317,7 @@ done_prefixes:
     4.4  
     4.5          if ( modrm_mod == 3 )
     4.6          {
     4.7 -            DPRINTK("Cannot parse ModRM.mod == 3.\n");
     4.8 +            DPRINTK(XENLOG_G_WARNING "Cannot parse ModRM.mod == 3.\n");
     4.9              goto cannot_emulate;
    4.10          }
    4.11  
    4.12 @@ -444,7 +444,8 @@ done:
    4.13      return length;
    4.14  
    4.15  cannot_emulate:
    4.16 -    DPRINTK("Cannot emulate %02x at address %lx (eip %lx, mode %d)\n",
    4.17 +    DPRINTK(XENLOG_G_WARNING
    4.18 +            "Cannot emulate %02x at address %lx (eip %lx, mode %d)\n",
    4.19              b, (unsigned long)_regs.eip, (unsigned long)regs->eip, mode);
    4.20      return -1;
    4.21  }
     5.1 --- a/xen/arch/x86/hvm/svm/svm.c	Fri Oct 27 18:55:16 2006 +0100
     5.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Fri Oct 27 18:56:24 2006 +0100
     5.3 @@ -805,7 +805,7 @@ static void svm_final_setup_guest(struct
     5.4  
     5.5      if ( !shadow_mode_external(d) )
     5.6      {
     5.7 -        DPRINTK("Can't init HVM for dom %u vcpu %u: "
     5.8 +        DPRINTK(XENLOG_G_ERR "Can't init HVM for dom %u vcpu %u: "
     5.9                  "not in shadow external mode\n", d->domain_id, v->vcpu_id);
    5.10          domain_crash(d);
    5.11      }
     6.1 --- a/xen/arch/x86/hvm/vmx/vmcs.c	Fri Oct 27 18:55:16 2006 +0100
     6.2 +++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Oct 27 18:56:24 2006 +0100
     6.3 @@ -145,7 +145,7 @@ static struct vmcs_struct *vmx_alloc_vmc
     6.4  
     6.5      if ( (vmcs = alloc_xenheap_page()) == NULL )
     6.6      {
     6.7 -        DPRINTK("Failed to allocate VMCS.\n");
     6.8 +        DPRINTK(XENLOG_G_WARNING "Failed to allocate VMCS.\n");
     6.9          return NULL;
    6.10      }
    6.11  
     7.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Oct 27 18:55:16 2006 +0100
     7.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Oct 27 18:56:24 2006 +0100
     7.3 @@ -71,7 +71,7 @@ static int vmx_initialize_guest_resource
     7.4  
     7.5      if ( !shadow_mode_external(d) )
     7.6      {
     7.7 -        DPRINTK("Can't init HVM for dom %u vcpu %u: "
     7.8 +        DPRINTK(XENLOG_ERR "Can't init HVM for dom %u vcpu %u: "
     7.9                  "not in shadow external mode\n", 
    7.10                  d->domain_id, v->vcpu_id);
    7.11          domain_crash(d);
    7.12 @@ -83,7 +83,8 @@ static int vmx_initialize_guest_resource
    7.13  
    7.14          if ( (rc = vmx_create_vmcs(vc)) != 0 )
    7.15          {
    7.16 -            DPRINTK("Failed to create VMCS for vcpu %d: err=%d.\n",
    7.17 +            DPRINTK(XENLOG_WARNING
    7.18 +                    "Failed to create VMCS for vcpu %d: err=%d.\n",
    7.19                      vc->vcpu_id, rc);
    7.20              return 0;
    7.21          }
    7.22 @@ -92,14 +93,16 @@ static int vmx_initialize_guest_resource
    7.23  
    7.24          if ( (io_bitmap_a = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
    7.25          {
    7.26 -            DPRINTK("Failed to allocate io bitmap b for vcpu %d.\n",
    7.27 +            DPRINTK(XENLOG_WARNING
    7.28 +                   "Failed to allocate io bitmap b for vcpu %d.\n",
    7.29                      vc->vcpu_id);
    7.30              return 0;
    7.31          }
    7.32  
    7.33          if ( (io_bitmap_b = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
    7.34          {
    7.35 -            DPRINTK("Failed to allocate io bitmap b for vcpu %d.\n",
    7.36 +            DPRINTK(XENLOG_WARNING
    7.37 +                    "Failed to allocate io bitmap b for vcpu %d.\n",
    7.38                      vc->vcpu_id);
    7.39              return 0;
    7.40          }
    7.41 @@ -937,7 +940,7 @@ static void vmx_do_cpuid(struct cpu_user
    7.42          unsigned long mfn = get_mfn_from_gpfn(value >> PAGE_SHIFT);
    7.43          char *p;
    7.44  
    7.45 -        DPRINTK("Input address is 0x%"PRIx64".\n", value);
    7.46 +        DPRINTK(XENLOG_G_INFO "Input address is 0x%"PRIx64".\n", value);
    7.47  
    7.48          /* 8-byte aligned valid pseudophys address from vmxassist, please. */
    7.49          if ( (value & 7) || (mfn == INVALID_MFN) ||
    7.50 @@ -948,7 +951,7 @@ static void vmx_do_cpuid(struct cpu_user
    7.51          value = *((uint64_t *)(p + (value & (PAGE_SIZE - 1))));
    7.52          unmap_domain_page(p);
    7.53  
    7.54 -        DPRINTK("Output value is 0x%"PRIx64".\n", value);
    7.55 +        DPRINTK(XENLOG_G_INFO "Output value is 0x%"PRIx64".\n", value);
    7.56          ecx = (u32)(value >>  0);
    7.57          edx = (u32)(value >> 32);
    7.58      }
     8.1 --- a/xen/arch/x86/io_apic.c	Fri Oct 27 18:55:16 2006 +0100
     8.2 +++ b/xen/arch/x86/io_apic.c	Fri Oct 27 18:56:24 2006 +0100
     8.3 @@ -1980,7 +1980,8 @@ int ioapic_guest_read(unsigned long phys
     8.4  }
     8.5  
     8.6  #define WARN_BOGUS_WRITE(f, a...)                                       \
     8.7 -    DPRINTK("\n%s: apic=%d, pin=%d, old_irq=%d, new_irq=%d\n"           \
     8.8 +    DPRINTK(XENLOG_INFO "\n%s: "                                        \
     8.9 +            "apic=%d, pin=%d, old_irq=%d, new_irq=%d\n"                 \
    8.10              "%s: old_entry=%08x, new_entry=%08x\n"                      \
    8.11              "%s: " f, __FUNCTION__, apic, pin, old_irq, new_irq,        \
    8.12              __FUNCTION__, *(u32 *)&old_rte, *(u32 *)&new_rte,           \
     9.1 --- a/xen/arch/x86/irq.c	Fri Oct 27 18:55:16 2006 +0100
     9.2 +++ b/xen/arch/x86/irq.c	Fri Oct 27 18:56:24 2006 +0100
     9.3 @@ -432,7 +432,8 @@ int pirq_guest_bind(struct vcpu *v, int 
     9.4      {
     9.5          if ( desc->action != NULL )
     9.6          {
     9.7 -            DPRINTK("Cannot bind IRQ %d to guest. In use by '%s'.\n",
     9.8 +            DPRINTK(XENLOG_G_INFO
     9.9 +                    "Cannot bind IRQ %d to guest. In use by '%s'.\n",
    9.10                      irq, desc->action->name);
    9.11              rc = -EBUSY;
    9.12              goto out;
    9.13 @@ -441,7 +442,9 @@ int pirq_guest_bind(struct vcpu *v, int 
    9.14          action = xmalloc(irq_guest_action_t);
    9.15          if ( (desc->action = (struct irqaction *)action) == NULL )
    9.16          {
    9.17 -            DPRINTK("Cannot bind IRQ %d to guest. Out of memory.\n", irq);
    9.18 +            DPRINTK(XENLOG_G_INFO
    9.19 +                    "Cannot bind IRQ %d to guest. Out of memory.\n",
    9.20 +                    irq);
    9.21              rc = -ENOMEM;
    9.22              goto out;
    9.23          }
    9.24 @@ -464,7 +467,8 @@ int pirq_guest_bind(struct vcpu *v, int 
    9.25      }
    9.26      else if ( !will_share || !action->shareable )
    9.27      {
    9.28 -        DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n",
    9.29 +        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
    9.30 +               "Will not share with others.\n",
    9.31                  irq);
    9.32          rc = -EBUSY;
    9.33          goto out;
    9.34 @@ -484,7 +488,8 @@ int pirq_guest_bind(struct vcpu *v, int 
    9.35  
    9.36      if ( action->nr_guests == IRQ_MAX_GUESTS )
    9.37      {
    9.38 -        DPRINTK("Cannot bind IRQ %d to guest. Already at max share.\n", irq);
    9.39 +        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
    9.40 +               "Already at max share.\n", irq);
    9.41          rc = -EBUSY;
    9.42          goto out;
    9.43      }
    10.1 --- a/xen/arch/x86/mm.c	Fri Oct 27 18:55:16 2006 +0100
    10.2 +++ b/xen/arch/x86/mm.c	Fri Oct 27 18:56:24 2006 +0100
    10.3 @@ -2261,7 +2261,8 @@ int do_mmu_update(
    10.4              {
    10.5                  if ( shadow_mode_refcounts(d) )
    10.6                  {
    10.7 -                    DPRINTK("mmu update on shadow-refcounted domain!");
    10.8 +                    DPRINTK(XENLOG_INFO
    10.9 +                            "mmu update on shadow-refcounted domain!");
   10.10                      break;
   10.11                  }
   10.12  
   10.13 @@ -2625,7 +2626,8 @@ int steal_page(
   10.14          x = y;
   10.15          if (unlikely((x & (PGC_count_mask|PGC_allocated)) !=
   10.16                       (1 | PGC_allocated)) || unlikely(_nd != _d)) { 
   10.17 -            DPRINTK("gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
   10.18 +            DPRINTK(XENLOG_G_WARNING
   10.19 +                    "gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
   10.20                      " caf=%08x, taf=%" PRtype_info "\n", 
   10.21                      (void *) page_to_mfn(page),
   10.22                      d, d->domain_id, unpickle_domptr(_nd), x, 
    11.1 --- a/xen/arch/x86/mm/shadow/common.c	Fri Oct 27 18:55:16 2006 +0100
    11.2 +++ b/xen/arch/x86/mm/shadow/common.c	Fri Oct 27 18:56:24 2006 +0100
    11.3 @@ -3072,7 +3072,7 @@ int shadow_domctl(struct domain *d,
    11.4  
    11.5      if ( unlikely(d == current->domain) )
    11.6      {
    11.7 -        DPRINTK("Don't try to do a shadow op on yourself!\n");
    11.8 +        DPRINTK(XENLOG_G_INFO "Don't try to do a shadow op on yourself!\n");
    11.9          return -EINVAL;
   11.10      }
   11.11  
    12.1 --- a/xen/arch/x86/platform_hypercall.c	Fri Oct 27 18:55:16 2006 +0100
    12.2 +++ b/xen/arch/x86/platform_hypercall.c	Fri Oct 27 18:56:24 2006 +0100
    12.3 @@ -125,7 +125,7 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
    12.4          case QUIRK_IOAPIC_GOOD_REGSEL:
    12.5  #ifndef sis_apic_bug
    12.6              sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
    12.7 -            DPRINTK("Domain 0 says that IO-APIC REGSEL is %s\n",
    12.8 +            DPRINTK(XENLOG_INFO "Domain 0 says that IO-APIC REGSEL is %s\n",
    12.9                      sis_apic_bug ? "bad" : "good");
   12.10  #else
   12.11              BUG_ON(sis_apic_bug != (quirk_id == QUIRK_IOAPIC_BAD_REGSEL));
    13.1 --- a/xen/arch/x86/traps.c	Fri Oct 27 18:55:16 2006 +0100
    13.2 +++ b/xen/arch/x86/traps.c	Fri Oct 27 18:56:24 2006 +0100
    13.3 @@ -407,7 +407,8 @@ static inline int do_trap(int trapnr, ch
    13.4  
    13.5      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
    13.6      {
    13.7 -        DPRINTK("Trap %d: %p -> %p\n", trapnr, _p(regs->eip), _p(fixup));
    13.8 +        DPRINTK(XENLOG_ERR "Trap %d: %p -> %p\n",
    13.9 +                trapnr, _p(regs->eip), _p(fixup));
   13.10          regs->eip = fixup;
   13.11          return 0;
   13.12      }
   13.13 @@ -475,7 +476,8 @@ int wrmsr_hypervisor_regs(
   13.14  
   13.15          if ( idx > 0 )
   13.16          {
   13.17 -            DPRINTK("Dom%d: Out of range index %u to MSR %08x\n",
   13.18 +            DPRINTK(XENLOG_G_WARNING
   13.19 +                    "Dom%d: Out of range index %u to MSR %08x\n",
   13.20                      d->domain_id, idx, 0x40000000);
   13.21              return 0;
   13.22          }
   13.23 @@ -485,7 +487,8 @@ int wrmsr_hypervisor_regs(
   13.24          if ( !mfn_valid(mfn) ||
   13.25               !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
   13.26          {
   13.27 -            DPRINTK("Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
   13.28 +            DPRINTK(XENLOG_G_WARNING
   13.29 +                    "Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
   13.30                      d->domain_id, gmfn, mfn, 0x40000000);
   13.31              return 0;
   13.32          }
   13.33 @@ -832,17 +835,18 @@ static int __spurious_page_fault(
   13.34          return 0;
   13.35  
   13.36   spurious:
   13.37 -    DPRINTK("Spurious fault in domain %u:%u at addr %lx, e/c %04x\n",
   13.38 +    DPRINTK(XENLOG_WARNING "Spurious fault in domain %u:%u "
   13.39 +            "at addr %lx, e/c %04x\n",
   13.40              current->domain->domain_id, current->vcpu_id,
   13.41              addr, regs->error_code);
   13.42  #if CONFIG_PAGING_LEVELS >= 4
   13.43 -    DPRINTK(" l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
   13.44 +    DPRINTK(XENLOG_WARNING " l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
   13.45  #endif
   13.46  #if CONFIG_PAGING_LEVELS >= 3
   13.47 -    DPRINTK(" l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
   13.48 +    DPRINTK(XENLOG_WARNING " l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
   13.49  #endif
   13.50 -    DPRINTK(" l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
   13.51 -    DPRINTK(" l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
   13.52 +    DPRINTK(XENLOG_WARNING " l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
   13.53 +    DPRINTK(XENLOG_WARNING " l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
   13.54  #ifndef NDEBUG
   13.55      show_registers(regs);
   13.56  #endif
   13.57 @@ -1313,7 +1317,8 @@ static int emulate_privileged_op(struct 
   13.58          case 0: /* Write CR0 */
   13.59              if ( (*reg ^ read_cr0()) & ~X86_CR0_TS )
   13.60              {
   13.61 -                DPRINTK("Attempt to change unmodifiable CR0 flags.\n");
   13.62 +                DPRINTK(XENLOG_G_WARNING
   13.63 +                        "Attempt to change unmodifiable CR0 flags.\n");
   13.64                  goto fail;
   13.65              }
   13.66              (void)do_fpu_taskswitch(!!(*reg & X86_CR0_TS));
   13.67 @@ -1333,7 +1338,7 @@ static int emulate_privileged_op(struct 
   13.68          case 4:
   13.69              if ( *reg != (read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE)) )
   13.70              {
   13.71 -                DPRINTK("Attempt to change CR4 flags.\n");
   13.72 +                DPRINTK(XENLOG_G_WARNING "Attempt to change CR4 flags.\n");
   13.73                  goto fail;
   13.74              }
   13.75              break;
   13.76 @@ -1381,7 +1386,7 @@ static int emulate_privileged_op(struct 
   13.77  
   13.78              if ( (rdmsr_safe(regs->ecx, l, h) != 0) ||
   13.79                   (regs->eax != l) || (regs->edx != h) )
   13.80 -                DPRINTK("Domain attempted WRMSR %p from "
   13.81 +                DPRINTK(XENLOG_G_WARNING "Domain attempted WRMSR %p from "
   13.82                          "%08x:%08x to %08lx:%08lx.\n",
   13.83                          _p(regs->ecx), h, l, (long)regs->edx, (long)regs->eax);
   13.84              break;
   13.85 @@ -1510,7 +1515,7 @@ asmlinkage int do_general_protection(str
   13.86  
   13.87      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
   13.88      {
   13.89 -        DPRINTK("GPF (%04x): %p -> %p\n",
   13.90 +        DPRINTK(XENLOG_WARNING "GPF (%04x): %p -> %p\n",
   13.91                  regs->error_code, _p(regs->eip), _p(fixup));
   13.92          regs->eip = fixup;
   13.93          return 0;
    14.1 --- a/xen/arch/x86/x86_32/seg_fixup.c	Fri Oct 27 18:55:16 2006 +0100
    14.2 +++ b/xen/arch/x86/x86_32/seg_fixup.c	Fri Oct 27 18:56:24 2006 +0100
    14.3 @@ -32,10 +32,6 @@
    14.4  #include <asm/regs.h>
    14.5  #include <asm/x86_emulate.h>
    14.6  
    14.7 -/* Make the scary benign errors go away. */
    14.8 -#undef  DPRINTK
    14.9 -#define DPRINTK(_f, _a...) ((void)0)
   14.10 -
   14.11  /* General instruction properties. */
   14.12  #define INSN_SUFFIX_BYTES (7)
   14.13  #define OPCODE_BYTE       (1<<4)  
   14.14 @@ -185,7 +181,7 @@ int fixup_seg(u16 seg, unsigned long off
   14.15          table = (unsigned long *)LDT_VIRT_START(d);
   14.16          if ( idx >= d->arch.guest_context.ldt_ents )
   14.17          {
   14.18 -            DPRINTK("Segment %04x out of LDT range (%ld)\n",
   14.19 +            DPRINTK(XENLOG_DEBUG "Segment %04x out of LDT range (%ld)\n",
   14.20                      seg, d->arch.guest_context.ldt_ents);
   14.21              goto fail;
   14.22          }
   14.23 @@ -195,7 +191,7 @@ int fixup_seg(u16 seg, unsigned long off
   14.24          table = (unsigned long *)GDT_VIRT_START(d);
   14.25          if ( idx >= d->arch.guest_context.gdt_ents )
   14.26          {
   14.27 -            DPRINTK("Segment %04x out of GDT range (%ld)\n",
   14.28 +            DPRINTK(XENLOG_DEBUG "Segment %04x out of GDT range (%ld)\n",
   14.29                      seg, d->arch.guest_context.gdt_ents);
   14.30              goto fail;
   14.31          }
   14.32 @@ -205,7 +201,7 @@ int fixup_seg(u16 seg, unsigned long off
   14.33      if ( __get_user(a, &table[2*idx+0]) ||
   14.34           __get_user(b, &table[2*idx+1]) )
   14.35      {
   14.36 -        DPRINTK("Fault while reading segment %04x\n", seg);
   14.37 +        DPRINTK(XENLOG_DEBUG "Fault while reading segment %04x\n", seg);
   14.38          goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
   14.39      }
   14.40  
   14.41 @@ -214,7 +210,7 @@ int fixup_seg(u16 seg, unsigned long off
   14.42                 _SEGMENT_G|_SEGMENT_CODE|_SEGMENT_DPL)) != 
   14.43           (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|_SEGMENT_G|_SEGMENT_DPL) )
   14.44      {
   14.45 -        DPRINTK("Bad segment %08lx:%08lx\n", a, b);
   14.46 +        DPRINTK(XENLOG_DEBUG "Bad segment %08lx:%08lx\n", a, b);
   14.47          goto fail;
   14.48      }
   14.49  
   14.50 @@ -244,7 +240,8 @@ int fixup_seg(u16 seg, unsigned long off
   14.51          }
   14.52      }
   14.53  
   14.54 -    DPRINTK("None of the above! (%08lx:%08lx, %08lx, %08lx, %08lx)\n", 
   14.55 +    DPRINTK(XENLOG_DEBUG "None of the above! "
   14.56 +            "(%08lx:%08lx, %08lx, %08lx, %08lx)\n",
   14.57              a, b, base, limit, base+limit);
   14.58  
   14.59   fail:
   14.60 @@ -282,13 +279,14 @@ int gpf_emulate_4gb(struct cpu_user_regs
   14.61      /* WARNING: We only work for ring-3 segments. */
   14.62      if ( unlikely(vm86_mode(regs)) || unlikely(!ring_3(regs)) )
   14.63      {
   14.64 -        DPRINTK("Taken fault at bad CS %04x\n", regs->cs);
   14.65 +        DPRINTK(XENLOG_DEBUG "Taken fault at bad CS %04x\n", regs->cs);
   14.66          goto fail;
   14.67      }
   14.68  
   14.69      if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
   14.70      {
   14.71 -        DPRINTK("Cannot linearise %04x:%08x\n", regs->cs, regs->eip);
   14.72 +        DPRINTK(XENLOG_DEBUG "Cannot linearise %04x:%08x\n",
   14.73 +                regs->cs, regs->eip);
   14.74          goto fail;
   14.75      }
   14.76  
   14.77 @@ -297,13 +295,16 @@ int gpf_emulate_4gb(struct cpu_user_regs
   14.78      {
   14.79          if ( get_user(b, pb) )
   14.80          {
   14.81 -            DPRINTK("Fault while accessing byte %d of instruction\n", pb-eip);
   14.82 +            DPRINTK(XENLOG_DEBUG
   14.83 +                    "Fault while accessing byte %d of instruction\n",
   14.84 +                    pb-eip);
   14.85              goto page_fault;
   14.86          }
   14.87  
   14.88          if ( (pb - eip) >= 15 )
   14.89          {
   14.90 -            DPRINTK("Too many instruction prefixes for a legal instruction\n");
   14.91 +            DPRINTK(XENLOG_DEBUG "Too many instruction prefixes for a "
   14.92 +                    "legal instruction\n");
   14.93              goto fail;
   14.94          }
   14.95  
   14.96 @@ -315,7 +316,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
   14.97          case 0x26: /* ES override */
   14.98          case 0x64: /* FS override */
   14.99          case 0x36: /* SS override */
  14.100 -            DPRINTK("Unhandled prefix %02x\n", b);
  14.101 +            DPRINTK(XENLOG_DEBUG "Unhandled prefix %02x\n", b);
  14.102              goto fail;
  14.103          case 0x66: /* Operand-size override */
  14.104          case 0xf0: /* LOCK */
  14.105 @@ -333,7 +334,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.106  
  14.107      if ( !gs_override )
  14.108      {
  14.109 -        DPRINTK("Only instructions with GS override\n");
  14.110 +        DPRINTK(XENLOG_DEBUG "Only instructions with GS override\n");
  14.111          goto fail;
  14.112      }
  14.113  
  14.114 @@ -341,7 +342,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.115      pb++;
  14.116      if ( decode == 0 )
  14.117      {
  14.118 -        DPRINTK("Unsupported opcode %02x\n", b);
  14.119 +        DPRINTK(XENLOG_DEBUG "Unsupported opcode %02x\n", b);
  14.120          goto fail;
  14.121      }
  14.122      
  14.123 @@ -353,7 +354,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.124  
  14.125          if ( get_user(offset, (u32 *)pb) )
  14.126          {
  14.127 -            DPRINTK("Fault while extracting <disp32>.\n");
  14.128 +            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp32>.\n");
  14.129              goto page_fault;
  14.130          }
  14.131          pb += 4;
  14.132 @@ -367,7 +368,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.133  
  14.134      if ( get_user(modrm, pb) )
  14.135      {
  14.136 -        DPRINTK("Fault while extracting modrm byte\n");
  14.137 +        DPRINTK(XENLOG_DEBUG "Fault while extracting modrm byte\n");
  14.138          goto page_fault;
  14.139      }
  14.140  
  14.141 @@ -379,7 +380,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.142  
  14.143      if ( rm == 4 )
  14.144      {
  14.145 -        DPRINTK("FIXME: Add decoding for the SIB byte.\n");
  14.146 +        DPRINTK(XENLOG_DEBUG "FIXME: Add decoding for the SIB byte.\n");
  14.147          goto fixme;
  14.148      }
  14.149  
  14.150 @@ -397,7 +398,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.151              memreg = NULL;
  14.152              if ( get_user(disp32, (u32 *)pb) )
  14.153              {
  14.154 -                DPRINTK("Fault while extracting <disp8>.\n");
  14.155 +                DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  14.156                  goto page_fault;
  14.157              }
  14.158              pb += 4;
  14.159 @@ -407,7 +408,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.160      case 1:
  14.161          if ( get_user(disp8, pb) )
  14.162          {
  14.163 -            DPRINTK("Fault while extracting <disp8>.\n");
  14.164 +            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  14.165              goto page_fault;
  14.166          }
  14.167          pb++;
  14.168 @@ -417,14 +418,14 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.169      case 2:
  14.170          if ( get_user(disp32, (u32 *)pb) )
  14.171          {
  14.172 -            DPRINTK("Fault while extracting <disp8>.\n");
  14.173 +            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
  14.174              goto page_fault;
  14.175          }
  14.176          pb += 4;
  14.177          break;
  14.178  
  14.179      case 3:
  14.180 -        DPRINTK("Not a memory operand!\n");
  14.181 +        DPRINTK(XENLOG_DEBUG "Not a memory operand!\n");
  14.182          goto fail;
  14.183      }
  14.184  
  14.185 @@ -455,7 +456,8 @@ int gpf_emulate_4gb(struct cpu_user_regs
  14.186      return EXCRET_fault_fixed;
  14.187  
  14.188   fixme:
  14.189 -    DPRINTK("Undecodable instruction %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
  14.190 +    DPRINTK(XENLOG_DEBUG "Undecodable instruction "
  14.191 +            "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
  14.192              "caused GPF(0) at %04x:%08x\n",
  14.193              eip[0], eip[1], eip[2], eip[3],
  14.194              eip[4], eip[5], eip[6], eip[7],
    15.1 --- a/xen/arch/x86/x86_64/traps.c	Fri Oct 27 18:55:16 2006 +0100
    15.2 +++ b/xen/arch/x86/x86_64/traps.c	Fri Oct 27 18:56:24 2006 +0100
    15.3 @@ -206,7 +206,8 @@ unsigned long do_iret(void)
    15.4      if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp,
    15.5                                   sizeof(iret_saved))) )
    15.6      {
    15.7 -        DPRINTK("Fault while reading IRET context from guest stack\n");
    15.8 +        DPRINTK(XENLOG_G_ERR "Fault while reading IRET context from "
    15.9 +                "guest stack\n");
   15.10          domain_crash_synchronous();
   15.11      }
   15.12  
   15.13 @@ -215,7 +216,8 @@ unsigned long do_iret(void)
   15.14      {
   15.15          if ( unlikely(pagetable_is_null(v->arch.guest_table_user)) )
   15.16          {
   15.17 -            DPRINTK("Guest switching to user mode with no user page tables\n");
   15.18 +            DPRINTK(XENLOG_G_ERR "Guest switching to user mode with no "
   15.19 +                    "user page tables\n");
   15.20              domain_crash_synchronous();
   15.21          }
   15.22          toggle_guest_mode(v);
    16.1 --- a/xen/include/asm-x86/mm.h	Fri Oct 27 18:55:16 2006 +0100
    16.2 +++ b/xen/include/asm-x86/mm.h	Fri Oct 27 18:56:24 2006 +0100
    16.3 @@ -213,7 +213,8 @@ static inline int get_page(struct page_i
    16.4               unlikely(d != _domain) )                /* Wrong owner? */
    16.5          {
    16.6              if ( !_shadow_mode_refcounts(domain) )
    16.7 -                DPRINTK("Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%" 
    16.8 +                DPRINTK(XENLOG_G_INFO
    16.9 +                        "Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%"
   16.10                          PRtype_info "\n",
   16.11                          page_to_mfn(page), domain, unpickle_domptr(d),
   16.12                          x, page->u.inuse.type_info);