WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4/6 V2] log level DPRINTK x86

To: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir.Fraser@xxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4/6 V2] log level DPRINTK x86
From: Steven Rostedt <srostedt@xxxxxxxxxx>
Date: Fri, 27 Oct 2006 11:32:20 -0400
Delivery-date: Fri, 27 Oct 2006 08:35:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (X11/20060614)
This updates the x86 arch code to change the DPRINTKS to use the log levels.

Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
diff -r 476ca22b548e xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/domain.c     Fri Oct 27 11:11:42 2006 -0400
@@ -564,7 +564,8 @@ static void load_segments(struct vcpu *n
              put_user(regs->r11,           rsp-10) |
              put_user(regs->rcx,           rsp-11) )
         {
-            DPRINTK("Error while creating failsafe callback frame.\n");
+            DPRINTK(XENLOG_G_ERR "Error while creating failsafe "
+                    "callback frame.\n");
             domain_crash(n->domain);
         }
 
diff -r 476ca22b548e xen/arch/x86/extable.c
--- a/xen/arch/x86/extable.c    Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/extable.c    Fri Oct 27 11:11:42 2006 -0400
@@ -74,7 +74,7 @@ search_pre_exception_table(struct cpu_us
     unsigned long addr = (unsigned long)regs->eip;
     unsigned long fixup = search_one_table(
         __start___pre_ex_table, __stop___pre_ex_table-1, addr);
-    DPRINTK("Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
+    DPRINTK(XENLOG_INFO "Pre-exception: %p -> %p\n", _p(addr), _p(fixup));
 #ifdef PERF_COUNTERS
     if ( fixup )
         perfc_incrc(exception_fixed);
diff -r 476ca22b548e xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/hvm/hvm.c    Fri Oct 27 11:11:42 2006 -0400
@@ -194,7 +194,8 @@ void hvm_create_event_channels(struct vc
             p = get_vio(v->domain, o->vcpu_id);
             o->arch.hvm_vcpu.xen_port = p->vp_eport =
                 alloc_unbound_xen_event_channel(o, 0);
-            DPRINTK("Allocated port %d for hvm.\n", o->arch.hvm_vcpu.xen_port);
+            DPRINTK(XENLOG_INFO "Allocated port %d for hvm.\n",
+                    o->arch.hvm_vcpu.xen_port);
         }
     }
 }
@@ -352,7 +353,8 @@ static void hvm_vcpu_down(void)
     struct domain *d = v->domain;
     int online_count = 0;
 
-    DPRINTK("DOM%d/VCPU%d: going offline.\n", d->domain_id, v->vcpu_id);
+    DPRINTK(XENLOG_G_INFO "DOM%d/VCPU%d: going offline.\n",
+           d->domain_id, v->vcpu_id);
 
     /* Doesn't halt us immediately, but we'll never return to guest context. */
     set_bit(_VCPUF_down, &v->vcpu_flags);
@@ -368,7 +370,8 @@ static void hvm_vcpu_down(void)
     /* ... Shut down the domain if not. */
     if ( online_count == 0 )
     {
-        DPRINTK("DOM%d: all CPUs offline -- powering off.\n", d->domain_id);
+        DPRINTK(XENLOG_G_INFO "DOM%d: all CPUs offline -- powering off.\n",
+                d->domain_id);
         domain_shutdown(d, SHUTDOWN_poweroff);
     }
 }
