From: "Jan Beulich" Subject: [PATCH] x86/hvm: HVM_DBG_LOG() cleanup Date: Mon, 14 May 2007 17:45:49 +0200 Message-ID: <4648A04D.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org - make log levels used consistent in a few places - remove trailing newlines, dots, and commas - remove explictly specified function names from message text Signed-off-by: Jan Beulich Index: 2007-05-14/xen/arch/x86/hvm/svm/emulate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/svm/emulate.c 2007-04-23 = 10:01:41.000000000 +0200 +++ 2007-05-14/xen/arch/x86/hvm/svm/emulate.c 2007-05-14 14:33:28.0000000= 00 +0200 @@ -145,9 +145,8 @@ unsigned long get_effective_addr_modrm64 struct vcpu *v =3D current; struct vmcb_struct *vmcb =3D v->arch.hvm_svm.vmcb; =20 - HVM_DBG_LOG(DBG_LEVEL_1, "get_effective_addr_modrm64(): prefix =3D = %x, " - "length =3D %d, operand[0,1] =3D %x %x.\n", prefix, *size, = operand [0], - operand [1]); + HVM_DBG_LOG(DBG_LEVEL_1, "prefix =3D %x, length =3D %d, operand[0,1] = =3D %x %x", + prefix, *size, operand[0], operand[1]); =20 if ((NULL =3D=3D size) || (NULL =3D=3D operand) || (1 > *size)) { Index: 2007-05-14/xen/arch/x86/hvm/svm/svm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/svm/svm.c 2007-05-14 14:33:08.0000000= 00 +0200 +++ 2007-05-14/xen/arch/x86/hvm/svm/svm.c 2007-05-14 14:33:28.0000000= 00 +0200 @@ -135,7 +135,7 @@ static inline int long_mode_do_msr_write struct vcpu *v =3D current; struct vmcb_struct *vmcb =3D v->arch.hvm_svm.vmcb; =20 - HVM_DBG_LOG(DBG_LEVEL_1, "msr %x msr_content %"PRIx64"\n", + HVM_DBG_LOG(DBG_LEVEL_0, "msr %x msr_content %"PRIx64, ecx, msr_content); =20 switch ( ecx ) @@ -394,7 +394,7 @@ int svm_vmcb_restore(struct vcpu *v, str * If different, make a shadow. Check if the PDBR is valid * first. */ - HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 =3D %"PRIx64"", c->cr3); + HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 =3D %"PRIx64, c->cr3); mfn =3D gmfn_to_mfn(v->domain, c->cr3 >> PAGE_SHIFT); if( !mfn_valid(mfn) || !get_page(mfn_to_page(mfn), v->domain) = )=20 goto bad_cr3; @@ -1532,7 +1532,7 @@ static int svm_set_cr0(unsigned long val struct vmcb_struct *vmcb =3D v->arch.hvm_svm.vmcb; unsigned long old_base_mfn; =20 - HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value =3D %lx\n", value); + HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value =3D %lx", value); =20 /* ET is reserved and should be always be 1. */ value |=3D X86_CR0_ET; @@ -1557,11 +1557,11 @@ static int svm_set_cr0(unsigned long val { if ( !svm_cr4_pae_is_set(v) ) { - HVM_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE = enable\n"); + HVM_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE = enable"); svm_inject_exception(v, TRAP_gp_fault, 1, 0); return 0; } - HVM_DBG_LOG(DBG_LEVEL_1, "Enable the Long mode\n"); + HVM_DBG_LOG(DBG_LEVEL_1, "Enable the Long mode"); v->arch.hvm_svm.cpu_shadow_efer |=3D EFER_LMA; vmcb->efer |=3D EFER_LMA | EFER_LME; } @@ -1654,7 +1654,7 @@ static void mov_from_cr(int cr, int gp,=20 =20 set_reg(gp, value, regs, vmcb); =20 - HVM_DBG_LOG(DBG_LEVEL_VMMU, "mov_from_cr: CR%d, value =3D %lx,", cr, = value); + HVM_DBG_LOG(DBG_LEVEL_VMMU, "mov_from_cr: CR%d, value =3D %lx", cr, = value); } =20 =20 @@ -1672,8 +1672,8 @@ static int mov_to_cr(int gpreg, int cr,=20 =20 HVMTRACE_2D(CR_WRITE, v, cr, value); =20 - HVM_DBG_LOG(DBG_LEVEL_1, "mov_to_cr: CR%d, value =3D %lx,", cr, = value); - HVM_DBG_LOG(DBG_LEVEL_1, "current =3D %lx,", (unsigned long) = current); + HVM_DBG_LOG(DBG_LEVEL_1, "mov_to_cr: CR%d, value =3D %lx, current =3D = %p", + cr, value, v); =20 switch ( cr ) { Index: 2007-05-14/xen/arch/x86/hvm/vioapic.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/vioapic.c 2007-04-23 10:01:41.0000000= 00 +0200 +++ 2007-05-14/xen/arch/x86/hvm/vioapic.c 2007-05-14 14:33:28.0000000= 00 +0200 @@ -99,7 +99,7 @@ static unsigned long vioapic_read(struct struct hvm_hw_vioapic *vioapic =3D domain_vioapic(v->domain); uint32_t result; =20 - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "vioapic_read addr %lx\n", addr); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "addr %lx", addr); =20 addr &=3D 0xff; =20 @@ -183,8 +183,7 @@ static void vioapic_write_indirect( { uint32_t redir_index =3D (vioapic->ioregsel - 0x10) >> 1; =20 - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "vioapic_write_indirect " - "change redir index %x val %lx\n", + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "change redir index %x val %lx", redir_index, val); =20 if ( redir_index >=3D VIOAPIC_NUM_PINS ) @@ -252,8 +251,7 @@ static void ioapic_inj_irq( uint8_t trig_mode, uint8_t delivery_mode) { - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_inj_irq " - "irq %d trig %d delive mode %d\n", + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "irq %d trig %d deliv %d", vector, trig_mode, delivery_mode); =20 switch ( delivery_mode ) @@ -275,8 +273,8 @@ static uint32_t ioapic_get_delivery_bitm uint32_t mask =3D 0; struct vcpu *v; =20 - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_get_delivery_bitmask " - "dest %d dest_mode %d\n", dest, dest_mode); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "dest %d dest_mode %d", + dest, dest_mode); =20 if ( dest_mode =3D=3D 0 ) /* Physical mode. */ { @@ -304,7 +302,7 @@ static uint32_t ioapic_get_delivery_bitm } =20 out: - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_get_delivery_bitmask mask = %x\n", + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "mask %x", mask); return mask; } @@ -331,14 +329,13 @@ static void vioapic_deliver(struct hvm_h =20 HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "dest=3D%x dest_mode=3D%x delivery_mode=3D%x " - "vector=3D%x trig_mode=3D%x\n", + "vector=3D%x trig_mode=3D%x", dest, dest_mode, delivery_mode, vector, trig_mode); =20 deliver_bitmask =3D ioapic_get_delivery_bitmask(vioapic, dest, = dest_mode); if ( !deliver_bitmask ) { - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic deliver " - "no target on destination\n"); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "no target on destination"); return; } =20 @@ -364,7 +361,7 @@ static void vioapic_deliver(struct hvm_h else { HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "null round robin: " - "mask=3D%x vector=3D%x delivery_mode=3D%x\n", + "mask=3D%x vector=3D%x delivery_mode=3D%x", deliver_bitmask, vector, dest_LowestPrio); } break; @@ -412,7 +409,7 @@ void vioapic_irq_positive_edge(struct do struct hvm_hw_vioapic *vioapic =3D domain_vioapic(d); union vioapic_redir_entry *ent; =20 - HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "ioapic_irq_positive_edge irq %x", = irq); + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "irq %x", irq); =20 ASSERT(irq < VIOAPIC_NUM_PINS); ASSERT(spin_is_locked(&d->arch.hvm_domain.irq_lock)); Index: 2007-05-14/xen/arch/x86/hvm/vlapic.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/vlapic.c 2007-04-23 10:01:41.0000000= 00 +0200 +++ 2007-05-14/xen/arch/x86/hvm/vlapic.c 2007-05-14 14:33:28.0000000= 00 +0200 @@ -171,7 +171,7 @@ uint32_t vlapic_get_ppr(struct vlapic *v ppr =3D isrv & 0xf0; =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC_INTERRUPT, - "vlapic %p, ppr 0x%x, isr 0x%x, isrv 0x%x.", + "vlapic %p, ppr 0x%x, isr 0x%x, isrv 0x%x", vlapic, ppr, isr, isrv); =20 return ppr; @@ -211,7 +211,7 @@ static int vlapic_match_dest(struct vcpu struct vlapic *target =3D vcpu_vlapic(v); =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "target %p, source %p, dest 0x%x, " - "dest_mode 0x%x, short_hand 0x%x\n", + "dest_mode 0x%x, short_hand 0x%x", target, source, dest, dest_mode, short_hand); =20 switch ( short_hand ) @@ -270,14 +270,14 @@ static int vlapic_accept_irq(struct vcpu if ( vlapic_test_and_set_irr(vector, vlapic) && trig_mode ) { HVM_DBG_LOG(DBG_LEVEL_VLAPIC, - "level trig mode repeatedly for vector %d\n", = vector); + "level trig mode repeatedly for vector %d", = vector); break; } =20 if ( trig_mode ) { HVM_DBG_LOG(DBG_LEVEL_VLAPIC, - "level trig mode for vector %d\n", vector); + "level trig mode for vector %d", vector); vlapic_set_vector(vector, &vlapic->regs->data[APIC_TMR]); } =20 @@ -399,7 +399,7 @@ static void vlapic_ipi(struct vlapic *vl =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "icr_high 0x%x, icr_low 0x%x, " "short_hand 0x%x, dest 0x%x, trig_mode 0x%x, level 0x%x, = " - "dest_mode 0x%x, delivery_mode 0x%x, vector 0x%x.", + "dest_mode 0x%x, delivery_mode 0x%x, vector 0x%x", icr_high, icr_low, short_hand, dest, trig_mode, level, dest_mode, delivery_mode, vector); =20 @@ -437,7 +437,7 @@ static uint32_t vlapic_get_tmcct(struct=20 =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "timer initial count %d, timer current count %d, " - "offset %"PRId64".", + "offset %"PRId64, tmict, tmcct, counter_passed); =20 return tmcct; @@ -454,7 +454,7 @@ static void vlapic_set_tdcr(struct vlapi vlapic->hw.timer_divisor =3D 1 << (val & 7); =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, - "vlapic_set_tdcr timer_divisor: %d.", vlapic->hw.timer_div= isor); + "timer_divisor: %d", vlapic->hw.timer_divisor); } =20 static void vlapic_read_aligned(struct vlapic *vlapic, unsigned int = offset, @@ -493,7 +493,7 @@ static unsigned long vlapic_read(struct=20 /* some bugs on kernel cause read this with byte*/ if ( len !=3D 4 ) HVM_DBG_LOG(DBG_LEVEL_VLAPIC, - "read with len=3D0x%lx, should be 4 instead.\n", + "read with len=3D0x%lx, should be 4 instead", len); =20 alignment =3D offset & 0x3; @@ -522,7 +522,7 @@ static unsigned long vlapic_read(struct=20 } =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "offset 0x%x with length 0x%lx, " - "and the result is 0x%lx.", offset, len, result); + "and the result is 0x%lx", offset, len, result); =20 return result; =20 @@ -539,7 +539,7 @@ static void vlapic_write(struct vcpu *v, =20 if ( offset !=3D 0xb0 ) HVM_DBG_LOG(DBG_LEVEL_VLAPIC, - "offset 0x%x with length 0x%lx, and value is 0x%lx.", + "offset 0x%x with length 0x%lx, and value is 0x%lx", offset, len, val); =20 /* @@ -713,7 +713,7 @@ void vlapic_msr_set(struct vlapic *vlapi vlapic->hw.apic_base_msr =3D value; =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, - "apic base msr is 0x%016"PRIx64".", vlapic->hw.apic_base_m= sr); + "apic base msr is 0x%016"PRIx64, vlapic->hw.apic_base_msr)= ; } =20 int vlapic_accept_pic_intr(struct vcpu *v) @@ -913,7 +913,7 @@ int vlapic_init(struct vcpu *v) { struct vlapic *vlapic =3D vcpu_vlapic(v); =20 - HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "vlapic_init %d", v->vcpu_id); + HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "%d", v->vcpu_id); =20 vlapic->regs_page =3D alloc_domheap_page(NULL); if ( vlapic->regs_page =3D=3D NULL ) Index: 2007-05-14/xen/arch/x86/hvm/vmx/vmx.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/vmx/vmx.c 2007-05-14 14:33:24.0000000= 00 +0200 +++ 2007-05-14/xen/arch/x86/hvm/vmx/vmx.c 2007-05-14 14:33:28.0000000= 00 +0200 @@ -111,10 +111,11 @@ static void vmx_save_host_msrs(void) static inline int long_mode_do_msr_read(struct cpu_user_regs *regs) { u64 msr_content =3D 0; + u32 ecx =3D regs->ecx; struct vcpu *v =3D current; struct vmx_msr_state *guest_msr_state =3D &v->arch.hvm_vmx.msr_state; =20 - switch ( (u32)regs->ecx ) { + switch ( ecx ) { case MSR_EFER: msr_content =3D v->arch.hvm_vmx.efer; break; @@ -157,7 +158,7 @@ static inline int long_mode_do_msr_read( return 0; } =20 - HVM_DBG_LOG(DBG_LEVEL_2, "msr_content: 0x%"PRIx64, msr_content); + HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, ecx, msr_conten= t); =20 regs->eax =3D (u32)(msr_content >> 0); regs->edx =3D (u32)(msr_content >> 32); @@ -173,8 +174,7 @@ static inline int long_mode_do_msr_write struct vmx_msr_state *guest_msr_state =3D &v->arch.hvm_vmx.msr_state; struct vmx_msr_state *host_msr_state =3D &this_cpu(host_msr_state); =20 - HVM_DBG_LOG(DBG_LEVEL_1, "msr 0x%x msr_content 0x%"PRIx64"\n", - ecx, msr_content); + HVM_DBG_LOG(DBG_LEVEL_0, "msr 0x%x content 0x%"PRIx64, ecx, msr_conten= t); =20 switch ( ecx ) { @@ -262,7 +262,7 @@ static inline int long_mode_do_msr_write return 1; =20 uncanonical_address: - HVM_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write %x\n", ecx); + HVM_DBG_LOG(DBG_LEVEL_0, "Not cano address of msr write %x", ecx); gp_fault: vmx_inject_hw_exception(v, TRAP_gp_fault, 0); return 0; @@ -577,7 +577,7 @@ int vmx_vmcs_restore(struct vcpu *v, str * If different, make a shadow. Check if the PDBR is valid * first. */ - HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 =3D %"PRIx64"", c->cr3); + HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 =3D %"PRIx64, c->cr3); /* current!=3Dvcpu as not called by arch_vmx_do_launch */ mfn =3D gmfn_to_mfn(v->domain, c->cr3 >> PAGE_SHIFT); if( !mfn_valid(mfn) || !get_page(mfn_to_page(mfn), v->domain)) { @@ -2024,7 +2024,7 @@ static int vmx_set_cr0(unsigned long val unsigned long old_cr0; unsigned long old_base_mfn; =20 - HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value =3D %lx\n", value); + HVM_DBG_LOG(DBG_LEVEL_VMMU, "Update CR0 value =3D %lx", value); =20 /* ET is reserved and should be always be 1. */ value |=3D X86_CR0_ET; @@ -2073,12 +2073,12 @@ static int vmx_set_cr0(unsigned long val if ( !(v->arch.hvm_vmx.cpu_shadow_cr4 & X86_CR4_PAE) ) { HVM_DBG_LOG(DBG_LEVEL_1, "Guest enabled paging " - "with EFER.LME set but not CR4.PAE\n"); + "with EFER.LME set but not CR4.PAE"); vmx_inject_hw_exception(v, TRAP_gp_fault, 0); } else { - HVM_DBG_LOG(DBG_LEVEL_1, "Enabling long mode\n"); + HVM_DBG_LOG(DBG_LEVEL_1, "Enabling long mode"); v->arch.hvm_vmx.efer |=3D EFER_LMA; vm_entry_value =3D __vmread(VM_ENTRY_CONTROLS); vm_entry_value |=3D VM_ENTRY_IA32E_MODE; @@ -2139,7 +2139,7 @@ static int vmx_set_cr0(unsigned long val { eip =3D __vmread(GUEST_RIP); HVM_DBG_LOG(DBG_LEVEL_1, - "Transfering control to vmxassist %%eip 0x%lx\n", = eip); + "Transfering control to vmxassist %%eip 0x%lx", = eip); return 0; /* do not update eip! */ } } @@ -2147,12 +2147,12 @@ static int vmx_set_cr0(unsigned long val { eip =3D __vmread(GUEST_RIP); HVM_DBG_LOG(DBG_LEVEL_1, - "Enabling CR0.PE at %%eip 0x%lx\n", eip); + "Enabling CR0.PE at %%eip 0x%lx", eip); if ( vmx_assist(v, VMX_ASSIST_RESTORE) ) { eip =3D __vmread(GUEST_RIP); HVM_DBG_LOG(DBG_LEVEL_1, - "Restoring to %%eip 0x%lx\n", eip); + "Restoring to %%eip 0x%lx", eip); return 0; /* do not update eip! */ } } @@ -2310,7 +2310,7 @@ static int mov_to_cr(int gp, int cr, str if ( unlikely(vmx_long_mode_enabled(v)) ) { HVM_DBG_LOG(DBG_LEVEL_1, "Guest cleared CR4.PAE while " - "EFER.LMA is set\n"); + "EFER.LMA is set"); vmx_inject_hw_exception(v, TRAP_gp_fault, 0); } } @@ -2440,8 +2440,7 @@ static inline int vmx_do_msr_read(struct u32 ecx =3D regs->ecx, eax, edx; struct vcpu *v =3D current; =20 - HVM_DBG_LOG(DBG_LEVEL_1, "ecx=3D%x, eax=3D%x, edx=3D%x", - ecx, (u32)regs->eax, (u32)regs->edx); + HVM_DBG_LOG(DBG_LEVEL_1, "ecx=3D%x", ecx); =20 switch (ecx) { case MSR_IA32_TIME_STAMP_COUNTER: