diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index ed27e8def7..3ca3671a9e 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -2025,6 +2025,30 @@ void vmcs_dump_vcpu(struct vcpu *v) printk("Virtual processor ID = 0x%04x VMfunc controls = %016lx\n", vmr16(VIRTUAL_PROCESSOR_ID), vmr(VM_FUNCTION_CONTROL)); + { + struct hvm_emulate_ctxt ctxt; + const struct segment_register *cs; + + hvm_emulate_init_once(&ctxt, NULL, regs); + + cs = &ctxt.seg_reg[x86_seg_cs]; + + { + uint32_t walk = ((ctxt.seg_reg[x86_seg_ss].dpl == 3) + ? PFEC_user_mode : 0) | PFEC_insn_fetch; + unsigned long addr; + char bytes[32]; + + if ( hvm_virtual_to_linear_addr(x86_seg_cs, cs, regs->rip - 16, + sizeof(bytes), hvm_access_insn_fetch, + cs, &addr) && + (hvm_copy_from_guest_linear(bytes, addr, sizeof(bytes), + walk, NULL) == HVMTRANS_okay) ) + printk("*** Insn bytes from %lx: %16ph <%02x> %15ph\n", + addr, bytes, (unsigned int)bytes[16], &bytes[17]); + } + } + vmx_vmcs_exit(v); }