ia64/xen-unstable

changeset 3800:16e48b864f0f

bitkeeper revision 1.1187 (420d5134SJno8yarcAiRNJqFJ5adEA)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/iap10/xeno-clone/xen-unstable.bk
author iap10@freefall.cl.cam.ac.uk
date Sat Feb 12 00:43:32 2005 +0000 (2005-02-12)
parents b5a5aa93e24f a8a0bf99c4fb
children 69f8d9612f8d 1204ff2a3eca
files xen/arch/x86/vmx.c xen/include/xen/perfc.h xen/include/xen/perfc_defn.h
line diff
     1.1 --- a/xen/arch/x86/vmx.c	Fri Feb 11 18:55:16 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx.c	Sat Feb 12 00:43:32 2005 +0000
     1.3 @@ -685,6 +685,8 @@ asmlinkage void vmx_vmexit_handler(struc
     1.4      if ((error = __vmread(VM_EXIT_REASON, &exit_reason)))
     1.5          __vmx_bug(&regs);
     1.6      
     1.7 +    perfc_incra(vmexits, exit_reason);
     1.8 +
     1.9      __vmread(IDT_VECTORING_INFO_FIELD, &idtv_info_field);
    1.10      if (idtv_info_field & INTR_INFO_VALID_MASK) {
    1.11          __vmwrite(VM_ENTRY_INTR_INFO_FIELD, idtv_info_field);
    1.12 @@ -729,6 +731,8 @@ asmlinkage void vmx_vmexit_handler(struc
    1.13              __vmx_bug(&regs);
    1.14          vector &= 0xff;
    1.15  
    1.16 +        perfc_incra(cause_vector, vector);
    1.17 +
    1.18          switch (vector) {
    1.19  #ifdef XEN_DEBUGGER
    1.20          case VECTOR_DB:
     2.1 --- a/xen/include/xen/perfc.h	Fri Feb 11 18:55:16 2005 +0000
     2.2 +++ b/xen/include/xen/perfc.h	Sat Feb 12 00:43:32 2005 +0000
     2.3 @@ -55,17 +55,25 @@ extern struct perfcounter_t perfcounters
     2.4  
     2.5  #define perfc_value(x)    atomic_read(&perfcounters.x[0])
     2.6  #define perfc_valuec(x)   atomic_read(&perfcounters.x[smp_processor_id()])
     2.7 -#define perfc_valuea(x,y) atomic_read(&perfcounters.x[y])
     2.8 +#define perfc_valuea(x,y) \
     2.9 +  { if(y<(sizeof(perfcounters.x)/sizeof(*perfcounters.x))) \
    2.10 +    atomic_read(&perfcounters.x[y]); }
    2.11  #define perfc_set(x,v)    atomic_set(&perfcounters.x[0], v)
    2.12  #define perfc_setc(x,v)   atomic_set(&perfcounters.x[smp_processor_id()], v)
    2.13 -#define perfc_seta(x,y,v) atomic_set(&perfcounters.x[y], v)
    2.14 +#define perfc_seta(x,y,v) \
    2.15 +  { if(y<(sizeof(perfcounters.x)/sizeof(*perfcounters.x))) \
    2.16 +    atomic_set(&perfcounters.x[y], v); }
    2.17  #define perfc_incr(x)     atomic_inc(&perfcounters.x[0])
    2.18  #define perfc_decr(x)     atomic_dec(&perfcounters.x[0])
    2.19  #define perfc_incrc(x)    atomic_inc(&perfcounters.x[smp_processor_id()])
    2.20 -#define perfc_incra(x,y)  atomic_inc(&perfcounters.x[y])
    2.21 +#define perfc_incra(x,y)  \
    2.22 +  { if(y<(sizeof(perfcounters.x)/sizeof(*perfcounters.x))) \
    2.23 +    atomic_inc(&perfcounters.x[y]); }
    2.24  #define perfc_add(x,y)    atomic_add((y), &perfcounters.x[0])
    2.25  #define perfc_addc(x,y)   atomic_add((y), &perfcounters.x[smp_processor_id()])
    2.26 -#define perfc_adda(x,y,z) atomic_add((z), &perfcounters.x[y])
    2.27 +#define perfc_adda(x,y,z) \
    2.28 +  { if(y<(sizeof(perfcounters.x)/sizeof(*perfcounters.x))) \
    2.29 +    atomic_add((z), &perfcounters.x[y]); }
    2.30  
    2.31  #else /* PERF_COUNTERS */
    2.32  
     3.1 --- a/xen/include/xen/perfc_defn.h	Fri Feb 11 18:55:16 2005 +0000
     3.2 +++ b/xen/include/xen/perfc_defn.h	Sat Feb 12 00:43:32 2005 +0000
     3.3 @@ -30,3 +30,8 @@ PERFCOUNTER_CPU( shadow_update_va_fail, 
     3.4  /* STATUS counters do not reset when 'P' is hit */
     3.5  PERFSTATUS( shadow_l2_pages, "current # shadow L2 pages" )
     3.6  PERFSTATUS( shadow_l1_pages, "current # shadow L1 pages" )
     3.7 +
     3.8 +#define VMX_PERF_EXIT_REASON_SIZE 37
     3.9 +#define VMX_PERF_VECTOR_SIZE 0x20
    3.10 +PERFCOUNTER_ARRAY(vmexits, "vmexits", VMX_PERF_EXIT_REASON_SIZE )
    3.11 +PERFCOUNTER_ARRAY(cause_vector, "cause vector", VMX_PERF_VECTOR_SIZE )