From: Jack Lange Date: Wed, 22 Oct 2008 16:45:01 +0000 (-0500) Subject: more printf format fixes X-Git-Tag: 1.0^2~7 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=2ff2b6c0456f332f5dfbaffdf943c07765709173 more printf format fixes --- diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index a2b942f..fece42c 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -190,7 +190,8 @@ int v3_handle_svm_exit(struct guest_info * info) { addr_t fault_addr = guest_ctrl->exit_info2; pf_error_t * error_code = (pf_error_t *)&(guest_ctrl->exit_info1); #ifdef DEBUG_SHADOW_PAGING - PrintDebug("PageFault at %x (error=%d)\n", fault_addr, *error_code); + PrintDebug("PageFault at %p (error=%d)\n", + (void *)fault_addr, *(uint_t *)error_code); #endif if (info->shdw_pg_mode == SHADOW_PAGING) { if (v3_handle_shadow_pagefault(info, fault_addr, *error_code) == -1) { @@ -414,7 +415,9 @@ int v3_handle_svm_exit(struct guest_info * info) { guest_ctrl->guest_ctrl.V_IGN_TPR = 1; guest_ctrl->guest_ctrl.V_INTR_PRIO = 0xf; #ifdef DEBUG_INTERRUPTS - PrintDebug("Injecting Interrupt %d (EIP=%x)\n", guest_ctrl->guest_ctrl.V_INTR_VECTOR, info->rip); + PrintDebug("Injecting Interrupt %d (EIP=%p)\n", + guest_ctrl->guest_ctrl.V_INTR_VECTOR, + (void *)info->rip); #endif v3_injecting_intr(info, irq, EXTERNAL_IRQ); @@ -441,7 +444,9 @@ int v3_handle_svm_exit(struct guest_info * info) { guest_ctrl->EVENTINJ.valid = 1; #ifdef DEBUG_INTERRUPTS - PrintDebug("Injecting Interrupt %d (EIP=%x)\n", guest_ctrl->EVENTINJ.vector, info->rip); + PrintDebug("Injecting Interrupt %d (EIP=%p)\n", + guest_ctrl->EVENTINJ.vector, + (void *)info->rip); #endif v3_injecting_intr(info, excp, EXCEPTION); break; diff --git a/palacios/src/palacios/svm_io.c b/palacios/src/palacios/svm_io.c index c46d45a..d4af89f 100644 --- a/palacios/src/palacios/svm_io.c +++ b/palacios/src/palacios/svm_io.c @@ -170,7 +170,8 @@ int v3_handle_svm_io_ins(struct guest_info * info) { // This value should be set depending on the host register size... mask = get_gpr_mask(info); - PrintDebug("INS io_info invalid address size, mask=0x%x, io_info=0x%x\n",mask,*((uint_t*)(io_info))); + PrintDebug("INS io_info invalid address size, mask=0x%p, io_info=0x%p\n", + (void *)mask, (void *)(io_info)); // PrintDebug("INS Aborted... Check implementation\n"); //return -1; } @@ -187,7 +188,7 @@ int v3_handle_svm_io_ins(struct guest_info * info) { addr_t host_addr; dst_addr = get_addr_linear(info, info->vm_regs.rdi & mask, theseg); - PrintDebug("Writing 0x%x\n", dst_addr); + PrintDebug("Writing 0x%p\n", (void *)dst_addr); if (guest_va_to_host_va(info, dst_addr, &host_addr) == -1) { // either page fault or gpf... @@ -309,7 +310,8 @@ int v3_handle_svm_io_outs(struct guest_info * info) { // This value should be set depending on the host register size... mask = get_gpr_mask(info); - PrintDebug("OUTS io_info invalid address size, mask=0x%, io_info=0x%x\n",mask,*((uint_t*)(io_info))); + PrintDebug("OUTS io_info invalid address size, mask=0%p, io_info=0x%p\n", + (void *)mask, (void *)io_info); // PrintDebug("INS Aborted... Check implementation\n"); //return -1; // should never happen diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c index 87fbcdb..46e1e42 100644 --- a/palacios/src/palacios/vmm_intr.c +++ b/palacios/src/palacios/vmm_intr.c @@ -88,7 +88,8 @@ int v3_hook_irq(struct guest_info * info, static int passthrough_irq_handler(struct guest_info * info, struct v3_interrupt * intr, void * priv_data) { - PrintDebug("[passthrough_irq_handler] raise_irq=%d (guest=0x%x)\n", intr->irq, info); + PrintDebug("[passthrough_irq_handler] raise_irq=%d (guest=0x%p)\n", + intr->irq, (void *)info); return v3_raise_irq(info, intr->irq); } @@ -115,7 +116,7 @@ int v3_hook_passthrough_irq(struct guest_info * info, uint_t irq) int v3_deliver_irq(struct guest_info * info, struct v3_interrupt * intr) { - PrintDebug("v3_deliver_irq: irq=%d state=0x%x, \n", intr->irq, intr); + PrintDebug("v3_deliver_irq: irq=%d state=0x%p, \n", intr->irq, (void *)intr); struct v3_irq_hook * hook = get_irq_hook(info, intr->irq); diff --git a/palacios/src/palacios/vmm_io.c b/palacios/src/palacios/vmm_io.c index d334c73..514d8e1 100644 --- a/palacios/src/palacios/vmm_io.c +++ b/palacios/src/palacios/vmm_io.c @@ -176,7 +176,9 @@ void v3_print_io_map(struct vmm_io_map * io_map) { PrintDebug("VMM IO Map (Entries=%d)\n", io_map->num_ports); while (iter) { - PrintDebug("IO Port: %hu (Read=%x) (Write=%x)\n", iter->port, iter->read, iter->write); + PrintDebug("IO Port: %hu (Read=%p) (Write=%p)\n", + iter->port, + (void *)(iter->read), (void *)(iter->write)); } } diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index 06d79f5..83ffff2 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -320,7 +320,7 @@ static int handle_large_pagefault32(struct guest_info * info, if (host_page_type == HOST_REGION_INVALID) { // Inject a machine check in the guest - PrintDebug("Invalid Guest Address in page table (0x%x)\n", guest_fault_pa); + PrintDebug("Invalid Guest Address in page table (0x%p)\n", (void *)guest_fault_pa); v3_raise_exception(info, MC_EXCEPTION); return 0; } @@ -410,7 +410,7 @@ static int handle_shadow_pagefault32(struct guest_info * info, addr_t fault_addr /* Was the page fault caused by the Guest's page tables? */ if (is_guest_pf(guest_pde_access, shadow_pde_access) == 1) { PrintDebug("Injecting PDE pf to guest: (guest access error=%d) (pf error code=%d)\n", - guest_pde_access, error_code); + *(uint_t *)&guest_pde_access, *(uint_t *)&error_code); inject_guest_pf(info, fault_addr, error_code); return 0; } @@ -512,7 +512,7 @@ static int handle_shadow_pagefault32(struct guest_info * info, addr_t fault_addr return 0; } - PrintDebug("Returning end of PDE function (rip=%x)\n", info->rip); + PrintDebug("Returning end of PDE function (rip=%p)\n", (void *)(info->rip)); return 0; } @@ -573,7 +573,7 @@ static int handle_shadow_pte32_fault(struct guest_info * info, if (host_page_type == HOST_REGION_INVALID) { // Inject a machine check in the guest - PrintDebug("Invalid Guest Address in page table (0x%x)\n", guest_pa); + PrintDebug("Invalid Guest Address in page table (0x%p)\n", (void *)guest_pa); v3_raise_exception(info, MC_EXCEPTION); return 0; } @@ -599,7 +599,7 @@ static int handle_shadow_pte32_fault(struct guest_info * info, if (find_pte_map(state->cached_ptes, PT32_PAGE_ADDR(guest_pa)) != NULL) { // Check if the entry is a page table... - PrintDebug("Marking page as Guest Page Table\n", shadow_pte->writable); + PrintDebug("Marking page as Guest Page Table %d\n", shadow_pte->writable); shadow_pte->vmm_info = PT32_GUEST_PT; } @@ -720,7 +720,7 @@ int v3_handle_shadow_invlpg(struct guest_info * info) { //PrintDebug("PDE Index=%d\n", PDE32_INDEX(first_operand)); //PrintDebug("FirstOperand = %x\n", first_operand); - PrintDebug("Invalidating page for %x\n", first_operand); + PrintDebug("Invalidating page for %p\n", (void *)first_operand); guest_pde = (pde32_t *)&(guest_pd[PDE32_INDEX(first_operand)]);