// Dump out the instr stream
//PrintDebug("RIP: %x\n", guest_state->rip);
- PrintDebug("RIP Linear: %x\n", get_addr_linear(info, info->rip, &(info->segments.cs)));
+ PrintDebug("RIP Linear: %p\n", (void *)get_addr_linear(info, info->rip, &(info->segments.cs)));
// OK, now we will read the instruction
// The only difference between PROTECTED and PROTECTED_PG is whether we read
#ifdef DEBUG_CTRL_REGS
PrintDebug("CR0 Write\n");
#endif
- if (handle_cr0_write(info) == -1) {
+ if (v3_handle_cr0_write(info) == -1) {
return -1;
}
}
#ifdef DEBUG_CTRL_REGS
PrintDebug("CR0 Read\n");
#endif
- if (handle_cr0_read(info) == -1) {
+ if (v3_handle_cr0_read(info) == -1) {
return -1;
}
}
#ifdef DEBUG_CTRL_REGS
PrintDebug("CR3 Write\n");
#endif
- if (handle_cr3_write(info) == -1) {
+ if (v3_handle_cr3_write(info) == -1) {
return -1;
}
}
#ifdef DEBUG_CTRL_REGS
PrintDebug("CR3 Read\n");
#endif
- if (handle_cr3_read(info) == -1) {
+ if (v3_handle_cr3_read(info) == -1) {
return -1;
}
}
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 (handle_shadow_pagefault(info, fault_addr, *error_code) == -1) {
+ if (v3_handle_shadow_pagefault(info, fault_addr, *error_code) == -1) {
return -1;
}
} else {
#ifdef DEBUG_SHADOW_PAGING
PrintDebug("Invlpg\n");
#endif
- if (handle_shadow_invlpg(info) == -1) {
+ if (v3_handle_shadow_invlpg(info) == -1) {
return -1;
}
}
rip_addr = get_addr_linear(info, guest_state->rip, &(info->segments.cs));
- PrintError("SVM Returned:(VMCB=%x)\n", info->vmm_data);
- PrintError("RIP: %x\n", guest_state->rip);
- PrintError("RIP Linear: %x\n", rip_addr);
+ PrintError("SVM Returned:(VMCB=%p)\n", (void *)(info->vmm_data));
+ PrintError("RIP: %p\n", (void *)(guest_state->rip));
+ PrintError("RIP Linear: %p\n", (void *)(rip_addr));
- PrintError("SVM Returned: Exit Code: %x\n", exit_code);
+ PrintError("SVM Returned: Exit Code: %p\n", (void *)exit_code);
PrintError("io_info1 low = 0x%.8x\n", *(uint_t*)&(guest_ctrl->exit_info1));
PrintError("io_info1 high = 0x%.8x\n", *(uint_t *)(((uchar_t *)&(guest_ctrl->exit_info1)) + 4));
if (info->mem_mode == PHYSICAL_MEM) {
- if (guest_pa_to_host_pa(info, guest_state->rip, &host_addr) == -1) {
+ if (guest_pa_to_host_va(info, guest_state->rip, &host_addr) == -1) {
PrintError("Could not translate guest_state->rip to host address\n");
return -1;
}
} else if (info->mem_mode == VIRTUAL_MEM) {
- if (guest_va_to_host_pa(info, guest_state->rip, &host_addr) == -1) {
+ if (guest_va_to_host_va(info, guest_state->rip, &host_addr) == -1) {
PrintError("Could not translate guest_state->rip to host address\n");
return -1;
}
return -1;
}
- PrintError("Host Address of rip = 0x%x\n", host_addr);
+ PrintError("Host Address of rip = 0x%p\n", (void *)host_addr);
memset(buf, 0, 32);
- PrintError("Reading instruction stream in guest\n", rip_addr);
+ PrintError("Reading instruction stream in guest (addr=%p)\n", (void *)rip_addr);
if (info->mem_mode == PHYSICAL_MEM) {
- read_guest_pa_memory(info, rip_addr-16, 32, buf);
+ read_guest_pa_memory(info, rip_addr - 16, 32, buf);
} else {
- read_guest_va_memory(info, rip_addr-16, 32, buf);
+ read_guest_va_memory(info, rip_addr - 16, 32, buf);
}
PrintDebug("16 bytes before Rip\n");
// Update the low level state
- if (intr_pending(info)) {
+ if (v3_intr_pending(info)) {
- switch (get_intr_type(info)) {
+ switch (v3_get_intr_type(info)) {
case EXTERNAL_IRQ:
{
- uint_t irq = get_intr_number(info);
+ uint_t irq = v3_get_intr_number(info);
// check to see if ==-1 (non exists)
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
- injecting_intr(info, irq, EXTERNAL_IRQ);
+ v3_injecting_intr(info, irq, EXTERNAL_IRQ);
break;
}
break;
case EXCEPTION:
{
- uint_t excp = get_intr_number(info);
+ uint_t excp = v3_get_intr_number(info);
guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION;
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
- injecting_intr(info, excp, EXCEPTION);
+ v3_injecting_intr(info, excp, EXCEPTION);
break;
}
case SOFTWARE_INTR: