diff -r 20204db0891b xen/arch/x86/hvm/io.c --- a/xen/arch/x86/hvm/io.c Thu Nov 02 18:52:04 2006 +0000 +++ b/xen/arch/x86/hvm/io.c Fri Nov 03 12:02:36 2006 +0800 @@ -406,6 +406,7 @@ static void hvm_pio_assist(struct cpu_us printk("Error: %s unknown port size\n", __FUNCTION__); domain_crash_synchronous(); } + TRACE_VMEXIT(3, regs->eax); } } diff -r 20204db0891b xen/arch/x86/hvm/vmx/vmx.c --- a/xen/arch/x86/hvm/vmx/vmx.c Thu Nov 02 18:52:04 2006 +0000 +++ b/xen/arch/x86/hvm/vmx/vmx.c Fri Nov 03 12:02:36 2006 +0800 @@ -47,9 +47,6 @@ #include #include -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); @@ -1109,7 +1106,7 @@ static void vmx_io_instruction(unsigned 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 */ @@ -1172,6 +1169,9 @@ static void vmx_io_instruction(unsigned } else { 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); @@ -2363,12 +2363,13 @@ asmlinkage void vmx_vmexit_handler(struc 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 -r 20204db0891b xen/include/asm-x86/hvm/support.h --- a/xen/include/asm-x86/hvm/support.h Thu Nov 02 18:52:04 2006 +0000 +++ b/xen/include/asm-x86/hvm/support.h Fri Nov 03 12:02:36 2006 +0800 @@ -135,6 +135,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 -r 20204db0891b xen/include/asm-x86/hvm/vcpu.h --- a/xen/include/asm-x86/hvm/vcpu.h Thu Nov 02 18:52:04 2006 +0000 +++ b/xen/include/asm-x86/hvm/vcpu.h Fri Nov 03 12:02:36 2006 +0800 @@ -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;