@@ -508,7 +511,7 @@ void hvm_do_hypercall(struct cpu_user_re
 
     if ( (pregs->eax >= NR_hypercalls) || !hvm_hypercall_table[pregs->eax] )
     {
-        DPRINTK("HVM vcpu %d:%d did a bad hypercall %d.\n",
+        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %d.\n",
                 current->domain->domain_id, current->vcpu_id,
                 pregs->eax);
         pregs->eax = -ENOSYS;
@@ -554,7 +557,7 @@ static long do_memory_op_compat32(int cm
     }
 
     default:
-        DPRINTK("memory_op %d.\n", cmd);
+        DPRINTK(XENLOG_G_INFO "memory_op %d.\n", cmd);
         rc = -ENOSYS;
         break;
     }
@@ -587,7 +590,7 @@ void hvm_do_hypercall(struct cpu_user_re
     pregs->rax = (uint32_t)pregs->eax; /* mask in case compat32 caller */
     if ( (pregs->rax >= NR_hypercalls) || !hvm_hypercall64_table[pregs->rax] )
     {
-        DPRINTK("HVM vcpu %d:%d did a bad hypercall %ld.\n",
+        DPRINTK(XENLOG_G_INFO "HVM vcpu %d:%d did a bad hypercall %ld.\n",
                 current->domain->domain_id, current->vcpu_id,
                 pregs->rax);
         pregs->rax = -ENOSYS;
@@ -638,7 +641,7 @@ int hvm_bringup_ap(int vcpuid, int tramp
 
     if ( bsp->vcpu_id != 0 )
     {
-        DPRINTK("Not calling hvm_bringup_ap from BSP context.\n");
+        DPRINTK(XENLOG_G_ERR "Not calling hvm_bringup_ap from BSP context.\n");
         domain_crash_synchronous();
     }
 
@@ -647,7 +650,8 @@ int hvm_bringup_ap(int vcpuid, int tramp
 
     if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
     {
-        DPRINTK("Failed to allocate memory in hvm_bringup_ap.\n");
+        DPRINTK(XENLOG_G_INFO
+                "Failed to allocate memory in hvm_bringup_ap.\n");
         return -ENOMEM;
     }
 
@@ -661,13 +665,14 @@ int hvm_bringup_ap(int vcpuid, int tramp
 
     if ( rc != 0 )
     {
-        DPRINTK("AP %d bringup failed in boot_vcpu %x.\n", vcpuid, rc);
+        DPRINTK(XENLOG_G_INFO
+               "AP %d bringup failed in boot_vcpu %x.\n", vcpuid, rc);
         goto out;
     }
 
     if ( test_and_clear_bit(_VCPUF_down, &d->vcpu[vcpuid]->vcpu_flags) )
         vcpu_wake(d->vcpu[vcpuid]);
-    DPRINTK("AP %d bringup suceeded.\n", vcpuid);
+    DPRINTK(XENLOG_G_INFO "AP %d bringup suceeded.\n", vcpuid);
 
  out:
     xfree(ctxt);
@@ -726,7 +731,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
 
     default:
     {
-        DPRINTK("Bad HVM op %ld.\n", op);
+        DPRINTK(XENLOG_G_INFO "Bad HVM op %ld.\n", op);
         rc = -ENOSYS;
         break;
     }
diff -r 476ca22b548e xen/arch/x86/hvm/instrlen.c
--- a/xen/arch/x86/hvm/instrlen.c       Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/hvm/instrlen.c       Fri Oct 27 11:11:42 2006 -0400
@@ -317,7 +317,7 @@ done_prefixes:
 
         if ( modrm_mod == 3 )
         {
-            DPRINTK("Cannot parse ModRM.mod == 3.\n");
+            DPRINTK(XENLOG_G_WARNING "Cannot parse ModRM.mod == 3.\n");
             goto cannot_emulate;
         }
 
@@ -444,7 +444,8 @@ done:
     return length;
 
 cannot_emulate:
-    DPRINTK("Cannot emulate %02x at address %lx (eip %lx, mode %d)\n",
+    DPRINTK(XENLOG_G_WARNING
+            "Cannot emulate %02x at address %lx (eip %lx, mode %d)\n",
             b, (unsigned long)_regs.eip, (unsigned long)regs->eip, mode);
     return -1;
 }
diff -r 476ca22b548e xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri Oct 27 11:11:42 2006 -0400
@@ -804,7 +804,7 @@ static void svm_final_setup_guest(struct
 
     if ( !shadow_mode_external(d) )
     {
-        DPRINTK("Can't init HVM for dom %u vcpu %u: "
+        DPRINTK(XENLOG_G_ERR "Can't init HVM for dom %u vcpu %u: "
                 "not in shadow external mode\n", d->domain_id, v->vcpu_id);
         domain_crash(d);
     }
diff -r 476ca22b548e xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Fri Oct 27 11:11:42 2006 -0400
@@ -145,7 +145,7 @@ static struct vmcs_struct *vmx_alloc_vmc
 
     if ( (vmcs = alloc_xenheap_page()) == NULL )
     {
-        DPRINTK("Failed to allocate VMCS.\n");
+        DPRINTK(XENLOG_G_WARNING "Failed to allocate VMCS.\n");
         return NULL;
     }
 
diff -r 476ca22b548e xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Oct 27 11:11:42 2006 -0400
@@ -71,7 +71,7 @@ static int vmx_initialize_guest_resource
 
     if ( !shadow_mode_external(d) )
     {
-        DPRINTK("Can't init HVM for dom %u vcpu %u: "
+        DPRINTK(XENLOG_ERR "Can't init HVM for dom %u vcpu %u: "
                 "not in shadow external mode\n", 
                 d->domain_id, v->vcpu_id);
         domain_crash(d);
@@ -83,7 +83,8 @@ static int vmx_initialize_guest_resource
 
         if ( (rc = vmx_create_vmcs(vc)) != 0 )
         {
-            DPRINTK("Failed to create VMCS for vcpu %d: err=%d.\n",
+            DPRINTK(XENLOG_WARNING
+                    "Failed to create VMCS for vcpu %d: err=%d.\n",
                     vc->vcpu_id, rc);
             return 0;
         }
@@ -92,14 +93,16 @@ static int vmx_initialize_guest_resource
 
         if ( (io_bitmap_a = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
         {
-            DPRINTK("Failed to allocate io bitmap b for vcpu %d.\n",
+            DPRINTK(XENLOG_WARNING
+                   "Failed to allocate io bitmap b for vcpu %d.\n",
                     vc->vcpu_id);
             return 0;
         }
 
         if ( (io_bitmap_b = alloc_xenheap_pages(IO_BITMAP_ORDER)) == NULL )
         {
-            DPRINTK("Failed to allocate io bitmap b for vcpu %d.\n",
+            DPRINTK(XENLOG_WARNING
+                    "Failed to allocate io bitmap b for vcpu %d.\n",
                     vc->vcpu_id);
             return 0;
         }
@@ -936,7 +939,7 @@ static void vmx_do_cpuid(struct cpu_user
         unsigned long mfn = get_mfn_from_gpfn(value >> PAGE_SHIFT);
         char *p;
 
-        DPRINTK("Input address is 0x%"PRIx64".\n", value);
+        DPRINTK(XENLOG_G_INFO "Input address is 0x%"PRIx64".\n", value);
 
         /* 8-byte aligned valid pseudophys address from vmxassist, please. */
         if ( (value & 7) || (mfn == INVALID_MFN) ||
@@ -947,7 +950,7 @@ static void vmx_do_cpuid(struct cpu_user
         value = *((uint64_t *)(p + (value & (PAGE_SIZE - 1))));
         unmap_domain_page(p);
 
-        DPRINTK("Output value is 0x%"PRIx64".\n", value);
+        DPRINTK(XENLOG_G_INFO "Output value is 0x%"PRIx64".\n", value);
         ecx = (u32)(value >>  0);
         edx = (u32)(value >> 32);
     }
diff -r 476ca22b548e xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/io_apic.c    Fri Oct 27 11:11:42 2006 -0400
@@ -1980,7 +1980,8 @@ int ioapic_guest_read(unsigned long phys
 }
 
 #define WARN_BOGUS_WRITE(f, a...)                                       \
-    DPRINTK("\n%s: apic=%d, pin=%d, old_irq=%d, new_irq=%d\n"           \
+    DPRINTK(XENLOG_INFO "\n%s: "                                        \
+            "apic=%d, pin=%d, old_irq=%d, new_irq=%d\n"                 \
             "%s: old_entry=%08x, new_entry=%08x\n"                      \
             "%s: " f, __FUNCTION__, apic, pin, old_irq, new_irq,        \
             __FUNCTION__, *(u32 *)&old_rte, *(u32 *)&new_rte,           \
diff -r 476ca22b548e xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/irq.c        Fri Oct 27 11:11:42 2006 -0400
@@ -432,7 +432,8 @@ int pirq_guest_bind(struct vcpu *v, int 
     {
         if ( desc->action != NULL )
         {
-            DPRINTK("Cannot bind IRQ %d to guest. In use by '%s'.\n",
+            DPRINTK(XENLOG_G_INFO
+                    "Cannot bind IRQ %d to guest. In use by '%s'.\n",
                     irq, desc->action->name);
             rc = -EBUSY;
             goto out;
@@ -441,7 +442,9 @@ int pirq_guest_bind(struct vcpu *v, int 
         action = xmalloc(irq_guest_action_t);
         if ( (desc->action = (struct irqaction *)action) == NULL )
         {
-            DPRINTK("Cannot bind IRQ %d to guest. Out of memory.\n", irq);
+            DPRINTK(XENLOG_G_INFO
+                    "Cannot bind IRQ %d to guest. Out of memory.\n",
+                    irq);
             rc = -ENOMEM;
             goto out;
         }
@@ -464,7 +467,8 @@ int pirq_guest_bind(struct vcpu *v, int 
     }
     else if ( !will_share || !action->shareable )
     {
-        DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n",
+        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
+               "Will not share with others.\n",
                 irq);
         rc = -EBUSY;
         goto out;
@@ -484,7 +488,8 @@ int pirq_guest_bind(struct vcpu *v, int 
 
     if ( action->nr_guests == IRQ_MAX_GUESTS )
     {
-        DPRINTK("Cannot bind IRQ %d to guest. Already at max share.\n", irq);
+        DPRINTK(XENLOG_G_INFO "Cannot bind IRQ %d to guest. "
+               "Already at max share.\n", irq);
         rc = -EBUSY;
         goto out;
     }
diff -r 476ca22b548e xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/mm.c Fri Oct 27 11:11:42 2006 -0400
@@ -2262,7 +2262,8 @@ int do_mmu_update(
             {
                 if ( shadow_mode_refcounts(d) )
                 {
-                    DPRINTK("mmu update on shadow-refcounted domain!");
+                    DPRINTK(XENLOG_INFO
+                            "mmu update on shadow-refcounted domain!");
                     break;
                 }
 
@@ -2626,7 +2627,8 @@ int steal_page(
         x = y;
         if (unlikely((x & (PGC_count_mask|PGC_allocated)) !=
                      (1 | PGC_allocated)) || unlikely(_nd != _d)) { 
-            DPRINTK("gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
+            DPRINTK(XENLOG_G_WARNING
+                    "gnttab_transfer: Bad page %p: ed=%p(%u), sd=%p,"
                     " caf=%08x, taf=%" PRtype_info "\n", 
                     (void *) page_to_mfn(page),
                     d, d->domain_id, unpickle_domptr(_nd), x, 
diff -r 476ca22b548e xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/mm/shadow/common.c   Fri Oct 27 11:11:42 2006 -0400
@@ -3072,7 +3072,7 @@ int shadow_domctl(struct domain *d,
 
     if ( unlikely(d == current->domain) )
     {
-        DPRINTK("Don't try to do a shadow op on yourself!\n");
+        DPRINTK(XENLOG_G_INFO "Don't try to do a shadow op on yourself!\n");
         return -EINVAL;
     }
 
diff -r 476ca22b548e xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/platform_hypercall.c Fri Oct 27 11:11:42 2006 -0400
@@ -125,7 +125,7 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
         case QUIRK_IOAPIC_GOOD_REGSEL:
 #ifndef sis_apic_bug
             sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
-            DPRINTK("Domain 0 says that IO-APIC REGSEL is %s\n",
+            DPRINTK(XENLOG_INFO "Domain 0 says that IO-APIC REGSEL is %s\n",
                     sis_apic_bug ? "bad" : "good");
 #else
             BUG_ON(sis_apic_bug != (quirk_id == QUIRK_IOAPIC_BAD_REGSEL));
diff -r 476ca22b548e xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/traps.c      Fri Oct 27 11:11:42 2006 -0400
@@ -407,7 +407,8 @@ static inline int do_trap(int trapnr, ch
 
     if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
     {
-        DPRINTK("Trap %d: %p -> %p\n", trapnr, _p(regs->eip), _p(fixup));
+        DPRINTK(XENLOG_ERR "Trap %d: %p -> %p\n",
+                trapnr, _p(regs->eip), _p(fixup));
         regs->eip = fixup;
         return 0;
     }
@@ -475,7 +476,8 @@ int wrmsr_hypervisor_regs(
 
         if ( idx > 0 )
         {
-            DPRINTK("Dom%d: Out of range index %u to MSR %08x\n",
+            DPRINTK(XENLOG_G_WARNING
+                    "Dom%d: Out of range index %u to MSR %08x\n",
                     d->domain_id, idx, 0x40000000);
             return 0;
         }
@@ -485,7 +487,8 @@ int wrmsr_hypervisor_regs(
         if ( !mfn_valid(mfn) ||
              !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
         {
-            DPRINTK("Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
+            DPRINTK(XENLOG_G_WARNING
+                    "Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
                     d->domain_id, gmfn, mfn, 0x40000000);
             return 0;
         }
@@ -832,17 +835,18 @@ static int __spurious_page_fault(
         return 0;
 
  spurious:
-    DPRINTK("Spurious fault in domain %u:%u at addr %lx, e/c %04x\n",
+    DPRINTK(XENLOG_WARNING "Spurious fault in domain %u:%u "
+            "at addr %lx, e/c %04x\n",
             current->domain->domain_id, current->vcpu_id,
             addr, regs->error_code);
 #if CONFIG_PAGING_LEVELS >= 4
-    DPRINTK(" l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
+    DPRINTK(XENLOG_WARNING " l4e = %"PRIpte"\n", l4e_get_intpte(l4e));
 #endif
 #if CONFIG_PAGING_LEVELS >= 3
-    DPRINTK(" l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
-#endif
-    DPRINTK(" l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
-    DPRINTK(" l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
+    DPRINTK(XENLOG_WARNING " l3e = %"PRIpte"\n", l3e_get_intpte(l3e));
+#endif
+    DPRINTK(XENLOG_WARNING " l2e = %"PRIpte"\n", l2e_get_intpte(l2e));
+    DPRINTK(XENLOG_WARNING " l1e = %"PRIpte"\n", l1e_get_intpte(l1e));
 #ifndef NDEBUG
     show_registers(regs);
 #endif
@@ -1313,7 +1317,8 @@ static int emulate_privileged_op(struct 
         case 0: /* Write CR0 */
             if ( (*reg ^ read_cr0()) & ~X86_CR0_TS )
             {
-                DPRINTK("Attempt to change unmodifiable CR0 flags.\n");
+                DPRINTK(XENLOG_G_WARNING
+                        "Attempt to change unmodifiable CR0 flags.\n");
                 goto fail;
             }
             (void)do_fpu_taskswitch(!!(*reg & X86_CR0_TS));
@@ -1333,7 +1338,7 @@ static int emulate_privileged_op(struct 
         case 4:
             if ( *reg != (read_cr4() & ~(X86_CR4_PGE|X86_CR4_PSE)) )
             {
-                DPRINTK("Attempt to change CR4 flags.\n");
+                DPRINTK(XENLOG_G_WARNING "Attempt to change CR4 flags.\n");
                 goto fail;
             }
             break;
@@ -1381,7 +1386,7 @@ static int emulate_privileged_op(struct 
 
             if ( (rdmsr_safe(regs->ecx, l, h) != 0) ||
                  (regs->eax != l) || (regs->edx != h) )
-                DPRINTK("Domain attempted WRMSR %p from "
+                DPRINTK(XENLOG_G_WARNING "Domain attempted WRMSR %p from "
                         "%08x:%08x to %08lx:%08lx.\n",
                         _p(regs->ecx), h, l, (long)regs->edx, (long)regs->eax);
             break;
@@ -1510,7 +1515,7 @@ asmlinkage int do_general_protection(str
 
     if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
     {
-        DPRINTK("GPF (%04x): %p -> %p\n",
+        DPRINTK(XENLOG_WARNING "GPF (%04x): %p -> %p\n",
                 regs->error_code, _p(regs->eip), _p(fixup));
         regs->eip = fixup;
         return 0;
diff -r 476ca22b548e xen/arch/x86/x86_32/seg_fixup.c
--- a/xen/arch/x86/x86_32/seg_fixup.c   Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/x86_32/seg_fixup.c   Fri Oct 27 11:11:42 2006 -0400
@@ -31,10 +31,6 @@
 #include <asm/processor.h>
 #include <asm/regs.h>
 #include <asm/x86_emulate.h>
-
-/* Make the scary benign errors go away. */
-#undef  DPRINTK
-#define DPRINTK(_f, _a...) ((void)0)
 
 /* General instruction properties. */
 #define INSN_SUFFIX_BYTES (7)
@@ -185,7 +181,7 @@ int fixup_seg(u16 seg, unsigned long off
         table = (unsigned long *)LDT_VIRT_START(d);
         if ( idx >= d->arch.guest_context.ldt_ents )
         {
-            DPRINTK("Segment %04x out of LDT range (%ld)\n",
+            DPRINTK(XENLOG_DEBUG "Segment %04x out of LDT range (%ld)\n",
                     seg, d->arch.guest_context.ldt_ents);
             goto fail;
         }
@@ -195,7 +191,7 @@ int fixup_seg(u16 seg, unsigned long off
         table = (unsigned long *)GDT_VIRT_START(d);
         if ( idx >= d->arch.guest_context.gdt_ents )
         {
-            DPRINTK("Segment %04x out of GDT range (%ld)\n",
+            DPRINTK(XENLOG_DEBUG "Segment %04x out of GDT range (%ld)\n",
                     seg, d->arch.guest_context.gdt_ents);
             goto fail;
         }
@@ -205,7 +201,7 @@ int fixup_seg(u16 seg, unsigned long off
     if ( __get_user(a, &table[2*idx+0]) ||
          __get_user(b, &table[2*idx+1]) )
     {
-        DPRINTK("Fault while reading segment %04x\n", seg);
+        DPRINTK(XENLOG_DEBUG "Fault while reading segment %04x\n", seg);
         goto fail; /* Barking up the wrong tree. Decode needs a page fault.*/
     }
 
@@ -214,7 +210,7 @@ int fixup_seg(u16 seg, unsigned long off
                _SEGMENT_G|_SEGMENT_CODE|_SEGMENT_DPL)) != 
          (_SEGMENT_P|_SEGMENT_S|_SEGMENT_DB|_SEGMENT_G|_SEGMENT_DPL) )
     {
-        DPRINTK("Bad segment %08lx:%08lx\n", a, b);
+        DPRINTK(XENLOG_DEBUG "Bad segment %08lx:%08lx\n", a, b);
         goto fail;
     }
 
@@ -244,7 +240,8 @@ int fixup_seg(u16 seg, unsigned long off
         }
     }
 
-    DPRINTK("None of the above! (%08lx:%08lx, %08lx, %08lx, %08lx)\n", 
+    DPRINTK(XENLOG_DEBUG "None of the above! "
+            "(%08lx:%08lx, %08lx, %08lx, %08lx)\n",
             a, b, base, limit, base+limit);
 
  fail:
@@ -282,13 +279,14 @@ int gpf_emulate_4gb(struct cpu_user_regs
     /* WARNING: We only work for ring-3 segments. */
     if ( unlikely(vm86_mode(regs)) || unlikely(!ring_3(regs)) )
     {
-        DPRINTK("Taken fault at bad CS %04x\n", regs->cs);
+        DPRINTK(XENLOG_DEBUG "Taken fault at bad CS %04x\n", regs->cs);
         goto fail;
     }
 
     if ( !linearise_address((u16)regs->cs, regs->eip, (unsigned long *)&eip) )
     {
-        DPRINTK("Cannot linearise %04x:%08x\n", regs->cs, regs->eip);
+        DPRINTK(XENLOG_DEBUG "Cannot linearise %04x:%08x\n",
+                regs->cs, regs->eip);
         goto fail;
     }
 
@@ -297,13 +295,16 @@ int gpf_emulate_4gb(struct cpu_user_regs
     {
         if ( get_user(b, pb) )
         {
-            DPRINTK("Fault while accessing byte %d of instruction\n", pb-eip);
+            DPRINTK(XENLOG_DEBUG
+                    "Fault while accessing byte %d of instruction\n",
+                    pb-eip);
             goto page_fault;
         }
 
         if ( (pb - eip) >= 15 )
         {
-            DPRINTK("Too many instruction prefixes for a legal instruction\n");
+            DPRINTK(XENLOG_DEBUG "Too many instruction prefixes for a "
+                    "legal instruction\n");
             goto fail;
         }
 
@@ -315,7 +316,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
         case 0x26: /* ES override */
         case 0x64: /* FS override */
         case 0x36: /* SS override */
-            DPRINTK("Unhandled prefix %02x\n", b);
+            DPRINTK(XENLOG_DEBUG "Unhandled prefix %02x\n", b);
             goto fail;
         case 0x66: /* Operand-size override */
         case 0xf0: /* LOCK */
@@ -333,7 +334,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
 
     if ( !gs_override )
     {
-        DPRINTK("Only instructions with GS override\n");
+        DPRINTK(XENLOG_DEBUG "Only instructions with GS override\n");
         goto fail;
     }
 
@@ -341,7 +342,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
     pb++;
     if ( decode == 0 )
     {
-        DPRINTK("Unsupported opcode %02x\n", b);
+        DPRINTK(XENLOG_DEBUG "Unsupported opcode %02x\n", b);
         goto fail;
     }
     
@@ -353,7 +354,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
 
         if ( get_user(offset, (u32 *)pb) )
         {
-            DPRINTK("Fault while extracting <disp32>.\n");
+            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp32>.\n");
             goto page_fault;
         }
         pb += 4;
@@ -367,7 +368,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
 
     if ( get_user(modrm, pb) )
     {
-        DPRINTK("Fault while extracting modrm byte\n");
+        DPRINTK(XENLOG_DEBUG "Fault while extracting modrm byte\n");
         goto page_fault;
     }
 
@@ -379,7 +380,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
 
     if ( rm == 4 )
     {
-        DPRINTK("FIXME: Add decoding for the SIB byte.\n");
+        DPRINTK(XENLOG_DEBUG "FIXME: Add decoding for the SIB byte.\n");
         goto fixme;
     }
 
@@ -397,7 +398,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
             memreg = NULL;
             if ( get_user(disp32, (u32 *)pb) )
             {
-                DPRINTK("Fault while extracting <disp8>.\n");
+                DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
                 goto page_fault;
             }
             pb += 4;
@@ -407,7 +408,7 @@ int gpf_emulate_4gb(struct cpu_user_regs
     case 1:
         if ( get_user(disp8, pb) )
         {
-            DPRINTK("Fault while extracting <disp8>.\n");
+            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
             goto page_fault;
         }
         pb++;
@@ -417,14 +418,14 @@ int gpf_emulate_4gb(struct cpu_user_regs
     case 2:
         if ( get_user(disp32, (u32 *)pb) )
         {
-            DPRINTK("Fault while extracting <disp8>.\n");
+            DPRINTK(XENLOG_DEBUG "Fault while extracting <disp8>.\n");
             goto page_fault;
         }
         pb += 4;
         break;
 
     case 3:
-        DPRINTK("Not a memory operand!\n");
+        DPRINTK(XENLOG_DEBUG "Not a memory operand!\n");
         goto fail;
     }
 
@@ -455,7 +456,8 @@ int gpf_emulate_4gb(struct cpu_user_regs
     return EXCRET_fault_fixed;
 
  fixme:
-    DPRINTK("Undecodable instruction %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
+    DPRINTK(XENLOG_DEBUG "Undecodable instruction "
+            "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
             "caused GPF(0) at %04x:%08x\n",
             eip[0], eip[1], eip[2], eip[3],
             eip[4], eip[5], eip[6], eip[7],
diff -r 476ca22b548e xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/arch/x86/x86_64/traps.c       Fri Oct 27 11:11:42 2006 -0400
@@ -206,7 +206,8 @@ unsigned long do_iret(void)
     if ( unlikely(copy_from_user(&iret_saved, (void *)regs->rsp,
                                  sizeof(iret_saved))) )
     {
-        DPRINTK("Fault while reading IRET context from guest stack\n");
+        DPRINTK(XENLOG_G_ERR "Fault while reading IRET context from "
+                "guest stack\n");
         domain_crash_synchronous();
     }
 
@@ -215,7 +216,8 @@ unsigned long do_iret(void)
     {
         if ( unlikely(pagetable_is_null(v->arch.guest_table_user)) )
         {
-            DPRINTK("Guest switching to user mode with no user page tables\n");
+            DPRINTK(XENLOG_G_ERR "Guest switching to user mode with no "
+                    "user page tables\n");
             domain_crash_synchronous();
         }
         toggle_guest_mode(v);
diff -r 476ca22b548e xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h  Fri Oct 27 11:11:41 2006 -0400
+++ b/xen/include/asm-x86/mm.h  Fri Oct 27 11:11:42 2006 -0400
@@ -213,7 +213,8 @@ static inline int get_page(struct page_i
              unlikely(d != _domain) )                /* Wrong owner? */
         {
             if ( !_shadow_mode_refcounts(domain) )
-                DPRINTK("Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%" 
+                DPRINTK(XENLOG_G_INFO
+                        "Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%"
                         PRtype_info "\n",
                         page_to_mfn(page), domain, unpickle_domptr(d),
                         x, page->u.inuse.type_info);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 4/6 V2] log level DPRINTK x86, Steven Rostedt <=