diff options
-rw-r--r-- | xen/arch/x86/hvm/io.c | 1 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vmx/vmx.c | 19 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/support.h | 3 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vcpu.h | 2 |
4 files changed, 16 insertions, 9 deletions
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c index f5c13d131b..a56ac43331 100644 --- a/xen/arch/x86/hvm/io.c +++ b/xen/arch/x86/hvm/io.c @@ -406,6 +406,7 @@ static void hvm_pio_assist(struct cpu_user_regs *regs, ioreq_t *p, printk("Error: %s unknown port size\n", __FUNCTION__); domain_crash_synchronous(); } + TRACE_VMEXIT(3, regs->eax); } } diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index ca0bfbde75..06c0ca71b8 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -47,9 +47,6 @@ #include <asm/hvm/vlapic.h> #include <asm/x86_emulate.h> -static DEFINE_PER_CPU(unsigned long, trace_values[5]); -#define TRACE_VMEXIT(index,value) this_cpu(trace_values)[index]=value - static void vmx_ctxt_switch_from(struct vcpu *v); static void vmx_ctxt_switch_to(struct vcpu *v); @@ -1051,7 +1048,7 @@ static void vmx_io_instruction(unsigned long exit_qualification, else port = regs->edx & 0xffff; - TRACE_VMEXIT(1,port); + TRACE_VMEXIT(1, port); size = (exit_qualification & 7) + 1; dir = test_bit(3, &exit_qualification); /* direction */ @@ -1115,6 +1112,9 @@ static void vmx_io_instruction(unsigned long exit_qualification, if ( port == 0xe9 && dir == IOREQ_WRITE && size == 1 ) hvm_print_line(current, regs->eax); /* guest debug output */ + if ( dir == IOREQ_WRITE ) + TRACE_VMEXIT(2, regs->eax); + regs->eip += inst_len; send_pio_req(port, 1, size, regs->eax, dir, df, 0); } @@ -2317,12 +2317,13 @@ asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs) asmlinkage void vmx_trace_vmentry(void) { + struct vcpu *v = current; TRACE_5D(TRC_VMX_VMENTRY + current->vcpu_id, - this_cpu(trace_values)[0], - this_cpu(trace_values)[1], - this_cpu(trace_values)[2], - this_cpu(trace_values)[3], - this_cpu(trace_values)[4]); + v->arch.hvm_vcpu.hvm_trace_values[0], + v->arch.hvm_vcpu.hvm_trace_values[1], + v->arch.hvm_vcpu.hvm_trace_values[2], + v->arch.hvm_vcpu.hvm_trace_values[3], + v->arch.hvm_vcpu.hvm_trace_values[4]); TRACE_VMEXIT(0, 0); TRACE_VMEXIT(1, 0); diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h index 440cbfee69..f9ab090dfe 100644 --- a/xen/include/asm-x86/hvm/support.h +++ b/xen/include/asm-x86/hvm/support.h @@ -125,6 +125,9 @@ extern unsigned int opt_hvm_debug_level; domain_crash_synchronous(); \ } while (0) +#define TRACE_VMEXIT(index, value) \ + current->arch.hvm_vcpu.hvm_trace_values[index] = (value) + extern int hvm_enabled; int hvm_copy_to_guest_phys(paddr_t paddr, void *buf, int size); diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h index f613ae6a09..8945916d32 100644 --- a/xen/include/asm-x86/hvm/vcpu.h +++ b/xen/include/asm-x86/hvm/vcpu.h @@ -47,6 +47,8 @@ struct hvm_vcpu { /* hlt ins emulation wakeup timer */ struct timer hlt_timer; + unsigned long hvm_trace_values[5]; + union { struct arch_vmx_struct vmx; struct arch_svm_struct svm; |