ia64/xen-unstable

changeset 3807:d989598bb439

bitkeeper revision 1.1191 (420d5e29aNqroO-Dr8i5N9OF0PGu4A)

Subject: [PATCH] xentrace-vmx.patch

- Add VMX specific events to xentrace.
- Rename d -> ed
- cleanup dead code

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Sat Feb 12 01:38:49 2005 +0000 (2005-02-12)
parents 856c8d422f0d
children c62ae5f347a4
files xen/arch/x86/vmx.c
line diff
     1.1 --- a/xen/arch/x86/vmx.c	Sat Feb 12 01:05:30 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx.c	Sat Feb 12 01:38:49 2005 +0000
     1.3 @@ -21,6 +21,7 @@
     1.4  #include <xen/config.h>
     1.5  #include <xen/init.h>
     1.6  #include <xen/lib.h>
     1.7 +#include <xen/trace.h>
     1.8  #include <xen/sched.h>
     1.9  #include <asm/current.h>
    1.10  #include <asm/io.h>
    1.11 @@ -675,11 +676,14 @@ void restore_xen_regs(struct xen_regs *r
    1.12  }
    1.13  #endif
    1.14  
    1.15 +#define TRC_VMX_VMEXIT 0x00040001
    1.16 +#define TRC_VMX_VECTOR 0x00040002
    1.17 +
    1.18  asmlinkage void vmx_vmexit_handler(struct xen_regs regs)
    1.19  {
    1.20      unsigned int exit_reason, idtv_info_field;
    1.21      unsigned long exit_qualification, eip, inst_len = 0;
    1.22 -    struct exec_domain *d = current;
    1.23 +    struct exec_domain *ed = current;
    1.24      int error;
    1.25  
    1.26      if ((error = __vmread(VM_EXIT_REASON, &exit_reason)))
    1.27 @@ -707,12 +711,13 @@ asmlinkage void vmx_vmexit_handler(struc
    1.28          VMX_DBG_LOG(DBG_LEVEL_0, "exit reason = %x\n", exit_reason);
    1.29  
    1.30      if (exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) {
    1.31 -        __vmread(EXIT_QUALIFICATION, &exit_qualification);
    1.32 -        __vmread(GUEST_EIP, &eip);
    1.33          domain_crash();         
    1.34          return;
    1.35      }
    1.36  
    1.37 +    __vmread(GUEST_EIP, &eip);
    1.38 +    TRACE_3D(TRC_VMX_VMEXIT, ed->domain->id, eip, exit_reason);
    1.39 +
    1.40      switch (exit_reason) {
    1.41      case EXIT_REASON_EXCEPTION_NMI:
    1.42      {
    1.43 @@ -733,6 +738,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.44  
    1.45          perfc_incra(cause_vector, vector);
    1.46  
    1.47 +        TRACE_3D(TRC_VMX_VECTOR, ed->domain->id, eip, vector);
    1.48          switch (vector) {
    1.49  #ifdef XEN_DEBUGGER
    1.50          case VECTOR_DB:
    1.51 @@ -763,7 +769,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.52                      "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx\n",
    1.53                          regs.eax, regs.ebx, regs.ecx, regs.edx, regs.esi,
    1.54                          regs.edi);
    1.55 -            d->arch.arch_vmx.vmx_platform.mpci.inst_decoder_regs = &regs;
    1.56 +            ed->arch.arch_vmx.vmx_platform.mpci.inst_decoder_regs = &regs;
    1.57  
    1.58              if (!(error = vmx_do_page_fault(va, error_code))) {
    1.59                  /*
    1.60 @@ -777,7 +783,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.61                             VECTOR_PG);
    1.62                  __vmwrite(VM_ENTRY_INTR_INFO_FIELD, intr_fields);
    1.63                  __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
    1.64 -                d->arch.arch_vmx.cpu_cr2 = va;
    1.65 +                ed->arch.arch_vmx.cpu_cr2 = va;
    1.66              }
    1.67              break;
    1.68          }
    1.69 @@ -814,7 +820,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.70      case EXIT_REASON_PENDING_INTERRUPT:
    1.71          __vmwrite(CPU_BASED_VM_EXEC_CONTROL, 
    1.72                MONITOR_CPU_BASED_EXEC_CONTROLS);
    1.73 -        vmx_intr_assist(d);
    1.74 +        vmx_intr_assist(ed);
    1.75          break;
    1.76      case EXIT_REASON_TASK_SWITCH:
    1.77          __vmx_bug(&regs);
    1.78 @@ -844,7 +850,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.79          __vmread(GUEST_EIP, &eip);
    1.80          __vmread(EXIT_QUALIFICATION, &exit_qualification);
    1.81  
    1.82 -        vmx_print_line(regs.eax, d); /* provides the current domain */
    1.83 +        vmx_print_line(regs.eax, ed); /* provides the current domain */
    1.84          __update_guest_eip(inst_len);
    1.85          break;
    1.86      case EXIT_REASON_CR_ACCESS:
    1.87 @@ -892,7 +898,7 @@ asmlinkage void vmx_vmexit_handler(struc
    1.88          __vmx_bug(&regs);       /* should not happen */
    1.89      }
    1.90  
    1.91 -    vmx_intr_assist(d);
    1.92 +    vmx_intr_assist(ed);
    1.93      return;
    1.94  }
    1.95